Click here to Skip to main content
15,906,628 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: what is wrong Pin
Tara1429-Jun-06 8:12
Tara1429-Jun-06 8:12 
GeneralRe: what is wrong Pin
Tara1429-Jun-06 5:45
Tara1429-Jun-06 5:45 
QuestionRe: what is wrong Pin
Tara1429-Jun-06 5:35
Tara1429-Jun-06 5:35 
QuestionRounding a floating value Pin
Taruni29-Jun-06 4:50
Taruni29-Jun-06 4:50 
AnswerRe: Rounding a floating value Pin
David Crow29-Jun-06 5:01
David Crow29-Jun-06 5:01 
AnswerRe: Rounding a floating value Pin
Zac Howland29-Jun-06 5:04
Zac Howland29-Jun-06 5:04 
AnswerRe: Rounding a floating value Pin
cmk29-Jun-06 9:10
cmk29-Jun-06 9:10 
QuestionCreate CDHtmlDialog in statically linked MFC DLL failed [modified] Pin
rockryan29-Jun-06 4:42
rockryan29-Jun-06 4:42 
Hi,
My project need use a exe(statically linked MFC) load a dll(statically linked MFC),
and create a CDHtmlDialog in the dll.

I add a CDHtmlDialog to the DLL, "class DHtmlDialogTest : public CDHtmlDialog"
and create dialog at DLL's export function,
"DHtmlDialogTest.Create(IDD_DHtmlDialogTest , CWnd::GetDesktopWindow());"

But when excute DHtmlDialogTest.Create(IDD_DHtmlDialogTest , CWnd::GetDesktopWindow());
then it'll enter "dlgdhtml.cpp"'s function "CDHtmlDialog::OnInitDialog()"
at following code inside "CDHtmlDialog::OnInitDialog()"

--------------------------------------------------------------------------
if (m_pBrowserApp == NULL)
{
// create the control window
m_wndBrowser.CreateControl(CLSID_WebBrowser, NULL,
WS_VISIBLE | WS_CHILD, rectClient, this, AFX_IDC_BROWSER);
lpUnk = m_wndBrowser.GetControlUnknown();
if (FAILED(lpUnk->QueryInterface(IID_IWebBrowser2, (void**) &m_pBrowserApp)))
{
m_wndBrowser.DestroyWindow();
DestroyWindow();
return TRUE;
}
}
--------------------------------------------------------------------------

it will GPF which is get a unhandle exception when excute
if (FAILED(lpUnk->QueryInterface(IID_IWebBrowser2, (void**) &m_pBrowserApp)))

the m_wndBrowser is NULL and lpUnk is also NULL.

and,
1. I can create a CDialog in the same DLL above, only can't create a CDHtmlDialog.

2. If use a exe(dynamically link MFC) load a dll(Extension DLL use MFC),
it have no problem,
it can do the same thing, create a CDHtmlDialog in the dll perfectly.

Maybe because I can't load the resource?
Because I trce the call stack, when enter afxwin2.inl excute following code:
CDialog::Create(ATL_MAKEINTRESOURCE(nIDTemplate), pParentWnd);

ATL_MAKEINTRESOURCE(nIDTemplate) return a bad ptr,

Or is there any thing I need to be careful when use a exe(statically linked MFC) load a dll(statically linked MFC),
and create a CDHtmlDialog in the dll?

Thanks for your help~
-- modified at 3:02 Friday 30th June, 2006
AnswerRe: Create CDHtmlDialog in statically linked MFC DLL failed Pin
Viorel.29-Jun-06 5:03
Viorel.29-Jun-06 5:03 
GeneralRe: Create CDHtmlDialog in statically linked MFC DLL failed Pin
rockryan29-Jun-06 16:01
rockryan29-Jun-06 16:01 
GeneralRe: Create CDHtmlDialog in statically linked MFC DLL failed Pin
rockryan30-Jun-06 17:36
rockryan30-Jun-06 17:36 
QuestionLink DLL with Visual C++ not working Pin
status()29-Jun-06 4:39
status()29-Jun-06 4:39 
AnswerRe: Link DLL with Visual C++ not working Pin
Cedric Moonen29-Jun-06 4:45
Cedric Moonen29-Jun-06 4:45 
GeneralRe: Link DLL with Visual C++ not working Pin
status()29-Jun-06 4:58
status()29-Jun-06 4:58 
GeneralRe: Link DLL with Visual C++ not working Pin
Cedric Moonen29-Jun-06 5:31
Cedric Moonen29-Jun-06 5:31 
GeneralRe: Link DLL with Visual C++ not working Pin
status()29-Jun-06 10:40
status()29-Jun-06 10:40 
Questiontypedef Handle [modified] Pin
Jay0329-Jun-06 4:21
Jay0329-Jun-06 4:21 
AnswerRe: typedef Handle Pin
Maximilien29-Jun-06 4:28
Maximilien29-Jun-06 4:28 
GeneralRe: typedef Handle Pin
Jay0329-Jun-06 4:39
Jay0329-Jun-06 4:39 
JokeRe: typedef Handle Pin
Jun Du29-Jun-06 4:29
Jun Du29-Jun-06 4:29 
GeneralRe: typedef Handle Pin
Jay0329-Jun-06 4:40
Jay0329-Jun-06 4:40 
GeneralRe: typedef Handle Pin
Jun Du29-Jun-06 5:14
Jun Du29-Jun-06 5:14 
AnswerRe: typedef Handle [modified] Pin
Viorel.29-Jun-06 4:34
Viorel.29-Jun-06 4:34 
GeneralRe: typedef Handle Pin
Jay0329-Jun-06 4:40
Jay0329-Jun-06 4:40 
GeneralRe: typedef Handle Pin
Viorel.29-Jun-06 4:48
Viorel.29-Jun-06 4:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.