www.digitalmars.com         C & C++   DMDScript  

c++.mfc - Update DMC to new MFC

reply Andy C <Andy_member pathlink.com> writes:
Finally have some time to spend on this.  
1. I downloaded the free MS SDK and installed it.  
2. I copied over .h files for MFC and Win32, and source files into DMC
directories.
3. I tried to compile project “C:\dm\mfc\SRC\32-BIT\PROJECTS\NAFXCWD.CPP” using
these flags: -cpp -Jm -HO -Ae -Aa -mn -C -D_WINDOWS -S -4 -a8 -c –gf .

I get this error:
Error: C:\DM\BIN\..\mfc\include\afx.h(1128): unsupported __declspec type
On this line:
void __declspec(noreturn) AFXAPI AfxThrowMemoryException();

Any ideas? (If I am wasting my time also please let me know.)

Andy C
Nov 13 2003
parent reply Jan Knepper <jan smartsoft.us> writes:
I can not follow you here exactly...
Doesn't the Free MS Platform SDK install into a separate directory?
All you should do is make sure your include path goes through this 
directory BEFORE it does anything else...

Thanks!
Jan



Andy C wrote:
 Finally have some time to spend on this.  
 1. I downloaded the free MS SDK and installed it.  
 2. I copied over .h files for MFC and Win32, and source files into DMC
 directories.
 3. I tried to compile project “C:\dm\mfc\SRC\32-BIT\PROJECTS\NAFXCWD.CPP” using
 these flags: -cpp -Jm -HO -Ae -Aa -mn -C -D_WINDOWS -S -4 -a8 -c –gf .
 
 I get this error:
 Error: C:\DM\BIN\..\mfc\include\afx.h(1128): unsupported __declspec type
 On this line:
 void __declspec(noreturn) AFXAPI AfxThrowMemoryException();
 
 Any ideas? (If I am wasting my time also please let me know.)
 
 Andy C
 
 
-- ManiaC++ Jan Knepper
Nov 13 2003
parent reply Andy C <Andy_member pathlink.com> writes:
Jan,
You are correct, but that makes no difference - same error.  
"__declspec(noreturn)" is not supported by DMC, but MS says it is simply a way
to indicate no return so there is no VC++ compiler error.  Any idea for a
workaround in DMC?  Maybe I can redefine it, or skip it, but I am not sure.

Andy C


In article <bp06dq$map$1 digitaldaemon.com>, Jan Knepper says...
I can not follow you here exactly...
Doesn't the Free MS Platform SDK install into a separate directory?
All you should do is make sure your include path goes through this 
directory BEFORE it does anything else...

Thanks!
Jan



Andy C wrote:
 Finally have some time to spend on this.  
 1. I downloaded the free MS SDK and installed it.  
 2. I copied over .h files for MFC and Win32, and source files into DMC
 directories.
 3. I tried to compile project “C:\dm\mfc\SRC\32-BIT\PROJECTS\NAFXCWD.CPP” using
 these flags: -cpp -Jm -HO -Ae -Aa -mn -C -D_WINDOWS -S -4 -a8 -c –gf .
 
 I get this error:
 Error: C:\DM\BIN\..\mfc\include\afx.h(1128): unsupported __declspec type
 On this line:
 void __declspec(noreturn) AFXAPI AfxThrowMemoryException();
 
 Any ideas? (If I am wasting my time also please let me know.)
 
 Andy C
 
 
-- ManiaC++ Jan Knepper
Nov 13 2003
next sibling parent Andy C <Andy_member pathlink.com> writes:
Also, what is a good workaround for "__declspec( selectany )"?  Any help greatly
appreciated.

Thanks!

Andy C

In article <bp0n76$1i18$1 digitaldaemon.com>, Andy C says...
Jan,
You are correct, but that makes no difference - same error.  
"__declspec(noreturn)" is not supported by DMC, but MS says it is simply a way
to indicate no return so there is no VC++ compiler error.  Any idea for a
workaround in DMC?  Maybe I can redefine it, or skip it, but I am not sure.

Andy C


