IsDerivedFrom and CRuntimeClass used from a DLL

8 views
Skip to first unread message

Frederick Isaac

unread,
Aug 10, 2004, 7:20:58 PM8/10/04
to
Hi,

briefly I have a .dll that has a CFormView derived class in it.
My main application is trying to put this into a splitter window.

As the CSplitterWnd uses the CreateView to place a view in one of the
panes
I placed the following in me .dll along with my form

__declspec(dllexport) CRuntimeClass* getRTClass() { return
RUNTIME_CLASS(CMyFormView); }

I then do

hlib = LoadLibrary("...")
lpfn=GetProcAddress(hlib, "getRTClass");

splitterWnd->CreateView(0, 1, lpfn, pContext);

This fails in the IsDerivedFrom call within the CreateView call. I
debugged it and although the call actually does find a CWnd class the
comparison is a literal compare which have different addresses??? The
call then fails once it gets beyond the CObject class.

Any thoughts or help would be greatly appreciated

Freddy

Reply all
Reply to author
Forward
0 new messages