Solved

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

Posted on 2003-10-23
12
957 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:gbzhhu
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 6

Expert Comment

by:CarlosMu
ID: 9608451
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
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 9615172
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
0
 
LVL 6

Expert Comment

by:CarlosMu
ID: 9615745
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.
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 9616205
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
0
 
LVL 6

Assisted Solution

by:CarlosMu
CarlosMu earned 250 total points
ID: 9616636
No, sorry,  Maybe someone else.
0
 
LVL 1

Expert Comment

by:LastResort
ID: 9620392
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...
0
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 
LVL 12

Author Comment

by:gbzhhu
ID: 9622304
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.  
0
 
LVL 1

Accepted Solution

by:
LastResort earned 100 total points
ID: 9624295
I think but can't prove that sp5 (http://msdn.microsoft.com/vstudio/previous/vs6/downloads/default.aspx) it the latest for VB6. The windows common controls should be updated with this. If you get everyone on the same version it would also rule that out of the problem space.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 9629982
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.
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 9632993
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
0
 
LVL 12

Author Comment

by:gbzhhu
ID: 9635437
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
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 150 total points
ID: 10224286
No comment has been added lately, so it's time to clean up this TA.
I will leave the following recommendation for this question in the Cleanup topic area:

Split: CarlosMu {http:#9608451} & TheLearnedOne {http:#9629982}

Please leave any comments here within the next seven days.
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

TheLearnedOne
EE Cleanup Volunteer
0

Featured Post

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now