Re: Type mismatch calling a COM object developed in vb6
- From: "Dag Sunde" <dag@xxxxxx>
- Date: 14 Feb 2006 07:24:46 +0100
<wolfing1@xxxxxxxxx> wrote in message
news:1139859723.501094.38100@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I created a COM object in VB6, but when I call it from ASP it gives me
a type mismatch error. It's weird, let's say the function in the COM
object is:
public function test(a as string)
...
end function
response.write obj.test("test string")From vbscript (ASP), if I call it like this:
It works.
But if I call it like:
dim k
k = "test string"
response.write obj.test(k)
It gives me a type mismatch.
Should I define the functions in the COM object without an explicit
type? like
public function test(a)
WHen your COM component is to be consumed by .ASP, *all* parameters
in public menthods *must* be passed 'ByVal'.
And no, you should declare them with type.
Just Change your function to :
public function test(ByVal a as string)
and recompile, and all will be fine...
--
Dag.
.
- References:
- Type mismatch calling a COM object developed in vb6
- From: wolfing1
- Type mismatch calling a COM object developed in vb6
- Prev by Date: Re: SQL error
- Next by Date: How to change COM port number
- Previous by thread: Re: Type mismatch calling a COM object developed in vb6
- Next by thread: Unspecified error making EXE
- Index(es):
Relevant Pages
|