473,396 Members | 1,879 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Error switching mfc to mixed mode

I have an existing MFC program consisting of an EXE and one DLL that I am
trying to convert into a mixed mode program. I am using Visual Studio.NET
2003 Professional and I am compiling in the IDE. I set the "Use Managed
Extensions" option to Yes in Configuration Properties General, added the
#using <mscorlib.dll> line to the StdAfx.h and attempted to compile. I
received the following error:

/RTC1 and /clr command-line options are incompatible

The documentation on the /clr Use Managed Extensions switch states that
selecting the /clr option will turn off /RTC automatically and the
Configuration Properties/C C++/Command Line window shows that it has been
removed, but I still get the above error. In Configuration Properties/C
C++/Code Generation, Smaller Type Check is set to "No" and Basic Runtime
Checks is set to "Default". Basic Runtime Checks doesn't seem to have a
disabled or off option with the closest being what it is set to or "Inherit
from project defaults" which when selected reselects "Default". How can I
get rid of this error message?
Nov 17 '05 #1
4 1147
I had this same problem when trying to compile a third party MFC dll using /clr. After a few hours of frantic clicking around and much cursing, I finally figured out that the project itself was not using Run-Time Checks, but each file had that option set individually. In other words, turning Run-Time Checks off for the project does not necessarily turn them off for each file.

Right click a code file in Solution Explorer and select the Properties. Then go to "Code Generation" under the C\C++ node and check the "Basic Runtime Checks" property. I'm betting it will indicate that Run-Time Checks are on for at least one of the files.

Hope that helps.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/
Nov 17 '05 #2
On Tue, 15 Mar 2005 09:33:35 -0800, Anthony
<ahargan@-NOSPAM-prconline.com> wrote:
I had this same problem when trying to compile a third party MFC dll using
/clr. After a few hours of frantic clicking around and much cursing, I
finally figured out that the project itself was not using Run-Time Checks,
but each file had that option set individually. In other words, turning
Run-Time Checks off for the project does not necessarily turn them off for
each file.

Right click a code file in Solution Explorer and select the Properties.
Then go to "Code Generation" under the C\C++ node and check the "Basic
Runtime Checks" property. I'm betting it will indicate that Run-Time
Checks are on for at least one of the files.


Similarly, I've found it's often worthwhile to completely rebuild
large projects ("Solutions") some time after upgrading VS. Sometimes
the conversion makes some really strange things mutate in the build.

Last time I did it (on a solution with about 20 projects, and
thousands of files), it took a couple of days. But afterwards I found
working with VS7.1 (NET2003) much more intuitive (considering all its
idiosyncracies), and I also found mistakes I had made in the
configuration for VS6.

I also found lots of dead files that could be deleted and removed from
source control, which made the whole thing seem a bit more organized.

Software development is the only place I regularly retain any
semblance of organization.

--
Sev
Nov 17 '05 #3
Thank you. That solved the problem with the /RTC error messages.

Some time ago, we upgraded from Visual Studio 6 to Visual Studio.NET 2003.
It appears that all .cpp files included in the original Visual Studio 6
projects came over with the /RTC1 flag set. We have a huge number of these
files. Do you know of any way to automate the resetting of this flag on
..Cpp files to "default"?
"Anthony" <ahargan@-NOSPAM-prconline.com> wrote in message
news:eE**************@tk2msftngp13.phx.gbl...
I had this same problem when trying to compile a third party MFC dll using
/clr. After a few hours of frantic clicking around and much cursing, I
finally figured out that the project itself was not using Run-Time Checks,
but each file had that option set individually. In other words, turning
Run-Time Checks off for the project does not necessarily turn them off for
each file.

Right click a code file in Solution Explorer and select the Properties.
Then go to "Code Generation" under the C\C++ node and check the "Basic
Runtime Checks" property. I'm betting it will indicate that Run-Time
Checks are on for at least one of the files.

Hope that helps.

---
Posted using Wimdows.net Newsgroups - http://www.wimdows.net/newsgroups/

Nov 17 '05 #4
Hi,

I've noticed that the settings of each code file is stored in the
parent project settings file "YourProject.vcproj" in standard XML
format.

"Basic Runtime Checks" property appears like this in the .vcproj file
:

<VisualStudioProject>
<Files>
<Filter Name="Source Files" ...>
<File RelativePath="YourCode1.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Nov 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Mike Kamzyuk | last post by:
Hello all. Basically, I need to call a mixed-mode dll's function (which uses managed code) from a native or mixed-mode dll function (which does not use managed code). I'm wondering if this could...
7
by: Neil Ginsberg | last post by:
I have a strange situation where one or more landscape reports that I created in A2000 sometimes come up in portrait mode when opened on an A2002 machine. This phenomenon is intermittent, and most...
0
by: Edward Diener | last post by:
I have some questions about the instructions for creating a mixed mode DLL in the MSDN topic "Converting Managed Extensions for C++ Projects from Pure Intermediate Language to Mixed Mode" in the...
9
by: Edward Diener | last post by:
I received no answers about this the first time I posted, so I will try again. My inability to decipher an MSDN topic may find others who have the same inability and someone who can decipher and...
8
by: Bern McCarty | last post by:
Is it at all possible to leverage mixed-mode assemblies from AppDomains other than the default AppDomain? Is there any means at all of doing this? Mixed-mode is incredibly convenient, but if I...
8
by: Nadav | last post by:
Hi, I am writing a performence critical application, this require me to stick to unmanaged C++ as performance is much better using unmanaged C++ ( about 33% better ), Still, I am trying to avoid...
4
by: tripwater | last post by:
Hello, I am currently trying to learn VS, using C#. I have a book called Beginning C# Databases. I am using sqlserver and the first half of the book deals with windows apps. So it uses the windows...
2
by: Ben Harper | last post by:
I'm trying to load an assembly of mine from a C# webforms page, but IIS fails to load the page because of failed dependencies. My problem is that I cannot for the life of me discover the dependency...
4
by: Lonewolf | last post by:
hi, I'm still in the process of transiting from MFC/VC6 to vs2005, and a lot of things are very alien to me. So hope you could bear with me if my question sounds stupid. Basically I have native...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.