home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.os.ms-windows.programmer.misc
- Path: sparky!uunet!decwrl!csus.edu!sfsuvax1.sfsu.edu!vpcsc7
- From: vpcsc7@sfsuvax1.sfsu.edu (Dan Tauber)
- Subject: Mixing Windows API code & MFC
- Message-ID: <1992Aug26.044944.11302@csus.edu>
- Sender: news@csus.edu
- Organization: San Francisco State University
- Distribution: na
- Date: Wed, 26 Aug 1992 04:49:44 GMT
- Lines: 23
-
- I am trying to use an API window procedure in a MFC application
- to handle the About box. I have the help/about message mapped to the
- main windows' OnAbout method. Whenever this code executes, I get a
- GP fault when it calls the Windows API ::DialogBox function.
-
- {
- DLGPROC lpfnAbout = (DLGPROC) ::MakeProcInstance(
- (FARPROC) ::AboutBox, hInst);
- ::DialogBox(hInst, "DT_ABOUT", m_hWnd, lpfnAbout);
- ::FreeProcInstance((FARPROC)lpfnAbout);
- }
-
- hInst is a global handle that I initialize with the
- AfxGetInstanceHandle() function when the program starts. m_hWnd
- is the CWnd member function that holds the handle to the window.
- I also export the AboutBox funtion in the def file.
-
- Can anyone help?
-
- Thanks
-
- Dan
- tauber@futon.sfsu.edu
-