Bobby (or anyone else),
I found a response that you had written to someone who is having the
exact same problem that I am at the moment. I have an unmanaged C++
shared mfc extension dll, and I have created a managed shared mfc
C++/CLI wrapper to be able to access it's functions through a C#
application. Within the unamanged dll is a call to CAsynSocket Create,
and when I invoke this call through my C# app -C++ wrapper -C++
dll, I get a debug assertion that shows at the top of the call stack
AfxGetInstanceHandle.
I attempted to do what was suggested in your response in this thread:
http://groups.google.com/group/micro...869ba96cde3bc8
I created a new MFC class within my managed c++ project that I derived
from CWinApp. I implemented the InitInstance the way that was
suggested, and I declared a global instance of this class. I still get
the same debug assertion. I tried putting the following code in
another class of my wrapper dll:
CWinApp* theApp = AfxGetApp();
theApp->InitInstance();
to get it to call the InitInstance, and it was called and the
AfxSocketInit was called from within there as well, but I still got the
debug assertion.
I'm sure that I'm just missing something that would be obvious to
someone familiar w/the CWinApp and managed/unmanaged code, so if anyone
could help me out, I'd really appreciate it.
Thanks,
Doreen