?
Solved

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

Posted on 2003-10-23
12
Medium Priority
?
973 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
Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

 
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 750 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 300 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 450 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

Question has a verified solution.

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

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
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…
Suggested Courses

762 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