Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Calling C++ dll from C# - how to debug?
Message
De
20/10/2017 13:37:25
 
 
Information générale
Forum:
C#
Catégorie:
Code, syntaxe and commandes
Divers
Thread ID:
01655067
Message ID:
01655119
Vues:
43
>>>>>With the new dll I am now getting:
>>>>>
>>>>>Managed Debugging Assistant 'PInvokeStackImbalance' occurred
>>>>> Message=Managed Debugging Assistant 'PInvokeStackImbalance' : 'A call to PInvoke function 'Siriusware.Middleware!Siriusware.Middleware.ValidationPass::Invoke1' has unbalanced the stack. This is likely because the managed PInvoke signature does not match the unmanaged target signature. Check that the calling convention and parameters of the PInvoke signature match the target unmanaged signature.'
>>>>>
>>>>>But no crash as before.
>>>>
>>>>See what the CallingConvention of the Siriuseware invoke1 is
>>>
>>>The C++ declaration is
>>>
>>>
>>>EXTERN_C LPCTSTR Invoke1	(LPCTSTR szIn)
>>>{
>>>	AFX_MANAGE_STATE(AfxGetStaticModuleState());
>>>
>>>	pMainEngine->m_cei.Clear();
>>>	pMainEngine->ProcessCall(CString(szIn), theApp.m_csRet);
>>>	return theApp.m_csRet;
>>>}
>>>
>>>Does it help?
>>
>>Not to me.
>>
>>Try cdecl
>
>I tried, got 0 error, but the result looked like Chinese characters, not the normal string it was supposed to return.
First ask your collegue what the calling convention is
It’s not in the signature. Or have him put it in the signature
Gregory
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform