Solved

Converting from Visual C++ 6 to VisualStudio 2005

Posted on 2006-11-03
5
927 Views
Last Modified: 2013-12-03
Hello out there,

I converted a project in which MFC library used from Visual C++ 6.0 to VisualStudio 2005. MFC libraries are used as DLLs.
The produced exe file runs fine on the development machine and one other PC.
On other machines under WinXP I get a message that says something in german similar to "the program istn't installed correctly, please re-install".
On Windows 2000 I get the clear message that mfc80.dll is missing. After copying mfc80.dll and msvcr80.dll into the program's directory it says COREDLL.DLL not found. But this library is only for Windows CE and doesn't even exist on the machine where the program can run correctly...

Has anyone an idea?

When trying to link the project with statically MFC library, I get linker errors
>> unresolved external symbol __HUGE
because in one one file we use HUGE_VAL and
>> nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argv
>> nafxcw.lib(appcore.obj) : error LNK2001: unresolved external symbol ___argc

In the linker I specified
as additional dependencies: opengl32.lib glu32.lib winmm.lib setupapi.lib
and as ignore libs:  libc.lib,libcmt.lib

Might be someone could tell me which libraries to link aditionally.

Thank you in advance
Alexander Seebacher from Germany
0
Comment
Question by:PYTHALAB
  • 3
  • 2
5 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 200 total points
ID: 17872282
You need to install VC++ 8.0 runtime on destination computer. It can be found in VS directory:
Program Files\Microsoft Visual Studio 8\SDK\v2.0\BootStrapper\Packages\vcredist_x86\vcredist_x86.exe

If you make installation package using VS 2005 Setup project, add VC++ runtime as prerequisite.
0
 
LVL 1

Author Comment

by:PYTHALAB
ID: 17896327
Thank you so far.

This solves the first half of my problem.
I run the vcredist_x86.exe installation on a test machine and afterwards our program could run there without complaints.

For delivering first small updates of our software our manager wants us to send only the .exe files with statically linked new MFC libraries without the additional MFC 8.0 installation.
So I still have to find out how now to link with static libraries.

Best Regards
Alexander Seebacher
0
 
LVL 48

Expert Comment

by:AlexFM
ID: 17896594
When project is created, MFC can be statically linked by checking this option in ine of Wizard steps. For existing project, use Project Properties - Configuration Properties - General - Use of MFC parameter.
I am not sure that this solves the problem because program still needs VC++ Runtime library.
0
 
LVL 1

Author Comment

by:PYTHALAB
ID: 17899033
That was what I did as the very first step when creating the "Static Release" configuration in Visual Studio 2005.
But when linking, I receive the errors mentioned above.
Originally I linked the same libraries that worked perfectly in the "StaticRelease" configuration of Visual C++ 6.0
0
 
LVL 1

Author Comment

by:PYTHALAB
ID: 17939039
I accepted the answer that helped me to install the missing DLLs on target machines.

The problem of missing __argc and __argv symbols when statically linking the program is still ever present.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

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

Suggested Solutions

Title # Comments Views Activity
Vb.Net Loading Word 11 105
Need to impress with my knowledge of .NET 5 92
Need more details 5 167
Microsoft C++ code failing in executable that worked 9 108
This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
This article describes a technique for converting RTF (Rich Text Format) data to HTML and provides C++ source that does it all in just a few lines of code. Although RTF is coming to be considered a "legacy" format, it is still in common use... po…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

839 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