[Done] COMMate: a method requires a method as parameter

Just starting out? Need help? Post your questions and find answers here.
infratec
Always Here
Always Here
Posts: 6874
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

[Done] COMMate: a method requires a method as parameter

Post by infratec »

Original Example:

Code: Select all

MasterDb := BpApp.DataSetInfos('Adressen').CreateDataSet;
Dokument := BpApp.GetSpecialObject(soDokumente);
Dokument.InitDB(MasterDb);
In PB:

Code: Select all

  Protected oDokument.COMateObject
  Protected oAdresseTable.COMateObject
  
  oAdresseTable = _ERP\GetObjectProperty("DataSetInfos('Adressen')\CreateDataSet()")
  oDokument = _ERP\GetObjectProperty("GetSpecialObject(2)")   ; 2 is soDokumente
  oDokument\Invoke("InitDB( ??? )")

I get always a type missmatch, doesn't matter what I try to use at the ???

Any idea?

Bernd
Last edited by infratec on Mon Jan 22, 2018 2:04 pm, edited 1 time in total.
User avatar
Ajm
Enthusiast
Enthusiast
Posts: 234
Joined: Fri Apr 25, 2003 9:27 pm
Location: Kent, UK

Re: COMMate problem: a method requires a method as parameter

Post by Ajm »

Hi Infratec,

Just a guess but do you need to pass in the oAdresseTable COMateObject to the InitDB.

So possibly something like:-

Code: Select all

oDokument\Invoke("InitDB(" + Str(oAddressTable) + "As COMateObject )")
Regards

Andy

Image
Registered PB & PureVision User
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: COMMate problem: a method requires a method as parameter

Post by srod »

That should do it yes. Just make sure to put a space before the 'As' :

Code: Select all

oDokument\Invoke("InitDB(" + Str(oAddressTable) + " As COMateObject )")
I may look like a mule, but I'm not a complete ass.
infratec
Always Here
Always Here
Posts: 6874
Joined: Sun Sep 07, 2008 12:45 pm
Location: Germany

Re: COMMate problem: a method requires a method as parameter

Post by infratec »

Hi,

thank you very much: it works.

Bernd
Post Reply