Mr AH
Mr AH

Reputation: 1120

Classic ASP passing object into VB6 COM dll method - Type Mismatch

This is one of the more bizarre issues I have faced in my time, and it's best explained like many problems with an example in Classic ASP:

Set thing = Server.CreateObject("ClassName") ' a C++ COM dll class
Set tool = Server.CreateObject("OtherClassName") ' a VB6 COM dll class

this doesn't work

tool.Method thing

this does work

Set session("thing") = thing
tool.Method session("thing")

When it doesn't work I get a type mismatch, I am VERY perplexed and have no idea where to start on this to be honest. Any pointers people?

Upvotes: 2

Views: 1390

Answers (1)

yms
yms

Reputation: 10418

Classic VB may expect the parameter of tool.Method to be a variant with type VT_BYREF, maybe your C++ COM instance is been passed as VT_DISPATCH or VT_UNKNOWN instead, but it is transformed into a VT_BYREF when you store it in a session first.

Upvotes: 2

Related Questions