In article <bp06dq$map$1 digitaldaemon.com>, Jan Knepper says...
I can not follow you here exactly...
Doesn't the Free MS Platform SDK install into a separate directory?
All you should do is make sure your include path goes through this 
directory BEFORE it does anything else...

Thanks!
Jan



Andy C wrote:
 Finally have some time to spend on this.  
 1. I downloaded the free MS SDK and installed it.  
 2. I copied over .h files for MFC and Win32, and source files into DMC
 directories.
 3. I tried to compile project “C:\dm\mfc\SRC\32-BIT\PROJECTS\NAFXCWD.CPP” using
 these flags: -cpp -Jm -HO -Ae -Aa -mn -C -D_WINDOWS -S -4 -a8 -c –gf .
 
 I get this error:
 Error: C:\DM\BIN\..\mfc\include\afx.h(1128): unsupported __declspec type
 On this line:
 void __declspec(noreturn) AFXAPI AfxThrowMemoryException();
 
 Any ideas? (If I am wasting my time also please let me know.)
 
 Andy C
 
 
-- ManiaC++ Jan Knepper
Nov 13 2003
prev sibling next sibling parent reply Jan Knepper <jan smartsoft.us> writes:
OK, which MFC are you using?
The one that is available from www.digitalmars.com ???



Andy C wrote:
 Jan,
 You are correct, but that makes no difference - same error.  
 "__declspec(noreturn)" is not supported by DMC, but MS says it is simply a way
 to indicate no return so there is no VC++ compiler error.  Any idea for a
 workaround in DMC?  Maybe I can redefine it, or skip it, but I am not sure.
 
 Andy C
 
 
 In article <bp06dq$map$1 digitaldaemon.com>, Jan Knepper says...
 
I can not follow you here exactly...
Doesn't the Free MS Platform SDK install into a separate directory?
All you should do is make sure your include path goes through this 
directory BEFORE it does anything else...

Thanks!
Jan



Andy C wrote:

Finally have some time to spend on this.  
1. I downloaded the free MS SDK and installed it.  
2. I copied over .h files for MFC and Win32, and source files into DMC
directories.
3. I tried to compile project “C:\dm\mfc\SRC\32-BIT\PROJECTS\NAFXCWD.CPP” using
these flags: -cpp -Jm -HO -Ae -Aa -mn -C -D_WINDOWS -S -4 -a8 -c –gf .

I get this error:
Error: C:\DM\BIN\..\mfc\include\afx.h(1128): unsupported __declspec type
On this line:
void __declspec(noreturn) AFXAPI AfxThrowMemoryException();

Any ideas? (If I am wasting my time also please let me know.)

Andy C
-- ManiaC++ Jan Knepper
-- ManiaC++ Jan Knepper
Nov 13 2003
parent reply Andy C <Andy_member pathlink.com> writes:
Jan,
I am using the latest version of MFC from the Microsoft SDK, so 
presumably version 6.  I purchased DMC CD v8.26 and have downloaded the updates,
but I want to port over our existing VC++ code so I am trying to 
see if DMC will handle the new version of MFC.  

Thanks.

Andy C

In article <bp0tn0$1sm0$1 digitaldaemon.com>, Jan Knepper says...
OK, which MFC are you using?
The one that is available from www.digitalmars.com ???



Andy C wrote:
 Jan,
 You are correct, but that makes no difference - same error.  
 "__declspec(noreturn)" is not supported by DMC, but MS says it is simply a way
 to indicate no return so there is no VC++ compiler error.  Any idea for a
 workaround in DMC?  Maybe I can redefine it, or skip it, but I am not sure.
 
 Andy C
 
 
 In article <bp06dq$map$1 digitaldaemon.com>, Jan Knepper says...
 
I can not follow you here exactly...
Doesn't the Free MS Platform SDK install into a separate directory?
All you should do is make sure your include path goes through this 
directory BEFORE it does anything else...

Thanks!
Jan



Andy C wrote:

Finally have some time to spend on this.  
1. I downloaded the free MS SDK and installed it.  
2. I copied over .h files for MFC and Win32, and source files into DMC
directories.
3. I tried to compile project “C:\dm\mfc\SRC\32-BIT\PROJECTS\NAFXCWD.CPP” using
these flags: -cpp -Jm -HO -Ae -Aa -mn -C -D_WINDOWS -S -4 -a8 -c –gf .

