ByRef Variable Passing from ASP to COM 
Author Message
 ByRef Variable Passing from ASP to COM

Hello,

<IN> variables may be correctly typed in your component but must be declared
ByVal in the component.
There is no <OUT> available to VB.
<IN/OUT> must be declared as variant if it is used in ASP. ASP only uses
variant. I think arrays must also be declared variant even if they are only
<IN>.

http://www.*-*-*.com/

http://www.*-*-*.com/

Hope this helps
Scott

Quote:

> Konst,

> Thanks very much but there is no need wasting bandwidth suggesting the
> obvious <g>.  I know I can declare the COM variable as a variant.  However,
> that is a very poor solution.  If I'm forced to do that, there is no sense
> in typing variables at all.

> Randy



> > then declare the parameter in the COM function As variant.



> > > Konst,

> > > The CInt() is necessary because all variables in ASP are variants but in
> > my
> > > COM object, the variable is declared as an Integer.  Without the cast,
> > I'll
> > > get a runtime error.

> > > Randy



> > > > cint(pagenbr) actually creates another variable , and that one is
> passed
> > > as
> > > > const (not to be changed) to the function. just remove cint() - by the
> > way
> > > ,
> > > > for what you did so



> > > > > In my ASP code, I am calling a COM object as follows:

> > > > > objClass.DisplayClassList RsClass,CStr(OrderBy),CInt(PageNbr)

> > > > > The second parameter, "PageNbr" is defined as follows in my object:

> > > > > ByRef PageNbr As Integer

> > > > > The "DisplayClassList" is modifying the "PageNbr" variable but the
> > > change
> > > > is
> > > > > not being reflected back in my ASP code after the function returns.

> > > > > Am I not able to pass by reference going from ASP to a COM object?

> > > > > Thanks,

> > > > > Randy



Mon, 23 Sep 2002 03:00:00 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Passing objects byref to COM

2. How to pass vbscript array variable to shared object using ByRef

3. passing javascript variable into asp variable using vbscript

4. Problem passing VB COM+ ASP Request object to .NET component System.Web.HTTPRequest through COM interop

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

6. Passing a variable by reference in a COM object

7. Passing Multi-Dimensional arrays to COM objects from VBScript/ASP

8. Passing objects between COM and ASP

9. Passing an array from an ASP to a COM object

10. Passing an array from an ASP to a COM object

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

12. Passing UDTs from ASP to COM Components

 

 
Powered by phpBB® Forum Software