www.digitalmars.com         C & C++   DMDScript  

c++.mfc - Summery - Last Post - Use This

reply "James Kirkham" <JamesKirkham1 hotmail.com> writes:
Ok, this is getting complex, the last post had so many replies I decicded to
start a new one.  So far this what we have got:

0. I am using Windows XP my dm dir can be found in C:\dm.  I am using
digitalmars compiler version 8.30c.

1.  The files nafxcw.lib, winspool.lib and shell32.lib cannot not be found
on compile.

2. The code I am trying to compile is MFC (this app is a basic window) and
the source can be found at the bottom of this post.

3. I was told I would need the MFC and ATL libs and was also told to
download the files MFC4.21.tar and ATL2.02.tar.

4.  I extracted these files to my dm directory keep the file structure.  So
I ended up with C:\dm\MFC and C:\dm\ATl.

5. In my C:\dm\lib folder I have the following files :

1. ADVAPI32

2. COMCTL32

3. COMDLG32

4. CTL3D32

5. gc

6. GDI32

7. KERNEL32

8. OLE32

9. OLEAUT32

10. snn

11. USER32

12. UUID

6.  When I run this command "C:\dm\bin>set" in my command prompt it returns
this:

ALLUSERSPROFILE=C:\Documents and Settings\All Users
APPDATA=C:\Documents and Settings\James\Application Data
CLIENTNAME=Console
CommonProgramFiles=C:\Program Files\Common Files
COMPUTERNAME=FAMILYPC
ComSpec=C:\WINDOWS\system32\cmd.exe
HOMEDRIVE=C:
HOMEPATH=\Documents and Settings\James
LIB=c:\dm\lib;c:\dm\mfc\lib;
LOGONSERVER=\\FAMILYPC
NUMBER_OF_PROCESSORS=1
OS=Windows_NT
Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
Files\Co
mmon Files\Adaptec Shared\System;C:\BORLAND\BCC55\BIN;
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
PROCESSOR_ARCHITECTURE=x86
PROCESSOR_IDENTIFIER=x86 Family 15 Model 1 Stepping 2, GenuineIntel
PROCESSOR_LEVEL=15
PROCESSOR_REVISION=0102
ProgramFiles=C:\Program Files
PROMPT=$P$G
SESSIONNAME=Console
SystemDrive=C:
SystemRoot=C:\WINDOWS
TEMP=C:\DOCUME~1\James\LOCALS~1\Temp
TMP=C:\DOCUME~1\James\LOCALS~1\Temp
USERDOMAIN=FAMILYPC
USERNAME=James
USERPROFILE=C:\Documents and Settings\James
windir=C:\WINDOWS

7. The second part of this section "LIB=c:\dm\lib;c:\dm\mfc\lib;" is wrong.
I have no such folder under my c:\dm\mfc\ directory.   My MFC folder
contains 2 folders only: include and src.  The only folder that is labeled
lib under mfc is located C:\dm\mfc\src\SC\LIB\  This folder conatins no lib
files only .prj, .opn and one .mak file.  The .mak file is named nafxcw.mak.

8. I have just been told that the files winspool.lib and shell32.lib are not
included in the dm download and should be in the c:\dm\lib folder, which for
me are not.  I was also told that this person ran implib????? on the
winspool.drv and shell32.dll files in the windows\system folder and then
placed the resulting lib files in C:\dm\lib.  What is implib how do I use
it?  If possible can "bw" e-mail me the files to use with my compiler.

9. If I ever manage to get this to work I am going to host a nice noob
friendly (with lots of screen caps) guide on how to set this compiler up
;o).

Thank You All For Your Patience......

            James Kirkham




BASIC MFC WINDOW SOURCE:

#include <afxwin.h>

#ifdef MINIMAL

// Stub out non-critical CRT initialization functions
extern "C" void _setenvp() { }
extern "C" void _setargv() { }

// Define a window class derived from CWnd
class CHelloWindow : public CWnd
{
public:
    CHelloWindow()
    {
        CreateEx(WS_EX_CLIENTEDGE,
            AfxRegisterWndClass(0, ::LoadCursor(NULL, IDC_ARROW),
(HBRUSH)(COLOR_WINDOW+1)),
            _T("Hello World!"), WS_OVERLAPPEDWINDOW,
            CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
NULL, NULL, 0);
    }
};

#else

// Define a window class derived from CFrameWnd
class CHelloWindow : public CFrameWnd
{
public:
    CHelloWindow()
        { Create(NULL, _T("Hello World!"), WS_OVERLAPPEDWINDOW,
rectDefault); }
};

#endif

// Define an application class derived from CWinApp
class CHelloApp : public CWinApp
{
public:
    virtual BOOL InitInstance()
    {
        m_pMainWnd = new CHelloWindow();
        m_pMainWnd->ShowWindow(m_nCmdShow);
        m_pMainWnd->UpdateWindow();
        return TRUE;
    }
};

