|
-
June 12th, 2002, 07:38 AM
#1
VC++ .Net
Hi all.
I have a few questions regarding .Net :
1) If I have some code that was developed in VC++ ver 6 and I use Vis C++ ver 7 (.Net) to continue developing that code. Does that code automatically become managed code?
2) If code that was developed in Vis C++ 6 doesn't get translated when I open it up in VC .Net, how do I include managed code to be used within my old code? E.g. In my code, unmanaged.cpp, how do I do I use managed code? I tried
Code:
#include "MangedCode.h"
......
// Unmanaged code
and I get the following error message
fatal error C1190: managed targeted code requires '#using <mscorlib.dll>' and '/clr' option
This code is complaining that in ManagedCode.h I have the following line
#using <mscorlib.dll>
and without it in my managed code, it will give me alsorts of errors!
3) Do I have to compile my unmanaged code with /clr?
Regards
John
-
June 23rd, 2002, 10:47 AM
#2
No offence, but to switch languages in the middle of a project is bad a software engineering practice. But, if you incist, I would go with Unmanaged C++, that way you can maintain most of your code, without modifications. Otherwise do a redisign and start over.
If you really want to change your code to managed C++. Add a "__gc" to the beginning of your class definition. Use "using namespace System;" for your namespace, and that should work.
Last edited by zerodefe; June 23rd, 2002 at 10:52 AM.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|