Hello people.
I have a really stressing problem...
I got a COM Service in my computer, and I have to communicate with this service using php (php 5.2.3). (the service it's a DLL made on VB and I don't have its sources)
My code is something like this:
$dev = new COM("MSGQueue.MessageQueue");
$obj = new COM("MSGQueue.QItem");
$obj->prop1 = 'Hello World';
$obj->prop2 = 0xF301;
$obj->Serialize();
$dev->DoWrite($obj->SBuffer); // here is the error!
As can be seen, this is like I'm storing "QItem"s in a database "MessageQueue".
$dev is the list where I'll put QItems.
$obj is the item I'll put in the list.
The $obj->Serialize() function, transforms the prop1 and prop2 data into codified data, and saves it into $obj->SBuffer.
To add an object to list, I call $dev->DoWrite, and I must pass the codified buffer as param.
The COM DLL is made under VB (I don't have the source of it), and I made a program in VB, the same php code above, but in VB, and it worked fine.
In VB, it says $obj->SBuffer is a byte[] type.
The error is when I execute $dev->DoWrite($obj->SBuffer);
It says something like "param type mismatch" (the error message is not in english).
But I not even assigned some value do SBuffer, just the Serialize function did it!
Do I need to do some type conversion before passing the $obj->SBuffer? 😕
(the DoWrite's param is declared in VB "ByRef p As Byte()")
I tryied a lot of conversions, using "(object), (int)" like, and using the php VARIANT class too, but I didn't get it!
Please I need a help on this.
(and sorry for my bad english)