
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