Solved

ODBC - CRecordset - CRecordview (Urgent)

Posted on 2000-03-09
4
183 Views
Last Modified: 2013-11-20
Problem:
I have developed an SDI application using AppWizard. I am using visual C++ version 6.0. I am using MFC and visual c++.

Question:

How do i create the icon for my application?
       


Regards

Eugene
0
Comment
Question by:eugene007
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
VinExpert earned 25 total points
ID: 2599797
Hi,

1. Open the resource editor.
2. From the Insert menu option select Resource.
3. Then select icon, and say OK.
4. U will get icon editor. Give the ID, say ID_MY_ICON and put the image.
5. Save it.

Thats it. Now to aplly that icon to Ur app. do as

HICON hicon = ::LoadIcon(0, MAKEINTRESOURCE(ID_MY_ICON));
AfxGetMainWnd()->SetIcon(hicon);

If U want to change the existing MFC icon,
1. Open the resource editor.
2. select icons->IDR_MAINFRAME and change the image for both 32x32 and 16x16 icons.

Hope this helps.

VinExpert
0
 

Author Comment

by:eugene007
ID: 2600084
HICON hicon = ::LoadIcon(0, MAKEINTRESOURCE(ID_MY_ICON));
AfxGetMainWnd()->SetIcon(hicon);


Problem: I am facing a problem in this part of the code:

AfxGetMainWnd()->SetIcon(hicon);

Another things i have placed this coding in the constructer of the CWinApp class. Is it ok.


Regards

Eugene




0
 
LVL 8

Expert Comment

by:VinExpert
ID: 2600368
Hi,

Don't place it in the constructor. But U can place it at the end of the InitInstance(), before returning as

HICON hicon = ::LoadIcon(::AfxGetInstanceHandle(), MAKEINTRESOURCE(IDI_MY_ICON));
AfxGetMainWnd()->SetIcon(hicon, FALSE);

This will solve Ur problem.

VinExpert
0
 
LVL 5

Expert Comment

by:vachooho
ID: 2602698
Why guys you create new icon for AppWizard generated application

You have IDR_MAINFRAME icon in resources
change the shape of it and all neccessary code to set icon in main window is already written in MFC.

0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now