Board index » delphi » Returning Safearray of BSTR from Interface method call
amil...@shwd.com
![]() Delphi Developer |
Tue, 04 Dec 2001 03:00:00 GMT
Returning Safearray of BSTR from Interface method call
I'm having problems returning a safearray of BSTR to a VB
user. I can actually get the array through with the proper dimensions, it's just that the single string element in the array is always an empty string. I'm developing an ActiveForm based control. The interface looks like this: IContextReceiver = interface(IUnknown) Here's the implementation: function TEntryControl.Get_ContextClasses(out contextList: PSafeArray): VarBounds[0].LowBound := 0; Index[0] := 0; elItem := SysAllocString(strPtr); contextList := SafeArrayCreate(VT_BSTR, 1, VarBounds); if SafeArrayPutElement(contextList, Index, elItem) <> 0 SafeArrayUnlock(contextList); I have been through many different iterations for this implementation I have tried using VarArrayCreate, SafeArrayCreateVector ... etc. In VB, the array is actually returned with the correct dimensions, so Any ideas. amil...@shwd.com Sent via Deja.com http://www.deja.com/ |