Solved

upgrading vb6 - warning MSB3287: Cannot load type library for reference

Posted on 2014-03-27
8
584 Views
Last Modified: 2014-03-29
In the anticipation that we will eventually be forced off our 32-bit systems onto 64-bit ones, I am going to make a start on converting and upgrading some VB6 code.

I can open up the old VB6 projects using VS2005, and get a compile/build under way – so far, so good.

Naturally, a fairly lengthy list of errors resulted. Most I have been able to fix, but there are a few I am stuck on. The first is the error message

C:\Windows\Microsoft.NET\Framework\v2.0.50727\Microsoft.Common.targets : warning MSB3287: Cannot load type library for reference "AxMSMAPI". Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED))


I have found MSMAPI.DLL on the c:\ drive as part of the VB6 install package, and copied it to c:\windows\system32. I have tried to register it, but it fails:
0
Comment
Question by:AlHal2
  • 4
  • 2
  • 2
8 Comments
 

Author Comment

by:AlHal2
ID: 39958537
The program  sucks data out of a database and uses it to build an input file. It uses some hideously complicated logic to query locale settings and automatically adjust time-stamps for different time zones. That latter bit seems to cause most of the troubles.
0
 
LVL 2

Expert Comment

by:graber
ID: 39958920
Sorry Al this is going to be a tedious process that will drive you to drink if your not careful.  I've warned many business a type that the longer they wait  to migrate the uglier it will get. I've had to do it on a couple of occasions and it always stunk.  Are you getting a general area where the error is occuring? How may lines of code are we looking at?
0
 

Author Comment

by:AlHal2
ID: 39959174
I'm asking this question on someone else's behalf and am waiting for their response.
0
 
LVL 40
ID: 39959778
I have seen a lot of projects where programmers tried to convert a VB6 application to VB.NET. They almost all fail. Most of these projects were scrapped after a few weeks or a few months, after the programmers found out that a rewrite is most often the best solution.

The converter does what it can, but there are too many differences, specially in the design of applications. You will end up with a program that lacks performance, is hard to maintain, and does not show you how to program in .NET. You will end up with something that is neither VB6, neither .NET.

As grabber said, waiting 12 years before upgrading development tools and paradigms is "forbidden" in computer sciences.

And you seem to be falling in the net a second time. Why move from old to old. VS2005 is already 9 years old, and was not designed for 64-bit. Any testing that you do in there might blow in your face when you will really make the move.

If you absolutely want to go for a straight conversion, at least do it in a recent version of Visual Studio. If the problem is one of money, the Express edition is free from Microsoft, and will do everything than the bigger editions do for somebody who comes from VB6 and does not need the extra tools provided with the Professional or higher edition.
0
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 
LVL 2

Expert Comment

by:graber
ID: 39960040
That is pretty much my take as well. There are so many structural changes between the two that finding a transition from one source to another that it is just better to use the origninal as a template for design. Sorry.
0
 

Author Comment

by:AlHal2
ID: 39961111
Do you have some vb.Net code to query locale settings and automatically adjust time-stamps for different time zones.
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 250 total points
ID: 39962003
Once you have the date loaded in a variable (let's call it d), and assuming that the time zone is set properly in the configuration panel, you can use the following:

d.ToLocalTime        'From UTC to local
d.ToUniversalTime 'From local to UTC

This gives you one of the reasons why direct conversions are not good. You probably had many lines of code to do that in VB6, while it's built in the framework. The converter is not able to see those things.
0
 

Author Closing Comment

by:AlHal2
ID: 39964277
thanks
0

Featured Post

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

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

19 Experts available now in Live!

Get 1:1 Help Now