COM dll reference path is missing

skessinger

Member
Joined
Apr 12, 2010
Messages
8
Programming Experience
10+
Using VB.NET 2008 SP1 on Windows XP Pro SP3:

I am using an existing COM dll that works fine in VB6, on the same development machine. The VB6 app compiles and uses this dll without issue.

I start from scratch to design a new Windows Form application in VB.Net. Then when I try to add a reference to this dll, the reference is added to the references list but the path shows as <The system cannot find the reference specified>. If I select this reference in the list, the properties window shows a blank for both the reference name and the path. At the same time, a reference is added for VBA, and it shows the reference name (Interop.VBA) and path correctly.

I used dependencywalker to find the dependencies for this dll. It has 3:
user32.dll, kernel32.dll, and msvbvm60.dll. So presumably I have all necessary dependent files.

I have tried un-registering, re-registering the dll. I have tried the command line switches for devenv.exe to reset settings and to launch in safe mode. I created a new user account to see if it was related.

I have tried picking the dll from the Add References, COM tab and also via the Browse tab to select the file directly. Same result all cases. I also tried putting the dll and msvbvm60.dll in my bin folder.

I don't understand how the reference name and path are missing in the properties window when the reference name is right there in the list and I select the path directly when I added it. There are no other instances of this dll registered.

I tried using tlbimp from the command prompt with verbose switch, I get the error:
System.Runtime.InteropServices.COMException - Error loading library/DLL. (Exception from HRESULT: 0x80029C4A (TYPE_E_CANTLOADLIBRAY)). I wish it would tell us what is missing.

It must be registered properly and all dependencies available for it to work in my VB6 app, so what am I missing? Any suggestions? Re-writing the dll is not currently an option.

Thanks in advance,
sk
 
Problem resolved

I finally used Process Monitor to see what references the dll was looking for, but it was a real pain in the butt. DependencyWalker did not find them. It would be "nice" if there was a log or something that tells what dependencies are not found, instead of just announcing that one or more dependencies can't be found or cannot load dll. I would expect the /verbose switch for tlbimp.exe to list the dependencies not found. When a reference is added to the Reference list, how about a pop-up with what dependencies can't be found or display them in the error list? Someone know of a better tool than DependencyWalker or ProcessMonitor?
 
Back
Top