Solved

ODBC - CRecordset - CRecordview (Urgent)

Posted on 2000-03-09
4
191 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 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

724 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