|
MFC?
Silence is the voice of complicity.
Strange women lying in ponds distributing swords is no basis for a system of government. -- monty python
Might I suggest that the universe was always the size of the cosmos. It is just that at one point the cosmos was the size of a marble. -- Colin Angus Mackay
|
|
|
|
|
(now my ignorance will become evident)
I've just created an MFC solution in VS05, but wasn't sure what to choose for the project settings so I used the defaults. I'm not seeing how to interact with the main form. Can I use the graphical form designer with this type of project?
|
|
|
|
|
yes
Silence is the voice of complicity.
Strange women lying in ponds distributing swords is no basis for a system of government. -- monty python
Might I suggest that the universe was always the size of the cosmos. It is just that at one point the cosmos was the size of a marble. -- Colin Angus Mackay
|
|
|
|
|
Could you elaborate on how to do so? When I try to add a form, it wants to add support for CLR, which means .NET framework, if I'm not mistaken..
|
|
|
|
|
Ah! It's called a dialog here. I've added a Dialog and can design willy nilly. Sweet.
|
|
|
|
|
You have two options with MFC. You can create a dialog based application or a SDI/MDI application using CFormView.
A dialog based application generally does not have a menu or toolbar. What you get is a dialog box (WinForm in the .Net world), that you can drag and drop your controls into and then write the code behind it to do what you want.
If you want menus and toolbar, then I would go with either an MDI or SDI application. This is more like windows notepad and Visual Studio. Visual Studio is an MDI (multi-document application) and SDI is like notepade (single document interface).
When creating a SDI/MDI applicaiton, the last page of the application wizard lets you choose what type of view you want. If you want to be able to display some control, like buttons, lables, edit control...., you would want to change the view class from CView to CFormView.
Let me also add that jumping into something like this without doing some homework could turnout to be somewhat overwhelming.
Good luck,
AliR.
Visual C++ MVP
|
|
|
|
|
Overwhelming indeed. I've decided to forget the GUI for now until I get my C++ logic and syntax down. So far I've successfully made a custom class that performs a WMI query to some info I need. I'm now working on figuring out some datatyping issues I'm running into that I never ran into in C#.
Thanks for the advice, I'll certainly put it to use when I get to adding a GUI.
|
|
|
|
|
alanteigne wrote: How should I go about creating a Form based GUI app for my circumstances?
You can't.
Its that simple. Forms are .NET. Period.
To create an unmanaged GUI, you need a different Framework than Windows Forms.
MFC was mentioned, WTL is also an option.
Also, you could try using other frameworks:
wxWidgets[^]
Qt[^]
come to mind.
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
As others said MFC, QT, etc are common... if your application is really trivial (maybe one dialog and a few interactive controls) you can also do plain Win32. The advantage is that you don't have to learn a whole framework like MFC and get really slim code... search for "win32 tutorial".
Hope it helps.
|
|
|
|
|
Hello all. I have this application that was built with VC6. Now I am migrating it to VC8, and as it compiled perfectly, it is not running. It is a dialog-based app, but when I call CDialog's DoModal, it fails miserably (returns -1) without even calling OnInitDialog.
Now, I already checked for the resources and they all seem to be alright. Any reason why it is failing, any clue?
Thanks in advance.
[EDIT]
So I finally managed to set up the (remote) debug environment. It is failing while calling CreateDlgIndirect .
I'm calling GetLastError and it is returning error 1408, whose translation would be something like: "invalid window, it belongs to another subprocess". What the...?
[/EDIT]
Regards,
FG.
Stupidity is an International Association - Enrique Jardiel Poncela
modified on Thursday, February 21, 2008 5:15 PM
|
|
|
|
|
Fernando A. Gomez F. wrote: ...it fails miserably
Which means what?
Fernando A. Gomez F. wrote: ...without even calling OnInitDialog
How are you verifying this?
Does it work if you add the DS_NOFAILCREATE style to the dialog template?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Nope, it is still failing...
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
And what about the debugger?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
What about stepping into DoModal() in the debugger to see why it's failing?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hehe, yes, I'm trying that, but I don't have yet the environment setup in my machine (the app needs several components to work) thus I could only debug it in a remote way; still, at the time, I don't have access to the server and I can update the program only with a ridiculous tool which uploads it via FTP...
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
Fernando A. Gomez F. wrote: I don't have yet the environment setup in my machine (the app needs several components to work) thus I could only debug it in a remote way
I'd work on that part ... debugging-by-guessing sucks hehe.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
It's failing while calling CreateDlgIndirect, it seems it's throwing an exception. I'll post more details as I get them.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
It would not happen to be using a Rich Edit control in the dialog, or an ActiveX control, would it? The dialog aborts if any of its controls fails to create.
Peace!
-=- James Please rate this message - let me know if I helped or not!<hr></hr> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
That's what I was hoping to uncover. Based on his response, I'm guessing that's not the problem.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Nope, no rich edit or ActiveX, only common controls. I was wondering, could it be that the server had different versions of the MFC dll? Mmm... I'll try linking statically to see what happens...
Regards,
FG.
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
Have you tried to set a break point in DoDataExchange to see if it reaches that method, and if it break in there?
AliR.
Visual C++ MVP
|
|
|
|
|
Yep, but it doesn't. Not even the OnInitDialog method.
I'm setting up the debugging environment to see where exactly is failing. Man, this will be one of those nights...
Stupidity is an International Association - Enrique Jardiel Poncela
|
|
|
|
|
What is the difference between Visual C++ 2008 free download version and Visual C++ 2008 paid version?
What is the price of the paid version? How to get the paid version?
|
|
|
|
|
Anthony Appleyard wrote: What is the difference between Visual C++ 2008 free download version and Visual C++ 2008 paid version?
One difference is the lack of MFC (and maybe ATL).
I think the price for MSDN Pro is $1,199.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|