Click here to Skip to main content
15,893,814 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionCreateCompatibleBitmap() retuns 0 , and GetLastError returns 8 , what does error code 8 means? Pin
rambojanggoon6-Oct-09 8:58
rambojanggoon6-Oct-09 8:58 
AnswerRe: CreateCompatibleBitmap() retuns 0 , and GetLastError returns 8 , what does error code 8 means? Pin
CPallini6-Oct-09 9:49
mveCPallini6-Oct-09 9:49 
AnswerRe: CreateCompatibleBitmap() retuns 0 , and GetLastError returns 8 , what does error code 8 means? Pin
«_Superman_»6-Oct-09 12:21
professional«_Superman_»6-Oct-09 12:21 
Questionto change cricheditctrl's window border Pin
prithaa6-Oct-09 8:34
prithaa6-Oct-09 8:34 
AnswerRe: to change cricheditctrl's window border Pin
«_Superman_»6-Oct-09 10:53
professional«_Superman_»6-Oct-09 10:53 
GeneralRe: to change cricheditctrl's window border Pin
PJ Arends6-Oct-09 11:58
professionalPJ Arends6-Oct-09 11:58 
GeneralRe: to change cricheditctrl's window border Pin
prithaa7-Oct-09 0:25
prithaa7-Oct-09 0:25 
QuestionProperty sheet-based app has icon problems Pin
rfparker6-Oct-09 8:03
rfparker6-Oct-09 8:03 
I am developing a property sheet-based application on XP using VC++ 6. When it starts it talks briefly to an instrument over a serial port in app::InitInstance(), creates the property sheet, adds a few pages, and does an appSheet.DoModal() to make it appear. In order to get an icon to appear in the taskbar and Alt-Tab, I use this code in appSheet::OnInitDialog():
// Set the icons for the app
AfxGetMainWnd()->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), TRUE);
AfxGetMainWnd()->SetIcon(AfxGetApp()->LoadIcon(IDR_MAINFRAME), FALSE);

The app works just fine, and until I added a slight twist mentioned next the icons appeared as expected.

For the several seconds during which the app is initially talking to the instrument the user sees nothing happening. So at the beginning of app::InitInstance() I create a modeless dialog that asks the user to be patient while the app starts up, and then hide the dialog at the end of the startup property page's OnInitDialog(). This works fine and looks great. Except that now SetIcon(), above, returns 0 and I get the generic white window icon for Alt-Tab and nothing in the taskbar. The icon in the title bar is still correct.

If I use the following code in place of the previous code, I can get the icon to display when I do an Alt-Tab, but nothing shows up in the taskbar.
HICON hIcon=AfxGetApp()->LoadIcon(IDR_MAINFRAME);
CWnd* pFrame=AfxGetMainWnd();
::SetClassLong(pFrame->GetSafeHwnd(), GCL_HICON, (long)hIcon);

Interestingly, until I do this the generic MFC icon shows up in the taskbar.

Any ideas why this is happening and how to get my icon and app name to appear in the taskbar?
Thanks
AnswerRe: Property sheet-based app has icon problems Pin
PJ Arends6-Oct-09 10:42
professionalPJ Arends6-Oct-09 10:42 
GeneralRe: Property sheet-based app has icon problems Pin
rfparker6-Oct-09 11:03
rfparker6-Oct-09 11:03 
GeneralRe: Property sheet-based app has icon problems Pin
PJ Arends6-Oct-09 11:23
professionalPJ Arends6-Oct-09 11:23 
GeneralRe: Property sheet-based app has icon problems Pin
rfparker7-Oct-09 11:11
rfparker7-Oct-09 11:11 
AnswerRe: Property sheet-based app has icon problems Pin
Mahesh Kulkarni25-Jun-10 11:08
Mahesh Kulkarni25-Jun-10 11:08 
QuestionTable Pin
dwillms6-Oct-09 7:19
dwillms6-Oct-09 7:19 
AnswerRe: Table Pin
EliottA6-Oct-09 7:31
EliottA6-Oct-09 7:31 
AnswerRe: Table Pin
jeron16-Oct-09 7:37
jeron16-Oct-09 7:37 
AnswerRe: Table Pin
PJ Arends6-Oct-09 7:49
professionalPJ Arends6-Oct-09 7:49 
QuestionData encryption software package recommendation needed [modified] Pin
transoft6-Oct-09 6:03
transoft6-Oct-09 6:03 
AnswerRe: Data encryption software package recommendation needed Pin
«_Superman_»6-Oct-09 8:18
professional«_Superman_»6-Oct-09 8:18 
GeneralRe: Data encryption software package recommendation needed Pin
transoft6-Oct-09 8:25
transoft6-Oct-09 8:25 
QuestionHow to get list of files open by process Pin
slawekwwww6-Oct-09 6:00
slawekwwww6-Oct-09 6:00 
AnswerRe: How to get list of files open by process Pin
Randor 6-Oct-09 7:02
professional Randor 6-Oct-09 7:02 
GeneralRe: How to get list of files open by process Pin
kilt8-Oct-09 23:37
kilt8-Oct-09 23:37 
GeneralRe: How to get list of files open by process Pin
Randor 9-Oct-09 11:57
professional Randor 9-Oct-09 11:57 
QuestionHow can I use an image_click more than once? Pin
Fenix26-Oct-09 5:14
Fenix26-Oct-09 5:14 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.