|
by default, MFC dialog app has a set of code to draw icon: which has a small (16x16) and a large (32x32) icons.
the "small icon" displayed at top-left conner (sys-menu) and min-state (on Windows-start-bar) is not the small-icon of resource, it is resized by 32x32 icon, so it looks very ugly - resizing causes visual problem.
How to display "small icon" with true resource small icon?
|
|
|
|
|
includeh10 wrote: How to display "small icon" with true resource small icon?
Check your icon in the resource editor. There should be a 32x32 and a 16x16 version in the resource. If it only has a 32x32 version then you will need to create the alternate yourself.
|
|
|
|
|
In addition to what Richard said you have to use the LoadImage() API to specifically load and set the smaller icon. The AfxGetApp()->LoadIcon() code supplied by the MFC wizard will only load the 32x32 icon resource.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
I want to develop an application with some kind of grid like the one in Excel. I'm using wxWidgets and there's support for the Doc/View-architecture. How many of you out there are using this for c++-applications? Are there better alternatives? It's a MDI-application with very few dialogs. If that matters.
|
|
|
|
|
Doc/View is not a good design - mu opnion.
But if you use MFC, you should use Doc/View, or may have trouble.
|
|
|
|
|
How come you think it's a bad design?
|
|
|
|
|
The answer really depends on whether it is reasonably easy for you to develop your application using it, and whether it will satisfy your needs, in terms of finished product. And if you really want MDI then Doc/View is probably your best option. I have used it in the past and found it produces very usable programs.
|
|
|
|
|
Doc/View is probably not quite as good as MVC (it's ambiguous where UI commands should be handled) as used and promoted in Qt[^], but all of these architectural styles rely on your detailed design and implementation not violating the qualities implicit in thm.
So, in the case of DocView, make sure the Doc class is entirely unaware of any of the views. It should provide methods sufficient for the view to display the document and modify the document, should you choose to handle the UI commands outside the document class.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
thank your for your informative reply. But MVC is not used in C++ is it? I thought it was for web applications only. Do you know of any documents that describe the Doc/View architecture in a way that's not MFC/wxWidgets-specific?
|
|
|
|
|
Jan Sommer wrote: MVC is not used in C++ is it?
It's not language specific - no architectural design patterns are, really, apart from those low-level design patterns that are more about getting around deficiencies in some languages.
DocView (IMO) is basically a Microsoft derivation (and simplification, which loses some of the purity) of MVC. Have a look at the Wikipedia page on MVC[^] - although it talks a lot about web stuff, the history section shows that it is definitely NOT web specific. I don't really know of any Document/View documentation that isn't MFC/wxWidgets related.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Jan Sommer wrote: Do you know of any documents that describe the Doc/View architecture in a way that's not MFC/wxWidgets-specific?
I don't know of any specific documents, but I would expect that MSDN contains a lot of the information you need to utilize the Doc/View architecture, including sample code.
|
|
|
|
|
Hi all,
I have migrated my application(vs-2003 developed) into vs-2008 to be worked on vista machine.I got the .exe and working successfully when i enter a valid username and valid password but fails when i enter a wrong password/username......I am using SYBASE for my aplication,so it comunicates with some SYBASE dlls to get the access.
the code looks like below
(I am providing login details from other dialog)
int DBInterface::LoginSequence (BOOL bFirstLogin)
{
CString user_name;
char dbver[16];
CString srvrname, dbname;
char uname[33];
char upwd[33];
UINT msg;
if (bFirstLogin)
{
dbinit ();
dbsetlogintime (8);
dbmsghandle ((MHANDLEFUNC) msghandle);
dberrhandle ((EHANDLEFUNC) errhandle);
}
int rv = 0;
while (Ops.m_bAutologin && bFirstLogin)
{
if (CSD_DdeReqUserName (uname) == 0)
break;
if (CSD_DdeReqUserPassword (upwd) == 0)
break;
srvrname = App.GetProfileString (INI_SEC, _T("DBServer"), "");
if (srvrname.IsEmpty ())
break;
dbname = App.GetProfileString (INI_SEC, _T("DBDatabase"), "");
if (dbname.IsEmpty ())
break;
strcpy (_loginfo.dbid, uname);
strcpy (_loginfo.dbpwd, upwd);
strcpy (_loginfo.dbsrv, srvrname);
strcpy (_loginfo.dbdb, dbname);
_dbproc = dbConnect (&_loginfo, "Phoenix");
if (_dbproc == NULL)
break;
rv = 1;
TRACE0("Phoenix: successfully logged in using LOGPARMS from anotherapp...\n");
break;
}
CLoginDlg dlg;
while (rv == 0)
{
if (dlg.DoModal() != IDOK)
{
PostQuitMessage(0);
return 0;
}
else {
lstrcpyn(_loginfo.dbpwd, dlg.m_csPassword, 31);
lstrcpyn(_loginfo.dbid, dlg.m_csUser, 31);
lstrcpyn(_loginfo.dbsrv, dlg.m_csServer, 31);
lstrcpyn(_loginfo.dbdb, dlg.m_csDatabase, 31);
}
_dbproc = dbConnect (&_loginfo, _T("Phoenix") );
if (_dbproc != NULL)
break;
msg = (::GetKeyState (VK_CAPITAL) & 0x0001) ?DS_ERR_LOGINFAILEDCAPS : IDS_ERR_LOGINFAILED;
if (AfxMessageBox (msg, MB_OKCANCEL | MB_ICONHAND) == IDCANCEL)
{
PostQuitMessage(0);
return 0;
}
}
In the abobe code from dbconnect()(bold code) it is calling some SYBASE dll and it is not getting the return value when i enter wrong password/username.......
Is there any problem with the dll or anyting else?????
Since i have migrated the code i am thinking that the dll is not compatiable,but this is just an assumption....!
So can anybody help me to solve this issue......
Thaks in advance.
modified on Saturday, October 3, 2009 8:48 AM
|
|
|
|
|
|
GetCurrentHwProfile()
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
How can I change the text color of an edit control? I want it to change to red when its contents aren't correct.
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
See CWnd::OnCtlColor [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
How do I trigger this message to be sent? Should the code be something like
bool m_bRedColorFlag [= false];
...
void OnCtlColor()
{
if (m_bRedColorFlag){
}
else {
}
}
...
m_bRedColorFlag = true;
GetDlgItem(IDC_EDIT)->InvalidateRect(NULL);
There is sufficient light for those who desire to see, and there is sufficient darkness for those of a contrary disposition.
Blaise Pascal
|
|
|
|
|
Hi Friends,
I made a desktop and audio(mike) capture GRF in graphedit.
On some systems audio recording stops after 30 sec but video recording has no issue.
I did all things in source code(c++ application) tracked IMediaEvent, but as audio recording stopeed in between no error event is fired.
Note: problem occur only on some laptop pc till now it has not occured in any desktop PC
Laptop "qasf.dll" version is 10.0.03802
I tried with differnt versions of same dll but all in vain on the laptop.
System configuartion is below:
RAM - 1790MB
CPU - Intel(R) Core (TM)2 duo CPU 1.83Ghz(2 CPU)
GRF file is stored at below link
http://www.fileflyer.com/view/uiqJXB1[^]
Thanks,
Subhash
|
|
|
|
|
What controls the hovering expansion of MFC menus?
Or what controls which choices are shown before hovering on the little arrow to expand the rest of the menu?
A. The feature is called Personalized Menu Behavior.
The wizard code for it is in CMainFrame::OnCreate()
modified on Friday, October 9, 2009 6:48 PM
|
|
|
|
|
See here[^]
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks. Really though I know this is a stupid question or maybe its just me but I haven't been able to find it in the help because I can't think what the feature is called to be able to search for it in the MFC docs or code. When I google "Menu Expansion" I get 7500 hits that all seem to have to do with web development, java, of C#.
|
|
|
|
|
It's all right there in the help. There is a link to a sub page about menu programming considerations which has a section on menu messages, creating menus and modifying menus. It really is too big a topic to fully explain in a forum post.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Personalized Menu Behavior
|
|
|
|
|
Hello,
I'm new to C++. I grasp it, having read through a number of articles and chapters of books
and done a bunch of console examples.
I have my Visual C++ and the latest Windows SDK for Windows 7.
So, I want to skip ahead and start creating simple GUI's using png, jpeg or gif files as well as vector drawing.
So, If anyone can offer some guidance, I will appreciate it.
What is the most CPU efficient, smallest file size method to create a GUI incorporating png files? Cross platform or windows. A WYSIWYG editor would be nice, but most important to me is to have solid, professional code, so I want to focus my research on methods that develop good GUI's, even if it requires more time.
I have used software with GUI's that load in a clumsy fashion and are buggy. That is what I want to avoid. I want my apps to run smoothely.
So any programmers willing to point me in the right direction?
Thanks,
-Matt
|
|
|
|
|
Bitmap Basics - A GDI tutorial[^], is a good place to start; fairly basic but makes it easy to grasp the concepts. You should always take a look at Microsoft's GDI+[^] for the latest functionality. And when you feel comfortable with all that, then this article[^] teaches some really cool stuff.
Good luck!
|
|
|
|