Click here to Skip to main content
15,914,221 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Problem with strings conversion Pin
doctorpi1-Apr-04 6:42
doctorpi1-Apr-04 6:42 
GeneralRe: Problem with strings conversion Pin
Ravi Bhavnani1-Apr-04 6:49
professionalRavi Bhavnani1-Apr-04 6:49 
GeneralRe: Problem with strings conversion Pin
doctorpi1-Apr-04 6:58
doctorpi1-Apr-04 6:58 
GeneralRe: Problem with strings conversion Pin
Ravi Bhavnani1-Apr-04 7:06
professionalRavi Bhavnani1-Apr-04 7:06 
GeneralRe: Problem with strings conversion Pin
doctorpi1-Apr-04 7:14
doctorpi1-Apr-04 7:14 
GeneralRe: Problem with strings conversion Pin
Ravi Bhavnani1-Apr-04 7:20
professionalRavi Bhavnani1-Apr-04 7:20 
GeneralRe: Problem with strings conversion Pin
doctorpi1-Apr-04 7:24
doctorpi1-Apr-04 7:24 
GeneralRe: Problem with strings conversion Pin
Paul Ranson2-Apr-04 0:19
Paul Ranson2-Apr-04 0:19 
This works,
<br />
        TCHAR m_szDrive[10];<br />
        TCHAR m_szDir[MAX_PATH];<br />
        TCHAR m_szFullPath[MAX_PATH];<br />
        CString sFile; <br />
        // Application Path <br />
        ::GetModuleFileName(NULL,m_szFullPath,MAX_PATH);<br />
        _splitpath(m_szFullPath,m_szDrive,m_szDir,NULL,NULL); <br />
        sFile=m_szDrive;<br />
        sFile+=m_szDir;<br />
        sFile+=_T("myfile.txt");<br />
    //    CreateFile(sFile,.... THAT DOESN'T WORK<br />
        HANDLE h = ::CreateFile ( sFile,<br />
                                GENERIC_WRITE,<br />
							    FILE_SHARE_READ,<br />
							    NULL,<br />
							    OPEN_ALWAYS,<br />
							    FILE_ATTRIBUTE_NORMAL,<br />
							    NULL ) ;<br />

Given that your code appears to compile the problem is probably down to the arguments to 'CreateFile'. What are you using?

Paul
GeneralVisual C++.NET version 2003 Pin
DennisTheMenace1-Apr-04 5:56
DennisTheMenace1-Apr-04 5:56 
GeneralGetMenuItemInfo access violation in user32.dll Pin
jphillips_2003@hotmail.com1-Apr-04 5:48
jphillips_2003@hotmail.com1-Apr-04 5:48 
GeneralRich Text Error in VC .Net Pin
BlackDice1-Apr-04 5:12
BlackDice1-Apr-04 5:12 
GeneralUse DLL to raise event in VB app Pin
BlackDice1-Apr-04 5:03
BlackDice1-Apr-04 5:03 
GeneralOutlook express rules and folders Pin
ravjak1-Apr-04 4:48
ravjak1-Apr-04 4:48 
QuestionHow to find protected/encrypted word documents? Pin
GTS20201-Apr-04 4:10
GTS20201-Apr-04 4:10 
AnswerRe: How to find protected/encrypted word documents? Pin
David Crow1-Apr-04 6:53
David Crow1-Apr-04 6:53 
GeneralRe: How to find protected/encrypted word documents? Pin
GTS20201-Apr-04 22:54
GTS20201-Apr-04 22:54 
AnswerRe: How to find protected/encrypted word documents? Pin
gUrM33T1-Apr-04 16:39
gUrM33T1-Apr-04 16:39 
GeneralRe: How to find protected/encrypted word documents? Pin
GTS20201-Apr-04 22:56
GTS20201-Apr-04 22:56 
GeneralModem informations Pin
Chernobog11-Apr-04 3:44
Chernobog11-Apr-04 3:44 
GeneralRe: Modem informations Pin
Roger Wright1-Apr-04 4:30
professionalRoger Wright1-Apr-04 4:30 
QuestionWhich message window receives after all when it open? Pin
vgrigor1-Apr-04 3:43
vgrigor1-Apr-04 3:43 
AnswerRe: Which message window receives after all when it open? Pin
Prakash Nadar1-Apr-04 4:42
Prakash Nadar1-Apr-04 4:42 
AnswerRe: Which message window receives after all when it open? Pin
Harold Bamford1-Apr-04 12:33
Harold Bamford1-Apr-04 12:33 
GeneralRe: Which message window receives after all when it open? Pin
vgrigor1-Apr-04 19:33
vgrigor1-Apr-04 19:33 
AnswerRe: Which message window receives after all when it open? Pin
gUrM33T1-Apr-04 16:44
gUrM33T1-Apr-04 16:44 

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.