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

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


Extension DLL's and DYNAMIC_DOWNCAST

Steven Binney -- sbinney@waters.com
Wednesday, March 05, 1997

Environment: VC++ 4.2b, NT 4.0 SP 2

I have an extension DLL (DLL A) that exports a serializable class to
another extension DLL (DLL B) and an executable (EXE A). 

My programs link without errors and I am using the dllimport/export scheme
as described in tech note 33.

My problem is that when I call DYNAMIC_DOWNCAST form DLL B, it returns NULL
(STATIC_DOWNCAST ASSERTS) .

>From EXE A, everything works, DYNAMIC_DOWNCAST  works and I can debug the
DLL.

Is there a special trick that allows DYNAMIC_DOWNCAST  to be used when
using two extension DLLS's.

I also get DLL A loading 2 times (TRACE output)  when EXE A runs.






Mike Blaszczak -- mikeblas@nwlink.com
Thursday, March 06, 1997

At 12:15 3/5/97 -0500, Steven Binney wrote:

>I also get DLL A loading 2 times (TRACE output)  when EXE A runs.

What TRACE output are you referring to, very specifically?

It doesn't seem like it should be possible to load two instances of
a DLL into the same process.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.




steve.rogers@octel.com
Sunday, March 09, 1997

[Mini-digest: 2 responses]

  I also had a problem with DYNAMIC_DOWNCAST (can't remember the 
  exact circumstances) and fixed it by using C++ native 
  dynamic_cast operator instead of the MFC Macro (which requires 
  CObject derived classes).


______________________________ Reply Separator _________________________________
Subject: Extension DLL's and DYNAMIC_DOWNCAST
Author:  mfc-l@netcom.com at P_Internet_Mail
Date:    3/5/97 12:15 PM


Environment: VC++ 4.2b, NT 4.0 SP 2
  
I have an extension DLL (DLL A) that exports a serializable class to 
another extension DLL (DLL B) and an executable (EXE A). 
  
My programs link without errors and I am using the dllimport/export scheme 
as described in tech note 33.
  
My problem is that when I call DYNAMIC_DOWNCAST form DLL B, it returns NULL 
(STATIC_DOWNCAST ASSERTS) .
  
>From EXE A, everything works, DYNAMIC_DOWNCAST  works and I can debug the 
DLL.
  
Is there a special trick that allows DYNAMIC_DOWNCAST  to be used when 
using two extension DLLS's.
  
I also get DLL A loading 2 times (TRACE output)  when EXE A runs.
  
  
  
-----From: Steven Binney 

The TRACE generated by the AppWizard TRACE0("MYDLL.DLL =
Initializing!\n");  shows up multiple times.
I can only debug the first loaded  DLL.

I fixed my problem by re-creating the MAK file of DLL A.  I do not know =
what caused the problem.  DYNAMIC_DOWNCAST was failing because it was =
getting run time info from the second mystery instance.
----------
From: 	Mike Blaszczak
Sent: 	Thursday, March 06, 1997 9:31 PM
To: 	mfc-l@netcom.com
Subject: 	Re: Extension DLL's and DYNAMIC_DOWNCAST

At 12:15 3/5/97 -0500, Steven Binney wrote:

>I also get DLL A loading 2 times (TRACE output)  when EXE A runs.

What TRACE output are you referring to, very specifically?

It doesn't seem like it should be possible to load two instances of
a DLL into the same process.


.B ekiM
http://www.nwlink.com/~mikeblas/
These words are my own. I do not speak on behalf of Microsoft.
           This performance was not lip-synched.




Become an MFC-L member | Вернуться в корень Архива |