I get this error:
Error: C:\DM\BIN\..\mfc\include\afx.h(1128): unsupported __declspec type
On this line:
void __declspec(noreturn) AFXAPI AfxThrowMemoryException();

Any ideas? (If I am wasting my time also please let me know.)

Andy C
-- ManiaC++ Jan Knepper
-- ManiaC++ Jan Knepper
Nov 13 2003
parent Jan Knepper <jan smartsoft.us> writes:
I don't think MFC 6 works with DMC yet...

Thanks!
Jan



Andy C wrote:
 Jan,
 I am using the latest version of MFC from the Microsoft SDK, so 
 presumably version 6.  I purchased DMC CD v8.26 and have downloaded the
updates,
 but I want to port over our existing VC++ code so I am trying to 
 see if DMC will handle the new version of MFC.  
 
 Thanks.
 
 Andy C
 
 In article <bp0tn0$1sm0$1 digitaldaemon.com>, Jan Knepper says...
 
OK, which MFC are you using?
The one that is available from www.digitalmars.com ???



Andy C wrote:

Jan,
You are correct, but that makes no difference - same error.  
"__declspec(noreturn)" is not supported by DMC, but MS says it is simply a way
to indicate no return so there is no VC++ compiler error.  Any idea for a
workaround in DMC?  Maybe I can redefine it, or skip it, but I am not sure.

Andy C


In article <bp06dq$map$1 digitaldaemon.com>, Jan Knepper says...


I can not follow you here exactly...
Doesn't the Free MS Platform SDK install into a separate directory?
All you should do is make sure your include path goes through this 
directory BEFORE it does anything else...

Thanks!
Jan



Andy C wrote:


Finally have some time to spend on this.  
1. I downloaded the free MS SDK and installed it.  
2. I copied over .h files for MFC and Win32, and source files into DMC
directories.
3. I tried to compile project “C:\dm\mfc\SRC\32-BIT\PROJECTS\NAFXCWD.CPP” using
these flags: -cpp -Jm -HO -Ae -Aa -mn -C -D_WINDOWS -S -4 -a8 -c –gf .

I get this error:
Error: C:\DM\BIN\..\mfc\include\afx.h(1128): unsupported __declspec type
On this line:
void __declspec(noreturn) AFXAPI AfxThrowMemoryException();

Any ideas? (If I am wasting my time also please let me know.)

Andy C
-- ManiaC++ Jan Knepper
-- ManiaC++ Jan Knepper
-- ManiaC++ Jan Knepper
Nov 14 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Andy C" <Andy_member pathlink.com> wrote in message
news:bp0n76$1i18$1 digitaldaemon.com...
 "__declspec(noreturn)" is not supported by DMC, but MS says it is simply a
way
 to indicate no return so there is no VC++ compiler error.  Any idea for a
 workaround in DMC?  Maybe I can redefine it, or skip it, but I am not
sure. www.digitalmars.com/ctg/pragmas.html#noreturn
Nov 13 2003
parent reply Andy C <Andy_member pathlink.com> writes:
Walter,Jan,
Got it, thanks.  Jan K. says that MFC 6 doesn't work with DMC.  Is that a big
issue of compiler changes, or a small(er) matter of settings and source code
tweeking?  Is there any value to my trying to compile the MFC source in the MS
SDK and posting the errors that come up?  Can I get a partial implementation (no
ATL for example) of MFC to work?
If this is a big hassle let me know and I won't pursue this thread.  

Cheers!

Andy C
(A long-time Datalight/Zortech/Symantec/DM user and fan!)


In article <bp0ucv$1u2g$1 digitaldaemon.com>, Walter says...
"Andy C" <Andy_member pathlink.com> wrote in message
news:bp0n76$1i18$1 digitaldaemon.com...
 "__declspec(noreturn)" is not supported by DMC, but MS says it is simply a
way
 to indicate no return so there is no VC++ compiler error.  Any idea for a
 workaround in DMC?  Maybe I can redefine it, or skip it, but I am not
