Converting an unmanaged C++ project to be managed

R

Rob C

Are there any good papers/documentation around for taking
an unmanaged VC++ Project using MFC (created in VC V6) and
making it managed? My main goal here to be able to
implement new functionality in our system using C# and
being able to utilize the C# assembly from within the
existing VC++ code.

Can you mix and match like this? For example, could I
have CObject derived object create a C# assembly that
creates an OLE DB recordset and stores properties into the
CObject-derived object?

Thanks for your help.

Regards,

-Rob
 
P

Pent

Are there any good papers/documentation around for taking
an unmanaged VC++ Project using MFC (created in VC V6) and
making it managed?

http://msdn.microsoft.com/library/en-us/vcmex/html/vcoriMigratingYourApplications.asp
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcManExMigrationGuidePart1_Start.asp
in VS.NET install dir, Vc7\migration_guide.doc

It's just a matter of using /clr switch and you get access to your C#
assembly and MC++ syntax.
My main goal here to be able to
implement new functionality in our system using C# and
being able to utilize the C# assembly from within the
existing VC++ code.
Can you mix and match like this?

Yes
 
R

Rob C

Thanks for your response.

I looked at the document and it states to set the /clr
option. When I do this I get a build error:
"cl : Command line error D2016 : '/RTC1' and '/clr'
command-line options are incompatible"

I can't seem to find which setting to uncheck to disable
this setting.

Also, once I do this, what will I have to distribute with
my app for the .NET runtime?

Regards,

-Rob
 
R

Rob C

Under Project Properties/Code Generation, it does not let
me deselect this option. The possible values
are "default", "Stack Frames (/RTCs)", "Uninitialized
Variables (/RTCu)" and "Both (/RTC1, equiv. to /RTCsu)".
All of these selections generate that same error. Is
there a different porperty to set that turns off this
option?

Regards,

-Rob
 
P

Pent

use Default

Rob C said:
Under Project Properties/Code Generation, it does not let
me deselect this option. The possible values
are "default", "Stack Frames (/RTCs)", "Uninitialized
Variables (/RTCu)" and "Both (/RTC1, equiv. to /RTCsu)".
All of these selections generate that same error. Is
there a different porperty to set that turns off this
option?

Regards,

-Rob
 
P

Pent

use Default

Rob C said:
Under Project Properties/Code Generation, it does not let
me deselect this option. The possible values
are "default", "Stack Frames (/RTCs)", "Uninitialized
Variables (/RTCu)" and "Both (/RTC1, equiv. to /RTCsu)".
All of these selections generate that same error. Is
there a different porperty to set that turns off this
option?

Regards,

-Rob
 
R

Rob C

It actually was set to default to begin with the first
time I got the error. I tried selecting each one and
rebuilding but to no avail.

Any other thoughts?

Thanks again for your help.

Regards,

-Rob
 
P

Pent

Don't know. If this was vc6 project converted to VS.NET then maybe
conversion failed somewhere.
 
R

Rob C

This is strange... I was able to build the project as a
Release Build with the setting set to default but I still
get the error when I try to build it in Debug.

I guess its time to cash in one of my support incidents at
Microsoft.

Thanks again for your help.

Regards,

-Rob
 
P

Pent

No just do this:
Open .vcproj file from your project's directory. It's in xml format.
Find
<Configuration Name="Debug.... >
<Tool ... BasicRuntimeChecks="3" ... />

Change it to 0.
 

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