Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

COM+ Error in passing serialized PropertyBag between objects

Status
Not open for further replies.

pankajtn

Programmer
Feb 2, 2001
2
US
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top