> Thank you.
>
[quoted text clipped - 11 lines]
>> You can then use P/Invoke those functions in your C# application.
>> That would be the easiest solution.
> One thing worth remembering is: you can use only declspec calling
> convention....
Actually, declspec is not a calling convention. It's a declaration
specifier.
And you can use __stdcall, __fastcall or __cdecl calling convention.
Whatever is fit for your purpose.
Afaik there is no restriction on calling convention when using DllImport in
C#.

Signature
Kind regards,
Bruno van Dooren
bruno_nos_pam_van_dooren@hotmail.com
Remove only "_nos_pam"
Pucca - 29 Aug 2006 23:51 GMT
Funny you should mention the calling conventions. I'm getting LNK2019 error
when I tried to create the my C++ DLL and export it. Here is my export
statement:
#include "stdafx.h"
extern "C" DE_ERRORS __declspec(dllexport)DecodeAsnUser(Blob* pBlob,
CUserContextData *userData)
{
my code;
}
Here are my errors:
-------------------------------------------------------
Error 1 error LNK2019: unresolved external symbol "void __stdcall
_com_issue_error(long)" (?_com_issue_error@@YGXJ@Z) referenced in function
"public: class _bstr_t & __thiscall _bstr_t::operator=(char const *)"
(??4_bstr_t@@QAEAAV0@PBD@Z) UnityDecodeAsnUser.obj
Error 2 error LNK2019: unresolved external symbol "wchar_t * __stdcall
_com_util::ConvertStringToBSTR(char const *)"
(?ConvertStringToBSTR@_com_util@@YGPA_WPBD@Z) referenced in function "public:
__thiscall _bstr_t::Data_t::Data_t(char const *)"
(??0Data_t@_bstr_t@@QAE@PBD@Z) UnityDecodeAsnUser.obj
Error 3 error LNK2019: unresolved external symbol "char * __stdcall
_com_util::ConvertBSTRToString(wchar_t *)"
(?ConvertBSTRToString@_com_util@@YGPADPA_W@Z) referenced in function "public:
char const * __thiscall _bstr_t::Data_t::GetString(void)const "
(?GetString@Data_t@_bstr_t@@QBEPBDXZ) UnityDecodeAsnUser.obj
Error 4 fatal error LNK1120: 3 unresolved
externals C:\Projects\UnityDecodeAsnUser\Debug\UnityDecodeAsnUser.dll
How can I correct this Lnk error?

Signature
Thanks.
> > One thing worth remembering is: you can use only declspec calling
> > convention....
[quoted text clipped - 5 lines]
> Afaik there is no restriction on calling convention when using DllImport in
> C#.
Pucca - 30 Aug 2006 00:36 GMT
Ok, I seem to get rid of the lnk2019 error by doing the following:
link "comsuppwd.lib" in debug AdditionalDependencies.
Link "comsuppw.lib" in release AdditionalDependencies

Signature
Thanks.
> Funny you should mention the calling conventions. I'm getting LNK2019 error
> when I tried to create the my C++ DLL and export it. Here is my export
[quoted text clipped - 38 lines]
> > Afaik there is no restriction on calling convention when using DllImport in
> > C#.