I have a managed C ++ dll that dynamically links with an unmanaged C ++ dll. Many unmanaged classes were received from the abstract interface in managed C + + unmanaged DLL.
This works fine.
----------
// Macro uses __declspec (dllexport)
Category EXPORT_API ICustomer
Public:
Virtual Zero Place Order () = 0;
//
};
----- & lt; Managed in C ++> -> - # - # - Include local customizer HK to include "unmanagedlib / ICustomer.h".
// An unmanaged derivative class defined in Managed Dell
Category LocalCustomer: Public ICustomer
Public:
order free ();
//
};
The local customer is used in Managed Dell. I can pass it to unmanaged DLL work and it all works well.
The problem here is that I get STATUS_INVALID_IMAGE_FORMAT at startup when I try to implement an interface that exposes a template.
Not run.
stuct order
{
double price; // // ... ...};
Template & lt; Typename T >
EXPORT_API ICollection
//.
Class EXPORT_API IFactory
{public:
Virtual Icon & lt; Order > & amp; GetOrders () = 0;
}
------ & lt; Managed C ++ DLL -------
Category OrderCollection: Public Icon & lt; Order >
Category Local Factory: Public IFactory
{public:
Virtual Icons & lt; Order > & amp; GetOrders () {Return m_orders; }
Private:
CommandCollection m_orders;
};
I have compressed this template override GetOrders down. Due to the code in Managed Dell causes a dialog to open "This application was unable to start correctly (0xc000007b) which is just throwing STATUS_INVALID_IMAGE_FORMAT HRESULT through the handle loader. Removing the code allows it to run Why can not I use it in Managed Dell.
Another clue, it is not certain that this is not a distraction .. I am compiling 32 bit app and Win7 x64 I am walking with the work. Okay, unless the template does not cross the DLL to manage unmanaged.
Do I kill Ihave many unencrypted C ++ templates which are completed within the managed dll It works just fine and it works fine. It's just templates that have been passed between dll and giving me bad images.
I'm not sure, but I think that you have a generic template Shaon can not export DLLs are. Creating templates is referred to at the time of construction of the instant when the address. This means that the source code of the mptl should be visible at construction time, which is not the case. You have a precompiled dll, how would you expect template urgency?
Comments
Post a Comment