Click here to Skip to main content
15,922,166 members
Home / Discussions / Mobile
   

Mobile

 
GeneralRe: INI Files -Read/WritePrivateProfilestring Pin
Atlantys17-Oct-03 10:26
Atlantys17-Oct-03 10:26 
GeneralRe: INI Files -Read/WritePrivateProfilestring Pin
#realJSOP17-Oct-03 11:38
professional#realJSOP17-Oct-03 11:38 
GeneralRe: INI Files -Read/WritePrivateProfilestring Pin
Atlantys17-Oct-03 13:26
Atlantys17-Oct-03 13:26 
GeneralRe: INI Files -Read/WritePrivateProfilestring Pin
#realJSOP18-Oct-03 0:32
professional#realJSOP18-Oct-03 0:32 
GeneralCrash Pin
gregs17-Oct-03 2:48
gregs17-Oct-03 2:48 
Generalunresolved external _Lockit Pin
BadJerry17-Oct-03 2:30
BadJerry17-Oct-03 2:30 
GeneralProblem "Solved" Pin
BadJerry17-Oct-03 9:18
BadJerry17-Oct-03 9:18 
Generalfree a char[ ] Pin
slomoman15-Oct-03 6:38
slomoman15-Oct-03 6:38 
i am quite new to strings in c++.
i wonder if after the following function all memory is freed.
Or does anybody see any memory-leaks?

void CSTHtmlDialog::DoSomething(const CString strFilePath)
{
HANDLE hFile;
DWORD dwBytesRead;

hFile = CreateFile (strFilePath,
GENERIC_READ, // Open for reading
0, // Do not share
NULL, // No security
OPEN_EXISTING, // Existing file only
FILE_ATTRIBUTE_NORMAL, // Normal file
NULL); // No template file

DWORD dwFileLength = GetFileSize(hFile, NULL)
char* pBuffer = new char[dwFileLength];

if (ReadFile (hFile, pBuffer, dwFileLength, &dwBytesRead, NULL))
{
pBuffer[dwFileLength - 1] = '\0';
SetString(pBuffer);//calls this function:
//void SetString(const CString &strHtml){...}
}

CloseHandle (hFile);
delete[] pBuffer;
pBuffer = 0;
return;
}

thx, Daniel
GeneralRe: free a char[ ] Pin
Atlantys15-Oct-03 10:45
Atlantys15-Oct-03 10:45 
GeneralRe: free a char[ ] Pin
Jonas Larsson15-Oct-03 23:01
Jonas Larsson15-Oct-03 23:01 
GeneralRe: free a char[ ] Pin
slomoman16-Oct-03 0:00
slomoman16-Oct-03 0:00 
GeneralRe: free a char[ ] Pin
Jonas Larsson16-Oct-03 1:02
Jonas Larsson16-Oct-03 1:02 
GeneralRe: free a char[ ] Pin
Jonas Larsson16-Oct-03 1:28
Jonas Larsson16-Oct-03 1:28 
GeneralDetecting Power Off Pin
Atlantys14-Oct-03 12:47
Atlantys14-Oct-03 12:47 
GeneralRe: Detecting Power Off Pin
João Paulo Figueira14-Oct-03 23:03
professionalJoão Paulo Figueira14-Oct-03 23:03 
GeneralRe: Detecting Power Off Pin
Atlantys15-Oct-03 6:04
Atlantys15-Oct-03 6:04 
QuestionHow to get the redirected URL or Curent URL from the HTML Viwer/Container Pin
AKSIVAKUMAR14-Oct-03 5:41
AKSIVAKUMAR14-Oct-03 5:41 
AnswerRe: How to get the redirected URL or Curent URL from the HTML Viwer/Container Pin
João Paulo Figueira14-Oct-03 6:38
professionalJoão Paulo Figueira14-Oct-03 6:38 
Generalexport dialog-recource Pin
slomoman13-Oct-03 7:56
slomoman13-Oct-03 7:56 
GeneralRe: export dialog-recource Pin
João Paulo Figueira13-Oct-03 11:06
professionalJoão Paulo Figueira13-Oct-03 11:06 
Generaljpgs in pocketIE look crappy Pin
slomoman13-Oct-03 7:42
slomoman13-Oct-03 7:42 
Generalclose the MainFrame from a Child-Window Pin
slomoman13-Oct-03 7:34
slomoman13-Oct-03 7:34 
GeneralRe: close the MainFrame from a Child-Window Pin
João Paulo Figueira13-Oct-03 10:46
professionalJoão Paulo Figueira13-Oct-03 10:46 
GeneralRe: close the MainFrame from a Child-Window Pin
slomoman15-Oct-03 3:13
slomoman15-Oct-03 3:13 
GeneralRe: close the MainFrame from a Child-Window Pin
João Paulo Figueira15-Oct-03 3:24
professionalJoão Paulo Figueira15-Oct-03 3:24 

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.