CHelloApp HelloApp;  // HelloApp's constructor initializes and runs the app
Oct 14 2002
next sibling parent reply Jan Knepper <jan smartsoft.us> writes:
James Kirkham wrote:

 Ok, this is getting complex, the last post had so many replies I decicded to
 start a new one.  So far this what we have got:

 0. I am using Windows XP my dm dir can be found in C:\dm.  I am using
 digitalmars compiler version 8.30c.

 1.  The files nafxcw.lib, winspool.lib and shell32.lib cannot not be found
 on compile.

They do not seem to be on your system either. nafxcw.lib you can compile yourself. Instructions are in ~/MFC/src in a .txt file I think. The other two are part of the DM CD.
 2. The code I am trying to compile is MFC (this app is a basic window) and
 the source can be found at the bottom of this post.

 3. I was told I would need the MFC and ATL libs and was also told to
 download the files MFC4.21.tar and ATL2.02.tar.

That depends on what you want to do. You can accomplish the same thing with the API. You might have to do quite a bit more coding yourself for a full blown application without MFC.
 4.  I extracted these files to my dm directory keep the file structure.  So
 I ended up with C:\dm\MFC and C:\dm\ATl.

That's OK.
 5. In my C:\dm\lib folder I have the following files :

 1. ADVAPI32
 2. COMCTL32
 3. COMDLG32
 4. CTL3D32
 5. gc
 6. GDI32
 7. KERNEL32
 8. OLE32
 9. OLEAUT32
 10. snn
 11. USER32
 12. UUID

SHELL32.LIB and WINSPOOL.LIB seem to be missing.
 6.  When I run this command "C:\dm\bin>set" in my command prompt it returns
 this:

 ALLUSERSPROFILE=C:\Documents and Settings\All Users
 APPDATA=C:\Documents and Settings\James\Application Data
 CLIENTNAME=Console
 CommonProgramFiles=C:\Program Files\Common Files
 COMPUTERNAME=FAMILYPC
 ComSpec=C:\WINDOWS\system32\cmd.exe
 HOMEDRIVE=C:
 HOMEPATH=\Documents and Settings\James
 LIB=c:\dm\lib;c:\dm\mfc\lib;
 LOGONSERVER=\\FAMILYPC
 NUMBER_OF_PROCESSORS=1
 OS=Windows_NT
 Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
 Files\Co
 mmon Files\Adaptec Shared\System;C:\BORLAND\BCC55\BIN;
 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
 PROCESSOR_ARCHITECTURE=x86
 PROCESSOR_IDENTIFIER=x86 Family 15 Model 1 Stepping 2, GenuineIntel
 PROCESSOR_LEVEL=15
 PROCESSOR_REVISION=0102
 ProgramFiles=C:\Program Files
 PROMPT=$P$G
 SESSIONNAME=Console
 SystemDrive=C:
 SystemRoot=C:\WINDOWS
 TEMP=C:\DOCUME~1\James\LOCALS~1\Temp
 TMP=C:\DOCUME~1\James\LOCALS~1\Temp
 USERDOMAIN=FAMILYPC
 USERNAME=James
 USERPROFILE=C:\Documents and Settings\James
 windir=C:\WINDOWS

 7. The second part of this section "LIB=c:\dm\lib;c:\dm\mfc\lib;" is wrong.
 I have no such folder under my c:\dm\mfc\ directory.   My MFC folder
 contains 2 folders only: include and src.  The only folder that is labeled
 lib under mfc is located C:\dm\mfc\src\SC\LIB\  This folder conatins no lib
 files only .prj, .opn and one .mak file.  The .mak file is named nafxcw.mak.

I think nafxcw.lib will be places in ~/MFC/lib when you build it.
 8. I have just been told that the files winspool.lib and shell32.lib are not
 included in the dm download and should be in the c:\dm\lib folder, which for
 me are not.  I was also told that this person ran implib????? on the
 winspool.drv and shell32.dll files in the windows\system folder and then
 placed the resulting lib files in C:\dm\lib.  What is implib how do I use
 it?  If possible can "bw" e-mail me the files to use with my compiler.

Probably took the files out of a VC-- install and converted them to use with DMC++
 9. If I ever manage to get this to work I am going to host a nice noob
 friendly (with lots of screen caps) guide on how to set this compiler up
 ;o).

Good luck! Jan
Oct 14 2002
parent bw <bw_member pathlink.com> writes:
James Kirkham wrote:
 8. I have just been told that the files winspool.lib and shell32.lib are not
 included in the dm download and should be in the c:\dm\lib folder, which for
 me are not.  I was also told that this person ran implib?????


this person? lmao that sounds kinda impersonal, but hey i told ya it could be frustrating.. hang in there it's not mr bright's fault it's probably all these different computers and dll versions and os'es everywhere... once you get it set up it's really pretty awesome. u no a yeer agoe i kud nott eeven spael programmar now i are won. L8r, bw
Oct 14 2002
prev sibling parent "Phill" <phillbert pacific.net.au> writes:
Take my advice and buy the CD it is well worth the
price and it then is just a matter of draging and dropping the directory
from the CD to your PC and setting the
PATH.
It is really very cheap and a great product.

