hi,
need some help
i have C# COM and C++ client and i want to get byte array from this COM (for getting string in utf8).
i tried this:
C#:
public void GetName(out byte[] name)
{
name = utf8.GetBytes(name);
}
C++:
...
SAFEARRAY* sa = NULL;
com->GetName(&sa);
...
- for initializing that SAFEARRAY i tried NULL, SafeArrayCreate() and SafeArrayAllocDescriptor() (all of them seem to work)
- i also tried to destroy that SAFEARRAY later with SafeArrayDestroy() or SafeArrayDestroyDescriptor(), but the application raised an exception
and finally the problem is that after a few calls of this function my client application freezes.
what's wrong, where's the problem?
(i am not very familiar with COM and SAFEARRAYs, so forgive me if it's total bullshit)
thanks much for any help
(or any idea for getting string to C++ in utf8 encoding??)
acer
need some help
i have C# COM and C++ client and i want to get byte array from this COM (for getting string in utf8).
i tried this:
C#:
public void GetName(out byte[] name)
{
name = utf8.GetBytes(name);
}
C++:
...
SAFEARRAY* sa = NULL;
com->GetName(&sa);
...
- for initializing that SAFEARRAY i tried NULL, SafeArrayCreate() and SafeArrayAllocDescriptor() (all of them seem to work)
- i also tried to destroy that SAFEARRAY later with SafeArrayDestroy() or SafeArrayDestroyDescriptor(), but the application raised an exception
and finally the problem is that after a few calls of this function my client application freezes.
what's wrong, where's the problem?
(i am not very familiar with COM and SAFEARRAYs, so forgive me if it's total bullshit)
thanks much for any help
(or any idea for getting string to C++ in utf8 encoding??)
acer