sure. www.digitalmars.com/ctg/pragmas.html#noreturn
Nov 14 2003
next sibling parent Jan Knepper <jan smartsoft.us> writes:
Andy,

Years ago (when MFC 6 first came out) I have worked on porting it to the 
at that moment available Digital Mars C++ compiler without ever being 
able to complete it because of template and other issue's.

Currently I and my brother Arjan maintain over 1 GB of source code of 
which quite a bit works with MFC 4.21. This is the version that used to 
be available on www.digitalmars.com.

However, with the currently renewed interest in Linux and BSD platforms 
we recently decided to switch to wxWindows for portability reasons.

My suggestion to you at this moment if you are planning to write 
something new with MFC is to take a look at wxWindows before you even 
touch MFC.

Thanks!
Jan



Andy C wrote:
 Walter,Jan,
 Got it, thanks.  Jan K. says that MFC 6 doesn't work with DMC.  Is that a big
 issue of compiler changes, or a small(er) matter of settings and source code
 tweeking?  Is there any value to my trying to compile the MFC source in the MS
 SDK and posting the errors that come up?  Can I get a partial implementation
(no
 ATL for example) of MFC to work?
 If this is a big hassle let me know and I won't pursue this thread.  
 
 Cheers!
 
 Andy C
 (A long-time Datalight/Zortech/Symantec/DM user and fan!)
 
 
 In article <bp0ucv$1u2g$1 digitaldaemon.com>, Walter says...
 
"Andy C" <Andy_member pathlink.com> wrote in message
news:bp0n76$1i18$1 digitaldaemon.com...

"__declspec(noreturn)" is not supported by DMC, but MS says it is simply a
way
to indicate no return so there is no VC++ compiler error.  Any idea for a
workaround in DMC?  Maybe I can redefine it, or skip it, but I am not
sure. www.digitalmars.com/ctg/pragmas.html#noreturn
-- ManiaC++ Jan Knepper
Nov 14 2003
prev sibling parent reply "Walter" <walter digitalmars.com> writes:
"Andy C" <Andy_member pathlink.com> wrote in message
news:bp2lv7$1knr$1 digitaldaemon.com...
 Walter,Jan,
 Got it, thanks.  Jan K. says that MFC 6 doesn't work with DMC.  Is that a
big
 issue of compiler changes, or a small(er) matter of settings and source
code
 tweeking?  Is there any value to my trying to compile the MFC source in
the MS
 SDK and posting the errors that come up?  Can I get a partial
implementation (no
 ATL for example) of MFC to work?
 If this is a big hassle let me know and I won't pursue this thread.
Porting different MFC versions is difficult because of: 1) close reliance on exactly how VC implements various C++ features 2) dependence on various VC extensions to C++ 3) lack of a test suite to verify that a port of MFC works properly That said, if you're willing to post errors and problems compiling MFC6 as they come up, and can do so with small, reproducible test cases <g>, then I'll see what I can do to address them. I'd also take Jan's advice and have a look at wxWindows before making a final decision.
Nov 14 2003
parent Andy C <Andy_member pathlink.com> writes:
I will give it a shot as after-hours time permits!
My 3 changes so far (see if they make sense):

Problem 1:
Replaced lines that read...
void __declspec(noreturn) AFXAPI AfxThrowMemoryException();
with...
void AFXAPI AfxThrowMemoryException();
#pragma noreturn(AfxThrowMemoryException)

Problem 2
Don't know how to handle: __declspec(selectany) in
atlconv.h, line 34.
Fixed for now by defining the string to nothing:
#if __DMC__
#define __declspec(selectany)
#endif

Problem 3
Can't find file <shlwapi.h> in atlbase.h, line 18.
File exists in "C:\WINDDK\3790\inc\wxp" directory of free DDK so added to
project directory.

That said, if you're willing to post errors and problems compiling MFC6 as
they come up, and can do so with small, reproducible test cases <g>, then
I'll see what I can do to address them. I'd also take Jan's advice and have
a look at wxWindows before making a final decision.
Nov 17 2003