Click here to Skip to main content
15,921,452 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Daniel Strigl23-Oct-02 8:10
Daniel Strigl23-Oct-02 8:10 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Stephane Rodriguez.23-Oct-02 7:45
Stephane Rodriguez.23-Oct-02 7:45 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Daniel Strigl23-Oct-02 8:00
Daniel Strigl23-Oct-02 8:00 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Michael Dunn23-Oct-02 13:35
sitebuilderMichael Dunn23-Oct-02 13:35 
GeneralRe: ANSI --> UNICODE conversion problem! Pin
Daniel Strigl23-Oct-02 20:10
Daniel Strigl23-Oct-02 20:10 
GeneralPlatform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 7:18
Sydney Liles23-Oct-02 7:18 
GeneralRe: Platform SDK's LoadImage() Pin
Stephane Rodriguez.23-Oct-02 7:49
Stephane Rodriguez.23-Oct-02 7:49 
GeneralRe: Platform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 8:16
Sydney Liles23-Oct-02 8:16 
This is one of the things I have tried. I tried it again after I got your response. No luck. Unsure | :~

I changed the code to look like this:
//launch a pick file dialog<br />
CFileDialog dlg(TRUE, NULL, NULL, OFN_HIDEREADONLY, "Bitmap(*.BMP)|*.BMP|Icon(*.ico)<br />
                |*.ico||", this);<br />
if( dlg.DoModal() == IDOK )<br />
{<br />
   pathName = dlg.GetPathName();<br />
   BYTE FileBuffer[10240] = "";<br />
   fileName = dlg.GetFileTitle();<br />
   extName = dlg.GetFileExt();<br />
<br />
   HINSTANCE hInst = AfxGetInstanceHandle();<br />
<br />
   if (extName == "ico" || extName == "ICO")<br />
   {		<br />
      hIcon = (HICON)::LoadImage(hInst, pathName, IMAGE_ICON, 0, 0, <br />
                                 LR_LOADFROMFILE|LR_DEFAULTCOLOR); <br />
      if (hIcon)<br />
	SetIcon(hIcon, TRUE);<br />
   }<br />
   else<br />
   {<br />
      hBitmap=(HBITMAP)::LoadImage(hInst, "C:\\HAPPY.BMP", IMAGE_BITMAP, 0, 0, <br />
                                   LR_LOADFROMFILE|LR_CREATEDIBSECTION);<br />
      if (hBitmap)<br />
	bmpImage->Attach(hBitmap);<br />
   }<br />
	<br />
   //some more interesting code here...<br />
}


I know I am getting a valid HINSTANCE.

Any other suggestions?

BTW -- I really do appreciate the help.

Sydney Liles
Software Engineer
GeneralRe: Platform SDK's LoadImage() Pin
Stephane Rodriguez.23-Oct-02 8:27
Stephane Rodriguez.23-Oct-02 8:27 
GeneralRe: Platform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 8:43
Sydney Liles23-Oct-02 8:43 
GeneralRe: Platform SDK's LoadImage() Pin
Paul M Watt23-Oct-02 9:49
mentorPaul M Watt23-Oct-02 9:49 
GeneralRe: Platform SDK's LoadImage() Pin
Sydney Liles23-Oct-02 9:56
Sydney Liles23-Oct-02 9:56 
GeneralLinker error, I messed up with my SDK directory Pin
User 665823-Oct-02 7:10
User 665823-Oct-02 7:10 
GeneralRe: Linker error, I messed up with my SDK directory Pin
Stephane Rodriguez.23-Oct-02 7:50
Stephane Rodriguez.23-Oct-02 7:50 
GeneralRe: Linker error, I messed up with my SDK directory Pin
User 665823-Oct-02 8:56
User 665823-Oct-02 8:56 
Generalstring Pin
wong190723-Oct-02 7:02
wong190723-Oct-02 7:02 
GeneralRe: string Pin
Alvaro Mendez23-Oct-02 11:34
Alvaro Mendez23-Oct-02 11:34 
QuestionSafe file padding? Pin
clintsinger23-Oct-02 5:51
clintsinger23-Oct-02 5:51 
AnswerRe: Safe file padding? Pin
Daniel Turini23-Oct-02 5:55
Daniel Turini23-Oct-02 5:55 
GeneralAccessing Internet through Proxy using Winsock Pin
Ph@ntom23-Oct-02 5:46
Ph@ntom23-Oct-02 5:46 
GeneralRe: Accessing Internet through Proxy using Winsock Pin
pjnaughter23-Oct-02 9:23
pjnaughter23-Oct-02 9:23 
GeneralsndPlay freakin' Sound Pin
Jh323-Oct-02 4:19
Jh323-Oct-02 4:19 
GeneralRe: sndPlay freakin' Sound Pin
Matt Philmon23-Oct-02 4:26
Matt Philmon23-Oct-02 4:26 
Generalsystem command using MFC Pin
achandra00723-Oct-02 4:18
achandra00723-Oct-02 4:18 
GeneralRe: system command using MFC Pin
Simon.W23-Oct-02 4:34
Simon.W23-Oct-02 4:34 

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.