Click here to Skip to main content
15,925,661 members
Home / Discussions / Mobile
   

Mobile

 
GeneralNeed Database Implementation Pin
Chopper19-Oct-03 4:37
Chopper19-Oct-03 4:37 
GeneralProblems with Emulator Pin
BadJerry17-Oct-03 9:13
BadJerry17-Oct-03 9:13 
GeneralRe: Problems with Emulator Pin
slomoman18-Oct-03 3:29
slomoman18-Oct-03 3:29 
GeneralRe: Problems with Emulator Pin
BadJerry19-Oct-03 3:40
BadJerry19-Oct-03 3:40 
GeneralRe: Problems with Emulator Pin
nigs_krec13-Nov-03 19:08
nigs_krec13-Nov-03 19:08 
General.NET Embedded Systems Development Pin
Like2Byte17-Oct-03 9:10
Like2Byte17-Oct-03 9:10 
GeneralRe: .NET Embedded Systems Development Pin
BadJerry17-Oct-03 9:27
BadJerry17-Oct-03 9:27 
GeneralRe: .NET Embedded Systems Development Pin
Like2Byte17-Oct-03 17:30
Like2Byte17-Oct-03 17:30 
GeneralINI Files -Read/WritePrivateProfilestring Pin
#realJSOP17-Oct-03 4:24
professional#realJSOP17-Oct-03 4:24 
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 

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.