如何在dll中取得CWinApp对象
我的主程序是用MFC做的,想在dll中用AfxGetApp()取得app对象,发现都是空值,有没有办法? 问题点数:0、回复次数:2Top
1 楼zhangcrony(失去好久的东西,还能找得回吗?)回复于 2004-04-03 13:16:40 得分 0
Not clear enough...Top
2 楼dafan(大帆)回复于 2004-04-03 13:59:43 得分 0
你去debug一下,看看到底是哪里出了差错!我现在给你一点提示
MFC Library Reference
AfxGetApp See Also
MFC Macros and Globals
The pointer returned by this function can be used to access application information such as the main message-dispatch code or the topmost window.
CWinApp* AFXAPI AfxGetApp( );
Return Value
A pointer to the single CWinApp object for the application.
Example
// Print the application's executable filename.
TRACE("Executable filename = %s\n", AfxGetApp()->m_pszExeName);
See Also
MFC Macros and Globals
^_^,就是这样的简单!Top




