?
Solved

ODBC - CRecordset - CRecordview (Urgent)

Posted on 2000-03-09
4
Medium Priority
?
193 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 8

Accepted Solution

by:
VinExpert earned 100 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
In this post we will learn different types of Android Layout and some basics of an Android App.
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

752 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