15 мая 2023 года "Исходники.РУ" отмечают своё 23-летие!
Поздравляем всех причастных и неравнодушных с этим событием!
И огромное спасибо всем, кто был и остаётся с нами все эти годы!

Главная Форум Журнал Wiki DRKB Discuz!ML Помощь проекту


RUNTIME_CLASS in a DLL - MFC 4.0

Bill E. Kempf -- WEKempf@marlton.1dc.com
Friday, February 16, 1996


We have a CFormView derived class in an MFC Extension DLL.  The entire class 
is exported.  The application that imports the class from the .DLL executes 
RUNTIME_CLASS(MyFormView) in a ReplaceView member of a derived CSplitterWnd 
(same as is done in the SPLIT example on MSDN) class.  During the implicit 
DLL load the system reports bad image for the DLL and the program aborts. 
 There is no way to trap in the debugger before this call.

Is there a problem with exporting the RUNTIME_CLASS() method?  If so, how 
else could we manage to keep the CFormView code in a DLL while creating it 
in our app?  We have read the KB Q131946, and the information contained in 
it does not help.



Mike Blaszczak -- mikeblas@interserv.com
Saturday, February 17, 1996

On Fri, 16 Feb 96, "Bill E. Kempf"  wrote:
>During the implicit 
>DLL load the system reports bad image for the DLL and the program aborts. 
> There is no way to trap in the debugger before this call.

With these symptoms, the problem really is that your DLL image is bogus.  If 
you can't even get a breakpoint hit on the DllMain() of the DLL, it really 
isn't getting loaded--which means that the problem has nothing to do with a 
particular import or export.

If the error is a bad image (who is reporting that error, by the way?) then 
something is wrong with your *.DLL file.
>
>Is there a problem with exporting the RUNTIME_CLASS() method?  If so, how 
>else could we manage to keep the CFormView code in a DLL while creating it 
>in our app? 

The DLLHUSK sample implements a couple of views and exports them. I'm not 
sure that it uses CFormViews, but there should be little difference between 
what you're trying to do and what that sample does.

.B ekiM
--
TCHAR szDisc[] = _T("These words are my own; I do not speak for Microsoft.");





| Вернуться в корень Архива |