468,510 Members | 1,590 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,510 developers. It's quick & easy.

Return string of variable length by IJW-methodcall

Hi,

My problem is getting a string of variable length from a unmanaged DLL,
called by a managed DLL using IJW. In der legacy DLL is declared

bool UnmanagerClass::GetData(std::wstring* pString)
{
// content of pString as input by the caller is received correct

*pString = L"the string to return";
// content of (*pString) is currupted
}

The managed DLL calls into the legacy DLL using IJW:

// managed.dll
UnmanagerClass m_Unmanaged;
std:wstring String = L"Input";
m_Unmanaged.GetData(&String);
// now String is empty

It makes no difference if the tringparameter is handed over as pointer or
reference.
Is it not possible to use std:wstring as in-out parameter in a IJW-call ?
Is there another solution to this problem, may be using CString from MFC?

Thanks very much for any reply.
Fritz
Nov 17 '05 #1
0 777

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

23 posts views Thread by Nascimento | last post: by
10 posts views Thread by Mark Jerde | last post: by
2 posts views Thread by SteveW | last post: by
5 posts views Thread by samoore33 | last post: by
18 posts views Thread by Pedro Pinto | last post: by
11 posts views Thread by Victor Lagerkvist | last post: by
1 post views Thread by fmendoza | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.