I am newbie in VC++. I was facing the problem while executing application(.exe) build using VC8. The application was ported from VC6 to VC8. The problem I was the error:
MSVCR80.dll was not found. Re-installing the app........
I gone through many articles and found this is a rather common problem. I checked my application manifest file which was correct and refering to new MFC 8. Also checked .exe which has manifest file embeded under RT_Manifest with id 1. So nothing seems to be wrong still i was not able to run .exe. When I checked with DEPENDACY WALKER it was showing same error that he couldnt found msvcr80.dll.
After that I changed setting for linker to ignore library MSVCRT.LIb. And now the problem is no more. When I checked .EXE with Dependency Walker, I was getting MSCVR80D.dll for debug build. Also my application is able to run now.
Is it right thing whatever I have done?? Is ignoring library MSVCRT.LIb is a right option. I hope it wont create problems in future.
Try running your application in a system which does not have Visual Studio installed. (If needed the system may have .NET framework though.) If it runs well once, it will run again anywhere, provided you also distribute the dependent DLLs with your application.
That means My application wont link to default MSVCRT.lib(VER:6 for VC6). And thats why its linking to new Ver:8 according to manifest file.
But again that leaves the question that why are those policies needed in WinSxS folder. Those policies are clearly indicating that any reference to old ver should redirect to the New version.
Seems some problem with policies!
Ok, I think I should answer your question in detail.
Now, when you said you are migrating a project from VC6 to VC8, I am assuming that you have just opened the existing VC6 project file in VC8. So the linker directories were retained in the new project which was opened in VC8. This will happen if the programmer who had originally created the project had explicitly linked to MSVCRT.LIB (which is actually the c-runtime library). So the VC8 compiler was trying to link to that LIB as well! And since .lib files are not compiler independent, you got an error. I am not sure if you unlinked the older version 6 library! Please let me know.
Secondly, if the programmer had not, linked to the MSVCRT.lib explicitly, then the compiler will not look for version 6 of MSVCRT. Instead it will look for the current version i.e. version 8 of MSVCRT.lib. By the way, lining to MSVCRT.lib requires you to distribute MSVCRT80.dll with the application. Take a look at this for further details: http://msdn2.microsoft.com/en-us/library/abx4dbyh.aspx
Since, it was not present in the application directory, the error was found.
However all this is my own conjecture. I suggest it would be better if you post the buildlog.htm (that is generated in the debug folder) here in this forum so I can take a closer look.
I understood what u r trying to say. I checked my project and other dependent projects too. I found that some of my projects were linking to MSVCRT, but besides that its a correct version i.e 8 of MSVCRT is getting loaded. This I checked using DEpendancy Walker.
This is what I done while converting projects from VC6 to VC8. I copied full folders, made back-up and then used new copy. So I think its not the case 1 as u told.
>lining to MSVCRT.lib requires you to distribute MSVCRT80.dll with the application
I am not sure about this one. But I think that is why there is a manifest file. When i gone through some articles I found that manifest files are responsible for getting these dlls. Also manifest files are embeded into the appilcation(.exe). I also checked that and it was found in my .exe.
Althogh my problem has been solved using Debug build. I just want to confirm that my release build also work fine.
I'm a noobie of visual c++ and currently using vc++ express 2005.
I'm creating an application to handle data from a device connected both
on a serial port and via tcp/ip networking and been successful with the work so far.
My problem is within the application interface.
I have a mdichild which will show data send from the device within the serial port and then
do some decoding and throw it as keystokes.
Within the mdichild I put a button which when it clicked it will send the data into another
mdichild form ( which will process the data, querying, bla.. bla..bla...)
How can I acomplish this ?
The file looks like this ESIM 6 PPS01..
The Model name is PPS01..but it reads like tht it neglect first 2 characters in the name and read only "S01" if the model name is DT002 then it reads on ly "002"..
What can i do?
That is false. sizeof(int) returns 4, so you read 4 characters ! You have to make a difference between the size of an integer (always 4 bytes) and the size of the string that represents this character (can vary depending of the number of digits).
If your integer is always smaller than 10, then you can read only one char. But if you don't know how many digits it will contain, then you are in trouble. It is better to store the complete line in a buffer and then scan it for white spaces inside it (like I suggested yesterday). Or use scanf as somebody suggested you also.
hi all i had written text in event viewer and ,for that i had also written in the registry setting related to the services i.e
when i c that in rejistry sampleapp folder is created with its contents,text in the event viewer is aslo written but with the text follwing message also appear.
The description for Event ID ( 1 ) in Source ( NetBlocker ) cannot be found. The local computer may not have the necessary registry information or message DLL files to display messages from a remote computer. The following information is part of the event:
"08/10/06 10:48:50 Service Stoped",it is actual text above is the message which i want to skip.
what i m doing wrong first i created rej key and then write in event viewer which MSDN told.
You have to create a dll. That dll contains the texts for the different Event ID's you use.
(There are ways to go around the creation of the dll, I think I saw an article about that here at CP a couple of years ago).
Search for "event log" in the articles section at CP. Or have a look here.[^]
can u give me a piece of code where it shows it has written something in destructor...?
i wnat to knwo what we have to write in a destructor of base & derived class when base class destructor is virtual?
are we have to write any thing is any one of destructor?
you write a destructor to deallocate te memory allocated dynamically during the object's life (from construction to now - destruction). the fact a destructor is virtual or not is a matter of inheritence and doesn't affect what you write in the destructor body.
and to call the destructor, you don't have to do anything much. an object is automattically when the execution goes out of the scope of the object.