AfxGetInstanceHandle causes assertion failure for Dll - Programmer

This is a discussion on AfxGetInstanceHandle causes assertion failure for Dll - Programmer ; hi, i have a set of communication classes written in unmanaged c++ , which are now converted to c++.NET dll for using in a C# application. The dll needs to create a couple of sockets. Calls to CREATE or ATTACH ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: AfxGetInstanceHandle causes assertion failure for Dll

  1. AfxGetInstanceHandle causes assertion failure for Dll

    hi,

    i have a set of communication classes written in unmanaged c++ ,
    which are now converted to c++.NET dll for using in a C# application.
    The dll needs to create a couple of sockets. Calls to CREATE or ATTACH
    a socket causes a debug assertion failure. The point of error is
    AfxGetInstanceHandle() function. Instance handle for the dll is NULL.

    _AFXWIN_INLINE HINSTANCE AFXAPI AfxGetInstanceHandle()
    { ASSERT(afxCurrentInstanceHandle != NULL);
    return afxCurrentInstanceHandle; }

    what should i do to fix this ....?


  2. Re: AfxGetInstanceHandle causes assertion failure for Dll


    abintom@gmail.com wrote:
    > The point of error is
    > AfxGetInstanceHandle() function. Instance handle for the dll is NULL.


    > what should i do to fix this ....?


    Googling for 'AfxGetInstanceHandle' provided lots of useful
    information. The first three hits or so were filled with suggestions
    for just this type of problem.

    DS


  3. Re: AfxGetInstanceHandle causes assertion failure for Dll

    hi all,

    the provlem is fixed now. I was testing the assembly from a c#
    console app.
    Changed it to a c# windows app and everything is working fine.


    thanks to all for ur help.


+ Reply to Thread