I am having a ComServer, and its outlined functions are implemneted in C++. Below is the Cpp function.

HRESULT cIntuneServer::GetActiveProjectName(/*([out]*/ BSTR* nameOfProject)
{
CComBSTR projectName(L"\\Default\\");

*nameOfProject = projectName;
return S_OK;
}



I tried to implement the same function in Java:


JIString outStr = new JIString("");
dispatch.callMethod("GetActiveProjectName", new Object[]{outStr});
System.out.println("Out String = "+outStr.toString();


OUTPUT:

Out String = [Type: 1 , []]

How do i implement this in java?, I knew i am doing something worng, how do i get the BSTR* value to the OutStr in Java?