BSTR is what you want to use for strings.

Signature
Andrew J. Ma
Software Test Engineer
Microsoft Office InfoPath
http://blogs.msdn.com/ajma
---------------------------------------
This posting is provided "As Is" with no warranties, and confers no rights.
Use of any included script sample are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm.
Please do not send email directly to this alias. This alias is for
newsgroup purposes only.
> Hallo again,
>
[quoted text clipped - 21 lines]
> Greetings,
> Wolfgang
Wolfgang - 19 Jul 2004 09:47 GMT
Hello,
i tried with BSTR but it does not work. My hardcoded string value
wasn't saved into the xml-file when saving the form in Fill-Out-Mode.
This is how I implemented it:
1. Generated IDL-Definitions using VS.NET 2003-Wizard.
[propget, id(2), helpstring("property BValue")] HRESULT BValue([out,
retval] BSTR* pVal);
[propput, id(2), helpstring("property BValue")] HRESULT BValue([in]
BSTR newVal);
2. Implemented the get-Method with the following code.
STDMETHODIMP CTestControl::get_BValue(BSTR* pVal)
{
BSTR testValue = new WCHAR[11];
swprintf(testValue,L"TestString");
pVal = &testValue;
return S_OK;
}
Can you help me ?
Greetings,
Wolfgang
> BSTR is what you want to use for strings.