I am working with a type library that uses PSafeArray extensively in the early-binding IDispatch functions. My last Delphi version was XE2, and I was able to use the imported type library fine in my Delphi apps.
Now I have Delphi XE8, and as far as I can tell, SafeArray, PSafeArray, TSafeArray and tagSafeArray are no longer defined. SafeArrayCreate now generates a PVarArray result instead of a PSafeArray result. When I try to use PVarArray instead of PSafeArray in my code, it complains about incompatible types:
E2033 Types of actual and formal var parameters must be identical.
When did this change, and how do I get past it?
Will replacing the PSafeArray references in the _TLB.pas file with PVarArray work? Perhaps I need to re-import the type library with different command-line parameters?
Here is the original function definition in the VS2010 ODL file used to generate the type library:
[id(11)] HRESULT GetFacetPointIndices( [in] int iFacetIndex, [in, out] SAFEARRAY(int)* pIndArray, [out, retval] int* numIndices );
Here are the imported function definition in the TLB:
from the IDispatch table:
function GetFacetPointIndices(iFacetIndex: SYSINT; var pIndArray: PSafeArray): SYSINT; safecall;
and from the DispInterface table:
function GetFacetPointIndices(iFacetIndex: SYSINT; var pIndArray: {NOT_OLEAUTO(PSafeArray)}OleVariant): SYSINT; dispid 11;
Thanks for any insight.
--
You never know until you find out.
Connect with Us