Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error while bedugging, but not in run time

Status
Not open for further replies.

CoderMan

Programmer
Aug 20, 2002
8
US
I have a VB DLL that I am trying to debug(x.dll). The source code and names are propreitary so I will use psedo names here instead.

In order to debug my problem I have written a small VB program(test). However I don't get too far.

All I am doing in test is this

Dim objXRef As X.XXXX
Set objXRef = CreateObject("X.XXXX")

and I have a reference to x.dll in this project.

If I step through my test program everything is fine if I use the compiled x.dll component. However If I try to run x.dll's source code in debug mode, hoping to step through the code when I call it in test(it comes futher down and I have not put that in here), I get a an error saying

Run time Error '13'
Type Mismatch

This I get on line 2 when I try to create an object reference to X.XXXX. I am perplexed and confused. Hopefully some one can shed some light on this.

Thanks in advance.
 
If you're doing a CreateObject (aka late binding) you don't need a reference (aka early binding).

You should use the method that you will be calling the mystery DLL in your production environment. IOW, use one or the other, but not both.

Chip H.


 
Aha! Another person perpetuating the myth that CreateObject = Late Binding!
 
I think I solved it.

Here is waht was happening.

I had a reference to a older version of the mystery DLL in my project references. So the DIM part was using that dll. The Create Object part was letting me step through into the dll but was since the interface ahd changed it was giving me the type mismatch error. I derefrenced the old dll, referenced the new and it worked.

Thanks to all of you for trying to help me out.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top