Passing Object Ref from asp page to com 
Author Message
 Passing Object Ref from asp page to com

I am trying to pass an object ref to a com object:

The object I want to pass to the dll is an
MSXML2.DOMDocument40.  I can't get it to go either as an
object or as a variant.

Here is part of the function in the dll:

Public Function UpdateCustomerDetails(ByRef XMLObj As
Variant) As String

  Dim RS As New ADODB.Recordset
  Dim Data As CSG2003.ClsDataAccess
  Dim OutputString As New ClsStrings

  On Error GoTo ErrorHandler

  Set Data = New CSG2003.ClsDataAccess
  Set RS = Data.CreateRecordset(Conn, "SELECT * FROM
CUSTLOCATIONS WHERE LOCATIONID = " _
    & XMLObj.selectSingleNode
("SOAP:Envelope/SOAP:Body/m:UpdateCustomerDetails/LocationI
d").Text)

.
.
.

End Function

Here is the asp that calls the dll:

<%
Dim DataObject 'As Object
Dim objXMLDOM 'As Object

'On Error Resume Next

Set objXMLDOM = Server.CreateObject
("Msxml2.DOMDocument.4.0")
objXMLDOM.load Request

Set DataObject = Server.CreateObject
("CSG2003.ClsCustomers")

Response.Write DataObject.UpdateCustomerDetails(objXMLDOM)

Set DataObject = Nothing

Response.End

%>

If I try to declare an object parameter in the dll I get a
type mismatch error.  If I use the variant type I get
error 91 (object variable or with block variable not set)

I am with VB6 on Win2k.
My server is NT4 Sp6 with IIS 4.02.0622

If anyone an tell me how to pass the object to the dll I
would really appreciate it.

Thanks,

Pat



Mon, 23 May 2005 01:13:24 GMT  
 Passing Object Ref from asp page to com

Quote:
> I am trying to pass an object ref to a com object:

> The object I want to pass to the dll is an
> MSXML2.DOMDocument40.  I can't get it to go either as an
> object or as a variant.

> Here is part of the function in the dll:

> Public Function UpdateCustomerDetails(ByRef XMLObj As
> Variant) As String
> ...

Try to drop the ByRef. I'm doing something similar (though the COM object is
in Perl) and it works so it IS possible.

Jenda



Tue, 24 May 2005 21:16:54 GMT  
 Passing Object Ref from asp page to com
Arguments are ByRef by default anyway in VB.  So if I drop
it,  I don't think it will make a difference.

I was actually able to save the xml as a string and pass
it that way.  Once the function received it, I reloaded it
into a fresh DomDocument object within the dll.  Maybe not
quite as fast as passing the object but i just could seem
to get that to work.

Thanks anyway,

Pat

Quote:
>-----Original Message-----


>> I am trying to pass an object ref to a com object:

>> The object I want to pass to the dll is an
>> MSXML2.DOMDocument40.  I can't get it to go either as an
>> object or as a variant.

>> Here is part of the function in the dll:

>> Public Function UpdateCustomerDetails(ByRef XMLObj As
>> Variant) As String
>> ...

>Try to drop the ByRef. I'm doing something similar

(though the COM object is

- Show quoted text -

Quote:
>in Perl) and it works so it IS possible.

>Jenda

>.



Wed, 25 May 2005 04:38:26 GMT  
 Passing Object Ref from asp page to com
Oops, I thought ByVal was the default. Could you try to change the ByRef
to ByVal?

Jenda

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!



Fri, 27 May 2005 22:14:30 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Passing a collection object to a COM server from an ASP page

2. Passing an Array from a COM Object to an ASP Page

3. Pass processing from asp page to COM object

4. Pass ASP Intrinsics to Com component by ref?

5. pass ref byte to com object

6. vbscript passing by ref to com object, problem

7. ObjectContext vs. Passing ASP objects from ASP page

8. passing a recordset from a com to an asp page

9. Pass processing from asp page to COM

10. COM-Object in ASP with COM-Object as parameter

11. COM-Object in ASP with COM-Object as Parameter

12. com object will not read registry when com object called from asp (vb works fine)

 

 
Powered by phpBB® Forum Software