![]() |
| | #1 |
| Super Moderator Join Date: Aug 2001
Posts: 7,817
| If you must port to .NET 2005, read this thread. , I finally found some info on porting apps from previous versions of MSVC to the current .NET 2005.Many of the articles failed to address the main issue which is an incorrect build environment. I falsely assumed that clicking on the old MSVC 6 IDE file and allowing 2005 to convert it would work. However, this does not work. Follow these steps and you should be ok. First define this in your C/C++ pre-processor settings to ensure you don't get complaints from the MS gods about the C/C++ standard library functions being deprecated. They are attempting to force you to use their own custom versions of the self-same files that, probably, only run better on Windows and have next to nothing to do with pure C/C++. To get rid of all that deprecated crap define: _CRT_SECURE_NO_DEPRECATE This essentially will get your compiler environment back to normal and out of what Bill thinks is best mode. We all know Bill doesn't always know what's best nor do his cronies. In order to ensure a successful port I recommend doing the following:
This should create a valid project that should run with no problem. The manifest created should work as generated. I did all of this and finally after about a day of messing with 2005, my editor application now works correctly and calls out correctly to my DirectX engine DLL. There are other ways to do this, but so far this seems to be the easiest. I don't like having multiple copies of all these dlls every time I create a project, but the other methods are just a giant mess. Porting, any way you slice it, is an exercise in frustration and get's worse when you are using DLLs and porting them as well. So far I've had to re-build the DLLs inside of MSVC 2005 in order to get them to work correctly. This is directly stated in the documentation. You MUST rebuild any DLLs or LIBs inside of 2005 if your 2005 application depends on them. You can use the depends.exe utility in the bin folder of your visualstudio/vc folder. The STL in 2005 will also still complain about DLL-interfaces when using any of it's classes. There are several documents on the web about this, but based on my research these warnings are simply an annoyance. There are work-arounds but all have drawbacks and side-effects. I would simply use #pragma to turn this warning off. Note that there are times when this warning will lead to a build error so shutting it off may suppress vital information, but only in certain cases. You can build your project without using CLR or the common language runtime by specifying this in the project properties. There is a combo box in Project properties->Configuration->General->Common Language Runtime Support. This should keep you in the world of ISO C/C++ rather than MS's bloated extensions to C++. This has been a major headache and I pity the poor fella out there that has to port thousands of lines or even millions of lines of code to .NET 2005. In order to deploy this application correctly I recommend following the guidelines and examples provided in the help file under Setup and Deployment. The famous MSVCRT.DLL is no longer used by MSVC and is now considered a system level dll that only the operating system will use. Don't ask me why. I'm not totally impressed with 2005's IDE and it seems they've taken all the good things from 6.0 out and replaced them with completely assinine methods of doing the same operation. I can't wait to try to distribute my tools and game code to my dev team. That's a disaster just waiting to happen right now. Last edited by Bubba; 05-08-2006 at 02:00 AM. |
| Bubba is offline | |
| | #2 |
| ∞ Join Date: May 2005
Posts: 970
| Wow, thanks for putting that much effort into this thread. Just wondering, what exactly made you start using .net 2005? I'm guessing it has more to do with alleviating the feeling that you are too old school than anything else? That's the only real motivation I have for even considering switching, but I've done the free visual studio online thing and decided to give it a go (what you've just posted will help me *very much*). Thanks again! EDIT: As with other stuff Bubba has posted, I think this is certainly worth making into a sticky...somewhere.
__________________ argus triad mingus Last edited by BobMcGee123; 05-08-2006 at 11:36 AM. |
| BobMcGee123 is offline | |
| | #3 |
| Super Moderator Join Date: Aug 2001
Posts: 7,817
| As an update to this thread I have one more recommendation to make regarding porting. I would highly recommend building a new project from scratch inside of 2005 and then slowly adding your own source files back into the project. This will ensure a correct manifest is auto-generated by the IDE and that it will correctly link with VC80/VC80D.dll, etc, etc. The other method I mentioned requires a lot of voodoo magic to get it working and you end up with a mess of files to include the VC libs. By creating a new project, all references to MSVCRT.DLL are gone or never created. This ensures a flawless compilation and link process. I've tried converting old projects and it just doesn't work right. Enjoy. If you have any questions regarding porting to 2005 I'll be happy to answer them, provided I have the knowledge to do so. BTW: If your controls are not themed when you run your application, your manifest is incorrect. Check your project options. |
| Bubba is offline | |
| | #4 |
| /*enjoy*/ Join Date: Apr 2004
Posts: 159
| Thaaaaaaaaaank You |
| enjoy is offline | |
![]() |
| Thread Tools | |
| Display Modes | |
|
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Read from 15-pin port | C_ntua | C Programming | 23 | 07-11-2008 09:09 AM |
| Warning to all those wishing to port to .NET 2005 | Bubba | General Discussions | 6 | 05-07-2006 09:29 PM |
| Serial port woes (visual C++ .NET 2003) | RancidWannaRiot | Windows Programming | 1 | 11-21-2005 08:59 AM |
| I heard visual studio C# 2005 can make .net 1.1 | Rune Hunter | C# Programming | 29 | 10-24-2005 07:00 PM |
| Visual J# | mfc2themax | A Brief History of Cprogramming.com | 0 | 10-08-2001 02:41 PM |