Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Assertion failure in CWnd::DestroyWindow

Status
Not open for further replies.

txjump

Programmer
May 17, 2002
76
US
Hi,

Ive created a library w/ a dialog, linked it to a dll, and am testing the dll w/ an exe. the problem occurs when i create an instance of the library class in the dll class or as a global in the dll. the exe calls the dll which in turns calls the lib. the lib class does its thing successfully but when it closes the lib class dialog, i get an assertion failure in DestroyWindow at the line

ASSERT(m_hWnd == hWndOrig);

in the function BOOL CWnd::DestroyWindow() of wincore.cpp

what do i need to set the m_hWnd to so that i dont get the assertion error? and does this get set before the dialog DoModal is called?

i dont get this error any other time, just when the DoModal is being called inside the dll. ive tested the dialog from an exe and it works fine.

any suggestions?
thanks,
txjump [ponytails2]
 
Just out of curiosity - are your DLLs regular or extension DLLs? I don't think you should be getting these probs with extension DLLs.
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
hey qednick,

good to see your post :) hope you are doing good. did you have a good thanksgiving?

not sure who your question was for but my dlls are regular dlls. and have to be, so i didnt even try to see what happens w/ extensions.

[ponytails2]
 
Hi,

We are using regular DLL's, mostly because they seemed simpler, and we couldn't find a good reason to use extensions. Maybe this is it?
 
Hi TX and Rob... yes I think it's the fact that you are using regular DLLs - actually extension DLLs are easier to use because you don't have to messa round exporting functions and stuff - you simply create a class (or classes) and the whole class is 'exported' to your app.
To export a whole class with an extension DLL you add [tt]AFX_EXT_CLASS[/tt] at the head of your class definition like so:

[tt]class AFX_EXT_CLASS SomeClass
{
......
};[/tt]

In your app, all you have to do is include the .lib file and header(s) then you can use the whole class and it's functions.

I've been well TX - I thought my pumpkin pic had upset you [cry] - full of turkey still after thanksgiving.

[rockband]
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
Hi,

Can you use extension DLL's with the LoadModule() call? One of the features of my IDE is that it can be reconfigured to present a different development environment by changing entries in a text file that loads on startup. Based on this file, a different set of DLL's are linked, providing a customized development environment for a particular type of application.

Thanks,

Rob
 
hey qednick,

i cant use extension dlls because mine will be called from other languages such as cobol and powerbuilder.

of course your punkin pic didnt upset me. i thought it was funny. (a little dimented but funny) just didnt want you thinkin i was pestering you too much. ;)

txjump
[ponytails2]
 
pestering? not at all. Yes the pic was demented but my brother sent it to me! :)

I see what you mean about not being able to use extension DLLs. However, if the need arises in the future and you can use one rather than a regular one, then do so - it'll make life so much easier for you!

[wavey]
tellis.gif

[sup]programmer (prog'ram'er), n A hot-headed, anorak wearing, pimple-faced computer geek.[/sup]​
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top