Click here to Skip to main content
15,887,746 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionThreads in Windows service Pin
RoyceF1-May-08 11:39
RoyceF1-May-08 11:39 
AnswerRe: Threads in Windows service Pin
Blake Miller1-May-08 12:00
Blake Miller1-May-08 12:00 
GeneralRe: Threads in Windows service Pin
RoyceF1-May-08 15:38
RoyceF1-May-08 15:38 
GeneralRe: Threads in Windows service Pin
Blake Miller2-May-08 4:34
Blake Miller2-May-08 4:34 
Question"MSDN Library for Visual Studio 2008 - ENU" update problem Pin
followait1-May-08 11:06
followait1-May-08 11:06 
QuestionRe: "MSDN Library for Visual Studio 2008 - ENU" update problem Pin
Hamid_RT2-May-08 5:04
Hamid_RT2-May-08 5:04 
AnswerRe: "MSDN Library for Visual Studio 2008 - ENU" update problem Pin
Mark Salsbery2-May-08 5:42
Mark Salsbery2-May-08 5:42 
QuestionHow to Convert CString to TChAR Pin
Larry Mills Sr1-May-08 10:06
Larry Mills Sr1-May-08 10:06 
I've got a problem that I've tried to figure out, but can't.
Here's my code:
CString str = "C:\\Wells\\Program\\DataBases\\Drivers\\R and S\\OurDrivers.ddb";
CStdioFile myFile;
if(!myFile.Open(str, CFile::modeRead | CFile::typeText))
{
TRACE(_T("Unable to open file\n"));
}
DWORD dw = GetLastError();// error_path_not_found (3)
Here's the error with the CString str
ERROR:
error C2440: 'initializing' : cannot convert from 'const char [58]' to 'ATL::CStringT<BaseType,StringTraits>'
now I realize that this is correct:
CString str = _T("C:\\Wells\\Program\\DataBases\\Drivers\\R and S\\OurDrivers.ddb");

Here's the problem. I have to send "str" to the FileSave" function with the data already in it! I can't convert it like above (hard-coded) because I don't know what cchoices the User used to build the above string(str). I just hard-coded it for testing purposes.

Isn't there someway to use a CString as the filename/path in CStudioFile?
Help Please!

A C++ programming language novice, but striving to learn
AnswerRe: How to Convert CString to TChAR Pin
David Crow1-May-08 10:27
David Crow1-May-08 10:27 
AnswerRe: How to Convert CString to TChAR Pin
Randor 1-May-08 16:57
professional Randor 1-May-08 16:57 
AnswerRe: How to Convert CString to TChAR Pin
Rajkumar R1-May-08 20:30
Rajkumar R1-May-08 20:30 
Questionvs2008 problem, about F1 and type mismatch Pin
followait1-May-08 8:44
followait1-May-08 8:44 
Questionhow can i do this with C++ Pin
reteset1-May-08 4:22
reteset1-May-08 4:22 
AnswerRe: how can i do this with C++ Pin
led mike1-May-08 6:21
led mike1-May-08 6:21 
AnswerRe: how can i do this with C++ Pin
Maximilien1-May-08 7:03
Maximilien1-May-08 7:03 
AnswerRe: how can i do this with C++ [modified] PinPopular
Rajkumar R1-May-08 7:10
Rajkumar R1-May-08 7:10 
GeneralRe: how can i do this with C++ Pin
Randor 1-May-08 9:14
professional Randor 1-May-08 9:14 
GeneralRe: how can i do this with C++ Pin
Maximilien1-May-08 9:24
Maximilien1-May-08 9:24 
GeneralRe: how can i do this with C++ Pin
JudyL_MD1-May-08 10:27
JudyL_MD1-May-08 10:27 
GeneralRe: how can i do this with C++ Pin
Maximilien1-May-08 10:47
Maximilien1-May-08 10:47 
GeneralRe: how can i do this with C++ Pin
Rajesh R Subramanian1-May-08 18:49
professionalRajesh R Subramanian1-May-08 18:49 
GeneralRe: how can i do this with C++ Pin
JudyL_MD2-May-08 2:12
JudyL_MD2-May-08 2:12 
GeneralRe: how can i do this with C++ Pin
Rajesh R Subramanian1-May-08 19:19
professionalRajesh R Subramanian1-May-08 19:19 
QuestionRe: how can i do this with C++ Pin
Rajkumar R1-May-08 19:28
Rajkumar R1-May-08 19:28 
GeneralRe: how can i do this with C++ Pin
Rajesh R Subramanian1-May-08 19:29
professionalRajesh R Subramanian1-May-08 19:29 

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.