Phill.
.
"James Kirkham" <JamesKirkham1 hotmail.com> wrote in message
news:aoemm6$fka$1 digitaldaemon.com...
 Ok, this is getting complex, the last post had so many replies I decicded

 start a new one.  So far this what we have got:

 0. I am using Windows XP my dm dir can be found in C:\dm.  I am using
 digitalmars compiler version 8.30c.

 1.  The files nafxcw.lib, winspool.lib and shell32.lib cannot not be found
 on compile.

 2. The code I am trying to compile is MFC (this app is a basic window) and
 the source can be found at the bottom of this post.

 3. I was told I would need the MFC and ATL libs and was also told to
 download the files MFC4.21.tar and ATL2.02.tar.

 4.  I extracted these files to my dm directory keep the file structure.

 I ended up with C:\dm\MFC and C:\dm\ATl.

 5. In my C:\dm\lib folder I have the following files :

 1. ADVAPI32

 2. COMCTL32

 3. COMDLG32

 4. CTL3D32

 5. gc

 6. GDI32

 7. KERNEL32

 8. OLE32

 9. OLEAUT32

 10. snn

 11. USER32

 12. UUID

 6.  When I run this command "C:\dm\bin>set" in my command prompt it

 this:

 ALLUSERSPROFILE=C:\Documents and Settings\All Users
 APPDATA=C:\Documents and Settings\James\Application Data
 CLIENTNAME=Console
 CommonProgramFiles=C:\Program Files\Common Files
 COMPUTERNAME=FAMILYPC
 ComSpec=C:\WINDOWS\system32\cmd.exe
 HOMEDRIVE=C:
 HOMEPATH=\Documents and Settings\James
 LIB=c:\dm\lib;c:\dm\mfc\lib;
 LOGONSERVER=\\FAMILYPC
 NUMBER_OF_PROCESSORS=1
 OS=Windows_NT
 Path=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program
 Files\Co
 mmon Files\Adaptec Shared\System;C:\BORLAND\BCC55\BIN;
 PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH
 PROCESSOR_ARCHITECTURE=x86
 PROCESSOR_IDENTIFIER=x86 Family 15 Model 1 Stepping 2, GenuineIntel
 PROCESSOR_LEVEL=15
 PROCESSOR_REVISION=0102
 ProgramFiles=C:\Program Files
 PROMPT=$P$G
 SESSIONNAME=Console
 SystemDrive=C:
 SystemRoot=C:\WINDOWS
 TEMP=C:\DOCUME~1\James\LOCALS~1\Temp
 TMP=C:\DOCUME~1\James\LOCALS~1\Temp
 USERDOMAIN=FAMILYPC
 USERNAME=James
 USERPROFILE=C:\Documents and Settings\James
 windir=C:\WINDOWS

 7. The second part of this section "LIB=c:\dm\lib;c:\dm\mfc\lib;" is

 I have no such folder under my c:\dm\mfc\ directory.   My MFC folder
 contains 2 folders only: include and src.  The only folder that is labeled
 lib under mfc is located C:\dm\mfc\src\SC\LIB\  This folder conatins no

 files only .prj, .opn and one .mak file.  The .mak file is named

 8. I have just been told that the files winspool.lib and shell32.lib are

 included in the dm download and should be in the c:\dm\lib folder, which

 me are not.  I was also told that this person ran implib????? on the
 winspool.drv and shell32.dll files in the windows\system folder and then
 placed the resulting lib files in C:\dm\lib.  What is implib how do I use
 it?  If possible can "bw" e-mail me the files to use with my compiler.

 9. If I ever manage to get this to work I am going to host a nice noob
 friendly (with lots of screen caps) guide on how to set this compiler up
 ;o).

 Thank You All For Your Patience......

             James Kirkham




 BASIC MFC WINDOW SOURCE:

 #include <afxwin.h>

 #ifdef MINIMAL

 // Stub out non-critical CRT initialization functions
 extern "C" void _setenvp() { }
 extern "C" void _setargv() { }

 // Define a window class derived from CWnd
 class CHelloWindow : public CWnd
 {
 public:
     CHelloWindow()
     {
         CreateEx(WS_EX_CLIENTEDGE,
             AfxRegisterWndClass(0, ::LoadCursor(NULL, IDC_ARROW),
 (HBRUSH)(COLOR_WINDOW+1)),
             _T("Hello World!"), WS_OVERLAPPEDWINDOW,
             CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
 NULL, NULL, 0);
     }
 };

 #else

 // Define a window class derived from CFrameWnd
 class CHelloWindow : public CFrameWnd
 {
 public:
     CHelloWindow()
         { Create(NULL, _T("Hello World!"), WS_OVERLAPPEDWINDOW,
 rectDefault); }
 };

 #endif

 // Define an application class derived from CWinApp
 class CHelloApp : public CWinApp
 {
 public:
     virtual BOOL InitInstance()
     {
         m_pMainWnd = new CHelloWindow();
         m_pMainWnd->ShowWindow(m_nCmdShow);
         m_pMainWnd->UpdateWindow();
         return TRUE;
     }
 };

 CHelloApp HelloApp;  // HelloApp's constructor initializes and runs the


Mar 15 2003