[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.interop

AfxGetAppName ASSERT using AfxThrowOleDispatchException in managed C++ assembly

Paolo Pagano

9/7/2007 9:05:00 AM

Hi,

I have a managed C++ DLL (or better, an assembly) Project (VS2005) using MFC
(shared).

I'm using MSScriptControl::IScriptControl, evaluating VB scripts and
exposing
a method to them (via DISP_FUNCTION inheriting from CCmdTarget).

This works fine except when in the exposed method I need to throw an
'AfxThrowOleDispatchException':
I got an ASSERT in 'AfxGetAppName' (null application name) in a call stack
like the one below.
Do I missed any initialization? I know I haven't a 'CWinApp' object, I'm in
a managed assembly.

Thanks.


mfc80ud.dll!AfxGetAppName() Line 29
mfc80ud.dll!COleDispatchException::Process ...
mfc80ud.dll!COleDispatchImpl::Invoke ...
vbscript.dll!7330429f() ...
[Frames below may be incorrect and/or missing, no symbols loaded for
vbscript.dll]
vbscript.dll!7330420f()
vbscript.dll!73303253()
mfc80ud.dll!ATL::CSimpleStringT<wchar_t,1>::SetString ...
mfc80ud.dll!CAfxStringMgr::Free ...
mfc80ud.dll!ATL::CStringData::Release()
mfc80ud.dll!ATL::CSimpleStringT<wchar_t,1>::~CSimpleStringT ...
mfc80ud.dll!ATL::CStringT ...
mfc80ud.dll!COleDispatchImpl::GetIDsOfNames ...
vbscript.dll!7330419e()
vbscript.dll!733043b1()
....

msscript.ocx!6b986192()
...

MyManagedCppAssembly.dll!MyClass::DoTheManagedJob( ...
MyCSharpApp.exe!MyApp.Test.DoTheJob( ...