Link to home
Start Free TrialLog in
Avatar of gbzhhu
gbzhhuFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Class not registered after migrating VB 6 code to VB.NET

Hi,

A colleague of mine running Win XP migrated a program fomr VB 6 to VB.NET.  Everything works on his PC and all his code is available to me.  I have Win 2000, same VS.NET as him and same version of .NET Framework.  When I run the code I get error "System.Runtime.InteropServices.COMException occured in system.windows.forms.dll" My colleague has newer Windows files which I tried to update but Windows 2000 is not having it ;-(  other than that I have everything he has in his setup.  My guess is that his interop dlls (The Runtime Callable dlls) expect certain version of the underlying COM dll which is not available on my PC.  Am I on the right path?  

I would appreciate help on this
Thanks

Hassan
Avatar of CarlosMu
CarlosMu

First look in the solution explorer, on the reference folder if you put a reference to the dll.  Second even thougth Dot net does not uses the regisgistry when accesing a Dcom module such module must be register on the machine.  Check if you have register those ComMoudles are registered on you machine
Avatar of gbzhhu

ASKER

Carlos,

These COM dll are on the PC and are registered, however I found out that my colleague has VB 6 sp 6 whereas I have VB 6 sp 4, so I think that could be the cause.  If this is the case the points will be yours ;-)

Hassan
I'll apreciated it but I doubt that will be the case.  

Anyhow the com dll are on the pc and they are registerd.  Now please check that you have a reference to them on your project.  On the solution explorer there is a folder call reference. There should be an entry for this dll.  Even if there is an entry, try  this.  Remove the existing entry and recreate it.  Dot net will protect you from dll hell but only where it concerns manage code.
Avatar of gbzhhu

ASKER

OK, the COM files I am talking about are Windows Common Controls 6.  My colleague just gave me all the files VS created after the migration.  Now I have two files interop.MSComctl2.dll and interop.MSComctl2.dll and Axinterop.MSComctl2.dll I am not sure what the difference is (maybe it is the OCX and the dll) anyway I removed these from my references and added the COM dll reference.  After this I had many compile errors because Axinterop.MSComctl2.dll was referenced so I had to reinclude it.  This hasn't fixed my problem.

Other ideas?

Hassan
SOLUTION
Avatar of CarlosMu
CarlosMu

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Basically your collegue is using VB6 controls in his VS.Net projects (does he know this?). I got around alot of problems by downloading VB 5.0 CCE (control creation edition) which is a free download from Microsoft. The best solution, if you have the funds, is to install VB6 on your machine...
Avatar of gbzhhu

ASKER

Yes he does. I have VB 6 on my machine.  My colleague is running XP and I am running Win2k, the other difference is that his Windows common controls 6 has (sp6) and mine (sp4) no other difference in our invironment.  I tried ot get VB 6 serivce pack 6 installed but I can't find a release, I only see betas.  
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Bob Learned
Yes, you need Service Pack 5 installed.  It is the latest version.  The GUIDs are different between SP5 and SP4, and the wrapper is looking for that particular control with the right GUID.
Avatar of gbzhhu

ASKER

installed sp5, got another little problem.  I have to get past that to see if the sp5 fixed the original issue.  will come back with result
Avatar of gbzhhu

ASKER

It turns out that my colleague doesn't have any VB 6 service pack! none at all, however his components Dialog in VB shows common controls 6.0 as (sp6)

Having looked here
http://support.microsoft.com/default.aspx?scid=/servicedesks/fileversion/dllinfo.asp&SD=msdn
and entering mscomctl.ocx I found out that Office XP updated the Common Controls.  I am surprised that Microsoft didn't release the update for Visual Studio.

I am now going to install Office XP and see what happens
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial