Click here to Skip to main content
15,910,661 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionApp which would work on every Windows system Pin
Lutosław7-May-08 7:42
Lutosław7-May-08 7:42 
AnswerRe: App which would work on every Windows system Pin
CPallini7-May-08 8:14
mveCPallini7-May-08 8:14 
AnswerRe: App which would work on every Windows system Pin
David Crow7-May-08 8:21
David Crow7-May-08 8:21 
QuestionOverriding the maximize button for the main window in a MDI application Pin
berger_the_great7-May-08 5:00
berger_the_great7-May-08 5:00 
AnswerRe: Overriding the maximize button for the main window in a MDI application Pin
Randor 7-May-08 6:00
professional Randor 7-May-08 6:00 
GeneralRe: Overriding the maximize button for the main window in a MDI application Pin
berger_the_great9-May-08 5:16
berger_the_great9-May-08 5:16 
QuestionHow to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 4:48
Larry Mills Sr7-May-08 4:48 
AnswerRe: How to Get a TCHAR into a CString? Pin
toxcct7-May-08 4:54
toxcct7-May-08 4:54 
AnswerRe: How to Get a TCHAR into a CString? Pin
CPallini7-May-08 5:06
mveCPallini7-May-08 5:06 
QuestionRe: How to Get a TCHAR into a CString? Pin
David Crow7-May-08 5:26
David Crow7-May-08 5:26 
AnswerRe: How to Get a TCHAR into a CString? Pin
Randor 7-May-08 5:41
professional Randor 7-May-08 5:41 
AnswerRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 6:52
Mark Salsbery7-May-08 6:52 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 7:34
Larry Mills Sr7-May-08 7:34 
GeneralRe: How to Get a TCHAR into a CString? Pin
CPallini7-May-08 7:42
mveCPallini7-May-08 7:42 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 7:53
Mark Salsbery7-May-08 7:53 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 10:56
Larry Mills Sr7-May-08 10:56 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery7-May-08 11:13
Mark Salsbery7-May-08 11:13 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr7-May-08 12:37
Larry Mills Sr7-May-08 12:37 
GeneralRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery9-May-08 7:36
Mark Salsbery9-May-08 7:36 
Larry Mills Sr wrote:
You say that you can use CString anywhere it wants a LPCTSTR (is that true only if you have the "/D" setting in the compiler? It sure doesn't work correctly if you ASSIGN another CString's data into the one you want to use for a CStdioFile filename!.


Yes, you can pass a CString object anywhere a LPCTSTR is the argument type. That means you can pass
a CString to CStdioFile::Open() NO PROBLEM. This has nothing to do with compiler settings. CString
is a string of a generic character type. The 'T' in LPCTSTR indicates it is a pointer to a generic
character type string. CString has a LPCTSTR operator. That makes a CString usable in place of a LPCTSTR,
regardless of whether you're building with _UNICODE defined or not.

If it doesn't work at runtime, then the contents of your string are WRONG.

It seems you need to focus on your string building. Have you stepped through with the debugger?

It doesn't matter what logic you go through to get a pathname for a file....however you build that
pathname, it needs to be valid for the file to open. If the file is not opening then your pathname is bad!

Mark

Mark Salsbery
Microsoft MVP - Visual C++

Java | [Coffee]

AnswerRe: How to Get a TCHAR into a CString? Pin
Mark Salsbery9-May-08 7:47
Mark Salsbery9-May-08 7:47 
GeneralRe: How to Get a TCHAR into a CString? Pin
Larry Mills Sr9-May-08 16:05
Larry Mills Sr9-May-08 16:05 
QuestionToolbar in dialog based project Pin
ilgale7-May-08 4:28
ilgale7-May-08 4:28 
AnswerRe: Toolbar in dialog based project Pin
Mark Salsbery7-May-08 7:01
Mark Salsbery7-May-08 7:01 
QuestionCapturing a video using opencv on MFC Pin
Collin Xie7-May-08 4:18
Collin Xie7-May-08 4:18 
AnswerRe: Capturing a video using opencv on MFC Pin
srisuwan917-Jan-10 20:56
srisuwan917-Jan-10 20:56 

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.