Visual c++ problem with command line conflicts

I am using Visual c++ 2013 community to write an MFC dialog based program.  I am at the point where I am introducing an MS common dialog for user support.  Now, it will not build, telling me that I need /clr support.
If I add /clr it complains that /clr and /MTd command line options are incompatible.  I am WAY beyond my expertise level when dealing with command line options.
Dave ShieldsAsked:
Who is Participating?
 
AndyAinscowFreelance programmer / ConsultantCommented:
>>I am at the point where I am introducing an MS common dialog for user support.
You have added a .net based component (according to the clr requirement in the error message).  Remove that component and use one that is not .net based.

You can run MFC and .net together but it is rather complex.
0
 
jkrCommented:
It seems that yourt dialog is .NET - so, first of all, do you actually want to integrate managed components into your C++ project? If so, you indeed need to use '/clr'. Maybe start out with https://msdn.microsoft.com/en-us/library/vstudio/ms173265%28v=vs.120%29.aspx ("How To: Migrate to /clr") and https://msdn.microsoft.com/en-us/subscriptions/administration/06s5xsah%28v=vs.90%29.aspx ("ScribbleDotNET Sample: Extending Scribble with CLR Features") which shows how to to include new .NET functionality in your project.

And, to the '/MTd and /clr options are incompatible' thing - can your try and build your application with shared MFC libraries (or '/MDd')? Go to your Project Properties (ALT+F7), select "Configuration Properties|C/C++|Code Generation" and change "Runtime Library" to "Multithreaded Debug DLL" - "DLL" is the important part here.
0
 
Karrtik IyerSoftware ArchitectCommented:
Is it possible for your to attach your test program that you are trying to build and run using MS VS 2013?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
sarabandeCommented:
>>Remove that component and use one that is not .net based.

which common dialog did you use? it is a good chance that mfc also provides a similar dialog.

Sara
0
 
sarabandeCommented:
actually the answer was given by Andy and not by me. therefore he should get the points.

Sara
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
Thanks sara
0
 
Dave ShieldsAuthor Commented:
I've answered this problem myself, by disregarding instructions that I had been following in a book from 2002.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
What did you do to solve it.
0
 
Dave ShieldsAuthor Commented:
Look, this was so hectic, trying to get an answer under a deadline, I honestly believe I solved this myself.  I do recall that I did pay attention to sara's comments, and did intereract with her so it would be appropriate if you awarded the points to her.
0
 
sarabandeCommented:
Dave, thanks. I appreciate your comment.

Eenookami, in my comment I referred to an answer given by Andy and asked for more information which was not given for the reasons Dave has elaborated.

since I added only minimal value to the answer - if at all - I recommend to close the question by accepting Andy's comment http://www.experts-exchange.com/Programming/Misc/Q_28610058.html#a40588998.

Sara
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
>>I do recall that I did pay attention to sara's comments, and did intereract with her so it would be appropriate if you awarded the points to her.

That sort of implies you ignored anyone else, including the first comment instructing you not to use that new component you added and use a different one instead.
0
 
Dave ShieldsAuthor Commented:
Andy
Can you refresh my memory on the comment that you made, as I do not remember any of your comments being on point.
Dave
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
? Just look - it is the very first comment in response to your question.
0
 
Dave ShieldsAuthor Commented:
Andy are referring to this comment
"You can run MFC and .net together but it is rather complex. "
That is probably true, but as I have stated, the crux to the solution was to abandon the book I was following, and I picked up on Sara's questions about classes, I had been adding a class to the project, which was necessary in VS2003, but was completely causing a stumbling in VS2013.  

Your comment that MFC and .net can run together was of NO help to me.  It is very generous of Sara to defer the points to you, but I don't find that fair.  Sara and I had a fairly long conversation over several days.  She gave me code to get over the first hurdle, and her questions actually led me to find the answer, by looking closely at the classes in 2003 vs 2013.  

I don't remember all the details, but I do feel that Sara's correspondence was always on point.  Truthfull I didn't understand many other posts.

Dave
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
>>Andy are referring to this comment
Actually no, that is a part of the comment.

As you seem to have real troubles with your browser I'll copy and paste the rest and more relevant part - because that is the bit Sara referred to - of it here.

You have added a .net based component (according to the clr requirement in the error message).  Remove that component and use one that is not .net based.

That seems to be precisely what you 'discovered yourself' some days later.


>>Sara and I had a fairly long conversation over several days.

Four experts made one comment each, then you closed the question without making any intermediate comment yourself.  My understanding of conversation apparently differs from yours,


>> Truthfull I didn't understand many other posts.

OK, so jkr and myself were talking in too advanced a way - if that happens just ask nicely to dumb down our level to something you can cope with.  Ignoring means you just ignore top quality advice.
0
 
Dave ShieldsAuthor Commented:
Actually by this point I was out of the woods thanks to Sara.  What I wanted to do was activate a Browse button on the dialog, by calling up a common file dialog.   I eventually found a code example online which worked smoothly.  It adds a great deal to my program.  I could NOT in my opinion do without this   A Browse button saves a lot of typing and typos.  Evntually I resorted to searching on line for the error codes associated with this addition.  As i recall, I had to make changes to 5 different items before the code would compile.

So, you see I could not take your advice even if I understood it, as the Browse feature was an essential design choice.
0
 
AndyAinscowFreelance programmer / ConsultantCommented:
deja vu:

 Remove that component and use one that is not .net based.
0
 
Dave ShieldsAuthor Commented:
Remove that component and use one that is not .net based.????????????
I originally planned on using a Microsoft common file dialog, and I did use a Microsoft common file dialog.  By finding code samples that showed me how to do it.  If the component was net based originally, I think it is still NET based.  What's your point.
     What I asked for was help in modifying the compiling switches, which you never mentioned, and which I was able to find online.

Dave
0
 
sarabandeCommented:
Force accept
probably you meant 'forced assist' ...

Sara
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.