Click here to Skip to main content
15,919,245 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how can i find or Pin
WinXYhappy8-Oct-06 14:31
WinXYhappy8-Oct-06 14:31 
GeneralRe: how can i find or Pin
Hamid_RT8-Oct-06 19:26
Hamid_RT8-Oct-06 19:26 
GeneralRe: how can i find or Pin
WinXYhappy1-Nov-06 2:59
WinXYhappy1-Nov-06 2:59 
GeneralRe: how can i find or Pin
Hamid_RT1-Nov-06 4:14
Hamid_RT1-Nov-06 4:14 
QuestionI have a LPWSTR and I need a LPCWSTR what do I do? Pin
BarryOg8-Oct-06 1:55
BarryOg8-Oct-06 1:55 
AnswerRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
Hamid_RT8-Oct-06 7:12
Hamid_RT8-Oct-06 7:12 
AnswerRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
Mark Salsbery8-Oct-06 8:37
Mark Salsbery8-Oct-06 8:37 
GeneralRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
BarryOg8-Oct-06 9:21
BarryOg8-Oct-06 9:21 
Thanks for the reply mark, I'm passing a LPWSTR into a function which accepts a LPCWSTR, here's my code:

  TCHAR szFile[_MAX_PATH];       // buffer for file name<br />
	HANDLE test;<br />
<br />
	// Initialize OPENFILENAME<br />
	ZeroMemory(&ofn, sizeof(ofn));<br />
	ofn.lStructSize = sizeof(ofn);<br />
	ofn.hwndOwner = mainLoop.hWnd;<br />
	ofn.lpstrFile = szFile;<br />
	//<br />
	// Set lpstrFile[0] to '\0' so that GetOpenFileName does not <br />
	// use the contents of szFile to initialize itself.<br />
	//<br />
	ofn.lpstrFile[0] = '\0';<br />
	ofn.nMaxFile = sizeof(szFile);<br />
	ofn.lpstrFilter = _T("All\0*.*\0Text\0*.TXT\0");<br />
	ofn.nFilterIndex = 1;<br />
	ofn.lpstrFileTitle = NULL;<br />
	ofn.nMaxFileTitle = 0;<br />
	ofn.lpstrInitialDir = NULL;<br />
	ofn.Flags = OFN_PATHMUSTEXIST | OFN_FILEMUSTEXIST;<br />
<br />
	// Display the Open dialog box. <br />
<br />
	if (GetOpenFileName(&ofn)==TRUE) <br />
		test = CreateFile(ofn.lpstrFile, GENERIC_READ,<br />
			0, (LPSECURITY_ATTRIBUTES) NULL,<br />
			OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL,<br />
			(HANDLE) NULL);<br />
<br />
<br />
	if (FAILED (D3DXGetImageInfoFromFile(szFile, &Info))){<br />
                  OutputDebugString("Failed to load image info");<br />
	}


I've tried everything I can think of, I've a fairly good understanding of UNICODE and ANSI encoding and I can't see where I'm going wrong. Any help would be really a life saver. Would it be possible for me to send you all my code incase I'm making a mistake else where and just can't see it?

Oh and if I call this with D3DXGetImageInfoFromFile(_T("F:\\Pictures\\ShannonTrip2006-PrintRun\\ShannonTrip2006 326.jpg"), &Info) it works fine.
GeneralRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
Mark Salsbery8-Oct-06 11:11
Mark Salsbery8-Oct-06 11:11 
GeneralRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
Mark Salsbery8-Oct-06 11:21
Mark Salsbery8-Oct-06 11:21 
GeneralRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
BarryOg8-Oct-06 23:17
BarryOg8-Oct-06 23:17 
GeneralRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
jhwurmbach9-Oct-06 2:41
jhwurmbach9-Oct-06 2:41 
GeneralRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
Mark Salsbery9-Oct-06 7:49
Mark Salsbery9-Oct-06 7:49 
GeneralRe: I have a LPWSTR and I need a LPCWSTR what do I do? Pin
Mark Salsbery9-Oct-06 8:01
Mark Salsbery9-Oct-06 8:01 
Questionhow to catch mouse in picture control Pin
hansen.Xue7-Oct-06 22:13
hansen.Xue7-Oct-06 22:13 
AnswerRe: how to catch mouse in picture control Pin
zon_cpp8-Oct-06 0:27
zon_cpp8-Oct-06 0:27 
GeneralRe: how to catch mouse in picture control Pin
hansen.Xue8-Oct-06 17:01
hansen.Xue8-Oct-06 17:01 
GeneralRe: how to catch mouse in picture control Pin
zon_cpp8-Oct-06 21:43
zon_cpp8-Oct-06 21:43 
GeneralRe: how to catch mouse in picture control Pin
hansen.Xue8-Oct-06 22:04
hansen.Xue8-Oct-06 22:04 
GeneralRe: how to catch mouse in picture control Pin
hansen.Xue8-Oct-06 22:04
hansen.Xue8-Oct-06 22:04 
GeneralRe: how to catch mouse in picture control Pin
zon_cpp9-Oct-06 0:14
zon_cpp9-Oct-06 0:14 
GeneralRe: how to catch mouse in picture control Pin
hansen.Xue9-Oct-06 19:39
hansen.Xue9-Oct-06 19:39 
GeneralRe: how to catch mouse in picture control Pin
zon_cpp9-Oct-06 20:20
zon_cpp9-Oct-06 20:20 
GeneralRe: how to catch mouse in picture control Pin
hansen.Xue9-Oct-06 21:23
hansen.Xue9-Oct-06 21:23 
AnswerRe: how to catch mouse in picture control Pin
Hamid_RT8-Oct-06 7:13
Hamid_RT8-Oct-06 7:13 

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.