Hello,
Recently I´ve added an ActiveX (MBaxp) in Xojo in order to develop a Modbus Master Control. Mostly of the ActiveX functions works fine, but I´ve found some problems with to parts of the ActiveX:
1 - Problems accessing to functions with a byref argument
2 - Property and method names are shared in this ActiveX
I´ve been looking up in forums and Ive found some doubts about this ActiveX, but not successfully ended.
The conclusions drawn are that I have to change some code of the ActiveX, because it´s possible that the code rendered from the ActiveX by Xojo is wrong for it. For example, the WriteCoilArray function has the following syntax in the help examples:
Visual Basic
Function WriteCoilArray (Handle As Integer, Index As Integer, Quantity As Integer, pRegisters As Integer) As Integer
Visual C++
short WriteCoilArray (short Handle, short Index, short Quantity, short* pRegsters);
The imported function by Xojo is:
WriteCoilArray (Handle_Param As Int16, Index_Param As Int16, Quantity_Param As Int16, ByRef pCoils_Param As Int16) as Int16
I´ve not been able to successfully run this function, because generates this exception: h80020005
I´ve tried with int16 arrays, int16 single variables, memoryblocks… but it never works (Ive change the argument to an array indeed)
On the other hand, the ActiveX has methods and properties with the same name:
For example Register is a property, but when I need to access like in the example in the help the method should be accessed instead, but Xojo reports an error
Example: Mbaxp1.Register(1, 0) = 1 (this is not array but you are using it as one)
I´m very confused because I change the method name and sometimes Xojo doesn´t recognize it. I dont know if I have to change the name of all occurrences or not (this ActiveX loads a MBAxpLib and a Mbaxp control)
The properties have Get and Set methods, but I don´t know if I have to change the Get or Set property by the method, and how. I´ve tried to change to extends and assigns but I can´t get anything.
Summarize:
Is right the assumption that I have to change some code the ActiveX imported?? Could someone give some guidelines to do it??
Could be any problems with the parameter type change (integer to int16) in the byref argument??
Thanks in advance!!