0

ActiveX control was registered from dll file using regsvr32:

cd \windows\syswow64
regsvr32 "C:\mapp\mycontrol.dll"

FoxPro object is created from it using

ofiscalprinter=CREATEOBJECT('mycontrol.Service.1')

In command window Intellisense shows its AX_SetAddInfoExt signature:

  AX_SetAddInfoExt( aStatus as Number @, 
    opts as Number, 
    RegistrationNo as String,
    DocumentNumber as String, 
    OtherDocumentNumber as String ) as Number

enter image description here

I need to pass null as parameter values.

Tried

astatus=0

ofiscalprinter.AX_SetAddInfoExt(@astatus,1,.null., .null., .null.)
ofiscalprinter.AX_SetAddInfoExt(@astatus,1,CAST(NULL as C(1) null), CAST(NULL as C(1)  null), CAST(NULL as C(1)  null))

throw

OLE error code 0x80020005: Type mismatch.

Also tried

ofiscalprinter.AX_SetAddInfoExt(@astatus,1,CHR(0), CHR(0), CHR(0) )
ofiscalprinter.AX_SetAddInfoExt(@astatus,1,0, 0, 0)
ofiscalprinter.AX_SetAddInfoExt(@astatus,1,'', '', '' )
ofiscalprinter.AX_SetAddInfoExt(@astatus,1,"", "", "" )
ofiscalprinter.AX_SetAddInfoExt(@astatus,1, [], [], [] )
ofiscalprinter.AX_SetAddInfoExt(@astatus,1,'1', '2', '3' )

throw

OLE error code 0x80004001: Not implemented.

Not implemented is probably thrown by method since it requires last or two parameters before last to have null. This looks like expected result, it looks like not null string parameters are passed correctly.

How to pass null values as parameters ? Maybe it is possible to use FoxPro .NET wrapper and call this from .NET

5
  • 1
    I don't think VFP supports null BSTR. If you own the mycontrol object you can declare these parameters as VARIANT instead and pass NULL from VFP and you will get a VT_NULL variants. (in .NET use "object" for a VARIANT) Commented Nov 16 at 10:50
  • I dont have mycontrol object source code. How to create .NET wrapper which can pass null as parameter and call it from FoxPro? Commented Nov 16 at 19:57
  • Just declare an object parameter, it will be .NET null if you call it with NULL from VFP or it will be of string type if you pass a "whatever" from VFP. Commented Nov 16 at 20:02
  • Which .NET wrapper to use and how to call it? Commented Nov 17 at 21:49
  • 1
    You want to develop and register (x86 because of VFP) a .NET COM object with a method defined like void AX_SetAddInfoExt(ref int aStatus, int opts, object RegistrationNo, object DocumentNumber, object OtherDocumentNumber) and in that method, instantiate the original "mycontrol.Service.1" COM object and call it with string or null strings. From VFP call ofiscalprinter=CREATEOBJECT('mydotnet.progid'), Difficult to say more w/o the real things. Commented Nov 18 at 8:11

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.