CLR and C ??

R

Rick

Hi guys!!

I have a very big project that originally was made in C, then it was
migrated from C to VC++ 6.0.

Now my boss is asking me to use the new VC++ .Net (2005) to change the
interface of controls and windows in the project. But i don't know if this
is possible, because i can open the VC++ 6.0 project in VS2005, but the
controls are the same than VC++ 6.0, if i try to add CLR controls, the way
the compiler takes code changes, and functionality is lost, because the
compiler says there are around 800 errors, (it's basically by keywords, but
also by references and libraries), i would like to know if someone has tried
this or at the moment i choose CLR i hve to rewrite all my C code??

PD: also i noticed that VS2005 looks for CPP files, not C files and of
course C is not C++

Regards
 
J

Jochen Kalmbach [MVP]

Hi Rick!
PD: also i noticed that VS2005 looks for CPP files, not C files and of
course C is not C++

If you compile with /clr you must use cpp files.
But why not rename your c-files to cpp. In most cases is should work...

Normally a cpp-project can be simply compiled with the /clr option
without any changes... it is just generation MSIL instead of binary-code...

In VC2005 you will just get some warnings about deprecated functions.
But you can disable these warning and forcing timt to be 32-bit by
defining the following:

- _CRT_SECURE_NO_DEPRECATE
- _CRT_NONSTDC_NO_DEPRECATE
- _USE_32BIT_TIME_T

--
Greetings
Jochen

My blog about Win32 and .NET
http://blog.kalmbachnet.de/
 
B

Bronek Kozicki

Rick said:
Now my boss is asking me to use the new VC++ .Net (2005) to change the
interface of controls and windows in the project. But i don't know if this
is possible, because i can open the VC++ 6.0 project in VS2005, but the
controls are the same than VC++ 6.0, if i try to add CLR controls, the way

take away all GUI code and rewrite it from scratch as C++/CLI. Keep
non-GUI as it is (modulo refactoring and maintenance). Do NOT add "ref "
or "value " prefixes to your old classes, but rather employ them as
members of your new (ref) classes that will handle GUI in new, .NET way


B.
 
B

Boni

There is a compier option (compile as C or CPP). Make sure that you set it
to compile as cpp.
HIH
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top