home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / mswindo / programm / misc / 1494 < prev    next >
Encoding:
Text File  |  1992-08-25  |  1.1 KB  |  35 lines

  1. Newsgroups: comp.os.ms-windows.programmer.misc
  2. Path: sparky!uunet!decwrl!csus.edu!sfsuvax1.sfsu.edu!vpcsc7
  3. From: vpcsc7@sfsuvax1.sfsu.edu (Dan Tauber)
  4. Subject: Mixing Windows API code & MFC
  5. Message-ID: <1992Aug26.044944.11302@csus.edu>
  6. Sender: news@csus.edu
  7. Organization: San Francisco State University
  8. Distribution: na
  9. Date: Wed, 26 Aug 1992 04:49:44 GMT
  10. Lines: 23
  11.  
  12. I am trying to use an API window procedure in a MFC application
  13. to handle the About box.  I have the help/about message mapped to the
  14. main windows' OnAbout method.  Whenever this code executes, I get a
  15. GP fault when it calls the Windows API ::DialogBox function.
  16.  
  17. {
  18. DLGPROC lpfnAbout = (DLGPROC) ::MakeProcInstance(
  19.                    (FARPROC) ::AboutBox, hInst);
  20. ::DialogBox(hInst, "DT_ABOUT", m_hWnd, lpfnAbout);
  21. ::FreeProcInstance((FARPROC)lpfnAbout);
  22. }
  23.  
  24. hInst is a global handle that I initialize with the
  25. AfxGetInstanceHandle() function when the program starts.  m_hWnd
  26. is the CWnd member function that holds the handle to the window.
  27. I also export the AboutBox funtion in the def file.
  28.  
  29. Can anyone help?
  30.  
  31. Thanks
  32.  
  33. Dan
  34. tauber@futon.sfsu.edu
  35.