Posted on 2002-06-11
I have a ActiveX component, that is giving me some problems. I'll try to explain :
The ActiveX after install, was instaled correctly.
However, there was another COM that didn't install, but with Project>Import Type Library>Install (after finding the .DLL file), it worked just fine.
The problem, was when an instruction requested a OLEVARIANT var type, and in a demo written in VB it worked just fine, in Delphi I just got a "Types of actual and formal var parameters must be identical" error.
As follows, I'll post the VB and my Delphi code, so that you may help me.
======= VB CODE ==========
Public Sub OperatorLogo(sPath As String, sTelNumber As String, dManufacturer As Long, Optional sPhoneType As Long)
Dim oFileRef As New AGFileRef
oConfigFrame.SetSlotValue OTA_LOGO_TARGET, sTelNumber
oConfigFrame.SetSlotValue OTA_LOGO_PHONE_MANUFACTURER, dManufacturer '// Only Nokia for the moment
' oConfigFrame.SetSlotValue OTA_LOGO_PHONE_MODEL, sPhoneType '// Optional slot
oConfigFrame.SetSlotValue OTA_LOGO_LOGO, oFileRef <==== Line OK in VB!!!
========= DELPHI CODE ===========
var MyNumber : OleVariant;
Manufactor : OleVariant;
test : TAGFileRef;
const OTA_LOGO_TARGET = 'Target';
OTA_LOGO_PHONE_MANUFACTUROR = 'PhoneManufacturer';
OTA_LOGO_LOGO = 'Logo';
test := TAGFileRef.Create(Self);
MyNumber := '+351919004504';
Manufactor := OTA_LOGO_PHONE_MANUFACTUROR;
NetSize.SetSlotValue (OTA_LOGO_TARGET, MyNumber);
NetSize.SetSlotValue (OTA_LOGO_LOGO, test); <===== ERROR LINE!!!
If you need any code, you can also write me at email@example.com