Solved

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

Posted on 2003-10-23
12
971 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
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
 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

695 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