Problem with passing result to/from vbscript - Com-object written in C++ 
Author Message
 Problem with passing result to/from vbscript - Com-object written in C++

----------------------------------------------------------------------------
---------------------------------

I don't get any result from follwing call:

           datumObj.BWKEYAN CDbl(Indata), CDbl(Dummy), CDbl(Utdata),
CStr(Feltext)

BWKEYAN is a com-object, that generates at date in the result field
"Utdata", but I don't get the value
back from the com-object (I know that it's correct in the com-object), the
com-object is not a function it's more like a "subroutine".

What's wrong ?

Can any one help me please ?

Best Regards  /KC
----------------------------------------------------------------------------
----------------------------------
The complete code:

<% OPTION EXPLICIT%>
<html> <head>
<title>Datum Exempel (ASP client)</title>
</head>
<body>
<%
 Dim datumObj, Test
 Dim Indata, Dummy, Utdata, Feltext
 Dim ErrFlag, Varv
 Indata = Request.Form("Indata")
 Dummy = Request.Form("Dummy")
 Utdata = 0
 Feltext = ""

  On Error Resume Next
    If (IsNumeric (Indata)) Then
     Set datumObj = Server.CreateObject("Orfa_bwkeyan.BWkey.1")



Sat, 30 Aug 2003 22:18:56 GMT  
 Problem with passing result to/from vbscript - Com-object written in C++
"...I don't get any result from follwing call:..."

and you never will.

Passing CDbl(Utdata) doesn't pass a reference to the variable Utdata - it passes a reference to the
value returned by the CDbl() function.

If you are using CDbl() to circumvent a "type mismatch" error, see the following links for varous
perspectives on this "problem"...

Type Mismatch When Passing Parameters from ASP to VB
http://support.microsoft.com/view/dev.asp?kb=244012

Q165967 - PRB: Script Error Occurs When Referencing Non-variant Array
http://support.microsoft.com/support/kb/articles/Q165/9/67.ASP

Building COM Components That Take Full Advantage of Visual Basic and Scripting
http://msdn.microsoft.com/library/techart/msdn_VBScriptcom.htm#vbscri...

--
Michael Harris
Microsoft.MVP.Scripting
--

Please do not email questions - post them to the newsgroup instead.
--

Quote:

> ----------------------------------------------------------------------------
> ---------------------------------

> I don't get any result from follwing call:

>            datumObj.BWKEYAN CDbl(Indata), CDbl(Dummy), CDbl(Utdata),
> CStr(Feltext)

> BWKEYAN is a com-object, that generates at date in the result field
> "Utdata", but I don't get the value
> back from the com-object (I know that it's correct in the com-object), the
> com-object is not a function it's more like a "subroutine".

> What's wrong ?

> Can any one help me please ?

> Best Regards  /KC
> ----------------------------------------------------------------------------
> ----------------------------------
> The complete code:

> <% OPTION EXPLICIT%>
> <html> <head>
> <title>Datum Exempel (ASP client)</title>
> </head>
> <body>
> <%
>  Dim datumObj, Test
>  Dim Indata, Dummy, Utdata, Feltext
>  Dim ErrFlag, Varv
>  Indata = Request.Form("Indata")
>  Dummy = Request.Form("Dummy")
>  Utdata = 0
>  Feltext = ""

>   On Error Resume Next
>     If (IsNumeric (Indata)) Then
>      Set datumObj = Server.CreateObject("Orfa_bwkeyan.BWkey.1")



Sun, 31 Aug 2003 05:24:16 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Passing an Entry ID from VBScript to a C++ COM object

2. Passing an Array object to a C++ COM object

3. Is it possible to pass a C++ NULL to a COM object from JScript

4. Passing a vjscript byte array to a C++ COM object

5. vbscript passing by ref to com object, problem

6. Passing variables to a com object method written in VB

7. Passing strings to C++ COM

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

9. Passing Arrays from VBScript to COM Object

10. How to pass a pointer to a COM object in VBScript

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

12. Capturing return values in JScript from C++ COM objects

 

 
Powered by phpBB® Forum Software