Hi
I am running Visual Basic data access objects under COM+ on windows 2000 server. I use PropertyBag object to talk between the various components (by serializing the propertybag using PropertyBag.Contents and then on the other side deserializing it by reading it into an byte array and then assigning the byte array to Contents of PropertyBag).
Whenever I use this method to pass data between two objects running under COM+, I get VB Error 5 (Invalid procedure call or argument). This happens exactly when the receiving object tries to convert the passed data back to a property bag. As a very generic example, consider the following code in which ObjectA running under COM+ calls ObjectB also running under COM+ :
Method in ObjectA is:
public MethodA
dim ByteBuffer() as byte
dim objPB as propertyBag
dim objObjectB as ObjectB
set objObjectB =ObjectContext.CreateInstance("Ob.ObjectB"
strData = objObjectB.FunctionB(param1)
ByteBuffer = strData
set objpb = new Propertybag
objPB.Contents = bytebuffer
end sub
I get VB Error 5 at last line (objPB.Contents = bytebuffer).
Also the error only happens if both the objects are running under COM+. Also it does not matter if I create the object using CreateInstance or CreateObject.
Any help to resolve this or shed light on as to what I am doing wrong would be greatly appreciated.
Thanks
Pankaj
I am running Visual Basic data access objects under COM+ on windows 2000 server. I use PropertyBag object to talk between the various components (by serializing the propertybag using PropertyBag.Contents and then on the other side deserializing it by reading it into an byte array and then assigning the byte array to Contents of PropertyBag).
Whenever I use this method to pass data between two objects running under COM+, I get VB Error 5 (Invalid procedure call or argument). This happens exactly when the receiving object tries to convert the passed data back to a property bag. As a very generic example, consider the following code in which ObjectA running under COM+ calls ObjectB also running under COM+ :
Method in ObjectA is:
public MethodA
dim ByteBuffer() as byte
dim objPB as propertyBag
dim objObjectB as ObjectB
set objObjectB =ObjectContext.CreateInstance("Ob.ObjectB"
strData = objObjectB.FunctionB(param1)
ByteBuffer = strData
set objpb = new Propertybag
objPB.Contents = bytebuffer
end sub
I get VB Error 5 at last line (objPB.Contents = bytebuffer).
Also the error only happens if both the objects are running under COM+. Also it does not matter if I create the object using CreateInstance or CreateObject.
Any help to resolve this or shed light on as to what I am doing wrong would be greatly appreciated.
Thanks
Pankaj