Hello,

I'm using the Windows Server 2003 SP1 DDK to build my drivers and I
want to build also my MFC applications in the same build process (as I
did it till now with the Windows 2000 DDK).
The DDK has a compiler version 13.x. For the new MFC8 projects from
VS2005 I need a compiler version 14.x from VS2005. I called
vcvarsall.bat from VS2005 in my DDK environment, so I have the new
compiler to build the MFC8 projects. After some changes for
MFC_INCLUDES, MFC_INC_PATH, MFC_LIB_PATH my MFC8 compiles fine with DDK
build.

But I can no longer link my drivers, because __except_handler4 and
__local_unwind4 are unresolved externals. cl.exe 13.x generates code
with __except_handler3, which I can link with wdm.lib. cl.exe 14.x
generates code with __except_handler4, which I can not link with
wdm.lib.
The MFC procject is linked with msvcrtd.lib, whichs contains
__except_handler3 and __except_handler4.
I have looked in the c2.dll of the cl 14.x. There I have found
__except_handler4 and also __except_handler3. So I think, there must be
a way to generate older exception handling with the new compiler.

Who does know a compiler switch to generate older exception handling
(__except_handler3) with the compiler cl 14.x from VS2005?

Thanks, Volker

Re: __except_handler3 instead __except_handler4 by Don

Don
Fri Dec 22 09:53:59 CST 2006

Loose the VS2005 compiler for building drivers, you are just asking for
trouble. You might try going to the WDK and see if the new environment
allows you to build your MFC application. But using anything other than a
compiler from the DDK to build drivers, is never worth the effort (having
spent weeks trying to find a bug that wasn't there for a customer who
decided to switch my driver to a VS compiler, and only mentioned it in
passing later on - hint the compiler was the BUG!!!!).


--
Don Burn (MVP, Windows DDK)
Windows 2k/XP/2k3 Filesystem and Driver Consulting
http://www.windrvr.com
Remove StopSpam from the email to reply




"Volker Schober" <vschober@gesytec.de> wrote in message
news:1166802281.079424.290800@a3g2000cwd.googlegroups.com...
> Hello,
>
> I'm using the Windows Server 2003 SP1 DDK to build my drivers and I
> want to build also my MFC applications in the same build process (as I
> did it till now with the Windows 2000 DDK).
> The DDK has a compiler version 13.x. For the new MFC8 projects from
> VS2005 I need a compiler version 14.x from VS2005. I called
> vcvarsall.bat from VS2005 in my DDK environment, so I have the new
> compiler to build the MFC8 projects. After some changes for
> MFC_INCLUDES, MFC_INC_PATH, MFC_LIB_PATH my MFC8 compiles fine with DDK
> build.
>
> But I can no longer link my drivers, because __except_handler4 and
> __local_unwind4 are unresolved externals. cl.exe 13.x generates code
> with __except_handler3, which I can link with wdm.lib. cl.exe 14.x
> generates code with __except_handler4, which I can not link with
> wdm.lib.
> The MFC procject is linked with msvcrtd.lib, whichs contains
> __except_handler3 and __except_handler4.
> I have looked in the c2.dll of the cl 14.x. There I have found
> __except_handler4 and also __except_handler3. So I think, there must be
> a way to generate older exception handling with the new compiler.
>
> Who does know a compiler switch to generate older exception handling
> (__except_handler3) with the compiler cl 14.x from VS2005?
>
> Thanks, Volker
>



Re: __except_handler3 instead __except_handler4 by Maxim

Maxim
Fri Dec 22 10:04:01 CST 2006

Try abandoning MFC8 in favour of the classic MFC42.DLL, or switching to
WDK. Maybe WDK's compiler will be compatible with MFC8.

P.S. that's why I have the natural major distrust to any new development
tools.

--
Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
maxim@storagecraft.com
http://www.storagecraft.com

"Volker Schober" <vschober@gesytec.de> wrote in message
news:1166802281.079424.290800@a3g2000cwd.googlegroups.com...
> Hello,
>
> I'm using the Windows Server 2003 SP1 DDK to build my drivers and I
> want to build also my MFC applications in the same build process (as I
> did it till now with the Windows 2000 DDK).
> The DDK has a compiler version 13.x. For the new MFC8 projects from
> VS2005 I need a compiler version 14.x from VS2005. I called
> vcvarsall.bat from VS2005 in my DDK environment, so I have the new
> compiler to build the MFC8 projects. After some changes for
> MFC_INCLUDES, MFC_INC_PATH, MFC_LIB_PATH my MFC8 compiles fine with DDK
> build.
>
> But I can no longer link my drivers, because __except_handler4 and
> __local_unwind4 are unresolved externals. cl.exe 13.x generates code
> with __except_handler3, which I can link with wdm.lib. cl.exe 14.x
> generates code with __except_handler4, which I can not link with
> wdm.lib.
> The MFC procject is linked with msvcrtd.lib, whichs contains
> __except_handler3 and __except_handler4.
> I have looked in the c2.dll of the cl 14.x. There I have found
> __except_handler4 and also __except_handler3. So I think, there must be
> a way to generate older exception handling with the new compiler.
>
> Who does know a compiler switch to generate older exception handling
> (__except_handler3) with the compiler cl 14.x from VS2005?
>
> Thanks, Volker
>


Re: __except_handler3 instead __except_handler4 by Oliver

Oliver
Fri Dec 22 10:12:45 CST 2006

Hi Volker,

why not use DDKBUILD from OSR or Hollistech to integrate your driver
build part into VS2005? If you use one of the OSR ones you might want
to google for "DDKWizard" since it allows you to create the
configuration(s) more easily from inside VS (2002, 2003, 2005).

In the rest of the statements I stay with Don. At the OSR seminars one
of the things you are taught is to never use the VS compiler for
drivers (Well, the W2K DDK and prior demanded it, but that's another
story).

Gruss aus Island,

Oliver


Re: __except_handler3 instead __except_handler4 by pavel_a

pavel_a
Sun Dec 24 13:12:00 CST 2006

"Maxim S. Shatskih" wrote:
> Try abandoning MFC8 in favour of the classic MFC42.DLL, or switching to
> WDK. Maybe WDK's compiler will be compatible with MFC8.
>
> P.S. that's why I have the natural major distrust to any new development
> tools.

The WDK compiler is v.14 - almost same as in VS 2005.
However, MFC in VS 2005 has been greatly changed, so if you have doubts that
MFC code compiles correctly in WDK environment, it should be easy to use VS
2005 or vcbuild instead.

Regards,
--PA