Click here to Skip to main content
14,272,096 members

Managed C++/CLI

 
AnswerRe: c++ toolTip windowsforms graphics Pin
Richard MacCutchan17-Jan-17 22:21
protectorRichard MacCutchan17-Jan-17 22:21 
GeneralRe: c++ toolTip windowsforms graphics Pin
SuchitraAB20-Jan-17 19:23
memberSuchitraAB20-Jan-17 19:23 
GeneralRe: c++ toolTip windowsforms graphics Pin
Richard MacCutchan20-Jan-17 22:20
protectorRichard MacCutchan20-Jan-17 22:20 
Questionquery Pin
Member 1291798422-Dec-16 4:51
memberMember 1291798422-Dec-16 4:51 
AnswerRe: query Pin
Jon McKee22-Dec-16 5:42
professionalJon McKee22-Dec-16 5:42 
AnswerRe: query Pin
Patrice T13-Jan-17 0:10
mvePatrice T13-Jan-17 0:10 
QuestionPlease help memory management Pin
Member 1282783222-Nov-16 21:06
memberMember 1282783222-Nov-16 21:06 
AnswerRe: Please help memory management Pin
Jochen Arndt22-Nov-16 21:42
mveJochen Arndt22-Nov-16 21:42 
There are problems (memory leaks). You must delete memory allocated with new when not used anymore:
void CreateFolderPath(string Path)
{
    char *strFolderPath = new char[Path.size() + 1];
    strcpy_s(strFolderPath, Path.size() + 1, Path.c_str());
    _mkdir(strFolderPath);
    delete [] strFolderPath;
}

string ConvertIntToString(int cipher, int objintiger)
{
    string temp;
    char *Res = new char[cipher];
    sprintf_s(Res, cipher, "%02d", objintiger);
    temp = Res;
    delete [] Res;
    return temp;
}

For your first example there is even no need to copy the string. Just pass it to _mkdir():
void CreateFolderPath(string Path)
{
    _mkdir(Path.c_str());
}

GeneralRe: Please help memory management Pin
Member 1282783222-Nov-16 22:04
memberMember 1282783222-Nov-16 22:04 
Questionwhy c++ is still being used? Pin
babak111019-Nov-16 22:53
memberbabak111019-Nov-16 22:53 
QuestionRe: why c++ is still being used? Pin
Jochen Arndt19-Nov-16 23:01
mveJochen Arndt19-Nov-16 23:01 
AnswerRe: why c++ is still being used? Pin
John Schroedl21-Nov-16 4:12
professionalJohn Schroedl21-Nov-16 4:12 
AnswerRe: why c++ is still being used? Pin
Eddy Vluggen21-Nov-16 4:31
mveEddy Vluggen21-Nov-16 4:31 
GeneralRe: why c++ is still being used? Pin
Afzaal Ahmad Zeeshan24-Nov-16 1:27
mveAfzaal Ahmad Zeeshan24-Nov-16 1:27 
GeneralRe: why c++ is still being used? Pin
Eddy Vluggen24-Nov-16 1:51
mveEddy Vluggen24-Nov-16 1:51 
GeneralRe: why c++ is still being used? Pin
Afzaal Ahmad Zeeshan24-Nov-16 2:13
mveAfzaal Ahmad Zeeshan24-Nov-16 2:13 
GeneralRe: why c++ is still being used? Pin
Eddy Vluggen24-Nov-16 2:35
mveEddy Vluggen24-Nov-16 2:35 
GeneralRe: why c++ is still being used? Pin
Afzaal Ahmad Zeeshan24-Nov-16 2:36
mveAfzaal Ahmad Zeeshan24-Nov-16 2:36 
GeneralRe: why c++ is still being used? Pin
Munchies_Matt28-Mar-17 23:31
memberMunchies_Matt28-Mar-17 23:31 
GeneralRe: why c++ is still being used? Pin
Afzaal Ahmad Zeeshan29-Mar-17 5:32
mveAfzaal Ahmad Zeeshan29-Mar-17 5:32 
GeneralRe: why c++ is still being used? Pin
Munchies_Matt29-Mar-17 21:13
memberMunchies_Matt29-Mar-17 21:13 
GeneralRe: why c++ is still being used? Pin
Richard Deeming24-Nov-16 1:58
mveRichard Deeming24-Nov-16 1:58 
GeneralRe: why c++ is still being used? Pin
Eddy Vluggen24-Nov-16 2:05
mveEddy Vluggen24-Nov-16 2:05 
GeneralRe: why c++ is still being used? Pin
Munchies_Matt28-Mar-17 23:33
memberMunchies_Matt28-Mar-17 23:33 
AnswerRe: why c++ is still being used? Pin
Afzaal Ahmad Zeeshan24-Nov-16 1:38
mveAfzaal Ahmad Zeeshan24-Nov-16 1:38 

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.