|
Did you ensure that, the project contains the manifest file? All other controls in the Window are enabled with Visual Styles?
-Sarath.
Rate the answers and close your posts if it's answered
|
|
|
|
|
Thank you for replaying the post, I just use the Visual Studio wizard to create the Dialog and again the Other buttons and controls lies on their own style and this happens only to new controls , I tested this experience for several times and the result was the same. I wonder if others had the same problem or not.
|
|
|
|
|
i met the same problem. At first,I deleted all features in mfc wizard because i draw all window by myself,but at last i found i need a dialog.I used ::InitCommonControlsEx() and it returned TRUE.
OK,this function did not work probably as it said on msdn,all controls on the dialog looks like old win98 style.I also modified the manifest file to enable xp style,but this style only appears in xp OS.
i dont why the ::InitCommonControlsEx() returned TRUE but it didnt do anything i could see.
|
|
|
|
|
Hy everyone ! What is the best way to send an mail through MFC application ? I study some methods , but I wish to send an mail whitout default mail settings ... is imposible ?
|
|
|
|
|
|
|
That's why I said "If you can afford it" and then added that you can search for SMTP code here on code project (or through Google.)
|
|
|
|
|
Sorry , I understand that .. my mistake !
|
|
|
|
|
|
Yes , it will help , that's what I'm looking for ... thanks !
|
|
|
|
|
Happy coding! Let me know if you have further questions.
|
|
|
|
|
hi,
for(int i = 0;i < n; i++)
{
try
{
//.........
}
catch(exception e)
{
//........
}
}
In tha above code,in catch block im printing some error message after the for loop terminated.my problem is when the for loop get terminates,im having the last error message only(the catch is called 2 times,so i need to display 2 error messages)...
pls help me...
|
|
|
|
|
Gomathy_84 wrote: im printing some error message after the for loop terminated
What do you mean by printing exactly ? Print on the console with printf ?
Furthermore, you don't print after the for loop is terminated but in the loop itself.
|
|
|
|
|
From what I understand, you're collecting error message inside the catch block and then displaying it after the loop terminates.
If so you will need to collect multiple strings.
You can do this using a vector of strings.
std::vector<std:string> vstrErrors;
try
{
}
catch(std::exception e)
{
vstrErrors.push_back(e.what());
}
|
|
|
|
|
Yes...ThankYou so much
|
|
|
|
|
here,im having seperate exception class like connectionException class.I derived it from std::exception.
In the place of throw ..i wrote as throw connectionException(...some error message).
In the place of Catch...how to catch my class exception and covert into std::exception???
Thanx.
|
|
|
|
|
This should do it.
This is the C++ concept of "a base class object can reference a derived class object".
catch (connectionException& ce)
{
std::exception& e = ce;
}
|
|
|
|
|
In general it's best to catch exceptions by reference, generally a const reference.
try
{
}
catch (const exception &e)
{
}
Steve
|
|
|
|
|
Dear Exprets,
I am not a fresher, But would like to refresh my C++ skills and learn
more concepts towards desing. I am also attending few interviews now a days.
I am not just looking for interview question / FAQs.
Can any one advice a good book/ resource for me please
Many thanks in advance !
|
|
|
|
|
For MFC: "MFC Internals".
For C++ and STL ) : "Effective ++", "More Effective C++", "C++ Gotchas", "Effective STL", "Exceptional C++", ...
Added :
"Large-Scale C++ Software Design", "Code Complete", "The Pragmatic Programmer"
Watched code never compiles.
|
|
|
|
|
I could add "Programming Windows with MFC by Jeff Prosise".
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
|
I would look for books about .NET/Winforms/WPF instead of MFC.
And then look for books about integrating unmanaged C++ with managed .NET. (IJW/CLI/Interop)
MFC have become like Cobol on the mainframe. It is something you maintain and integrate with. But any new development should work towards .NET/Java.
|
|
|
|
|
My project is about MDI with Multi-Document.
In each document has it own menu and toolbar, it mean that the menu and toolbar must change according to activate child windows.
For the menu,I use code below within InitInstance function to add document template then the menu (IDR_MSESoftTYPE and IDR_RECEIPT) can change according to activate child windows, so the menu already work fine.
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(IDR_MSESoftTYPE,
RUNTIME_CLASS(CMSESoftDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CMSESoftView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
pDocTemplate = new CMultiDocTemplate(IDR_RECEIPT,
RUNTIME_CLASS(CReceiptDoc),
RUNTIME_CLASS(CReceiptFrame),
RUNTIME_CLASS(CReceiptView));
if (!pDocTemplate)
return FALSE;
AddDocTemplate(pDocTemplate);
*
*
*
What about the toolbar how can I make it like menu.
Thanks
|
|
|
|
|
I can think of one "simple" solution:
Don't have any main frame toolbars - but have them inside the childframe.
You could also swap main toolbars in the childframes activate code, but that would be more fragile...
I'd go for the first idea if I was you.
Iain.
I have now moved to Sweden for love (awwww).
|
|
|
|