Re: ATL dll failing to load in VB
- From: "Brian Muth" <bmuth@xxxxxxxx>
- Date: Fri, 13 Jun 2008 09:02:00 -0700
<pulkit.gaur@xxxxxxxxx> wrote in message news:e6b09fa3-821a-4bf7-b65b-544968011c5a@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi Brian ..
Well .. my dll is in debug mode
Copied the code of the lib inside my new dll.
Now the problems boils down to the call of my wrapper dll.
i get exception saying - Access violation reading location 0x00000000
in the
dllmain() of my wrapper dll whenever it gets called.
here is the code frag ..
=====================================================
struct cInfo
{
int nCamN;
IBaseFilter *pCap;
IBaseFilter *pSG;
CoSGCB *pSGCB;
dsCallBack *pCB;
CamInfo () : pCap(NULL), pSG(NULL), pSGCB(NULL), pCB(NULL) {};
};
static __declspec( thread ) vector<cInfo> *pinfo;
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
CoInitialize(0);
pinfo = new vector<cInfo>; { here i get exception }
..........
...............................
............
=======================================================
-
dinmith
I see you just posted this in the MSDN Forums at
http://forums.msdn.microsoft.com/en-US/vcgeneral/thread/c3a86583-2567-420c-9ab2-b4baea50fb6a
and I've answered it there:
You are breaking a number of rules. Please re-read the documentation on DllMain() carefully. You can only carry out very primitive operations when attaching a DLL. And certainly there is no point in calling CoInitialize(), since the thread that loads the DLL may not be the thread that calls into the DLL later on. Either the client must call CoInitialize, or you will have to call CoInitialize...CoUninitialize() on each call into the DLL.
.
- References:
- ATL dll failing to load in VB
- From: dinmith
- Re: ATL dll failing to load in VB
- From: Brian Muth
- Re: ATL dll failing to load in VB
- From: pulkit . gaur
- ATL dll failing to load in VB
- Prev by Date: Re: ATL dll failing to load in VB
- Next by Date: Re: ATL
- Previous by thread: Re: ATL dll failing to load in VB
- Next by thread: Re: ATL dll failing to load in VB
- Index(es):
Relevant Pages
|