Click here to Skip to main content
15,907,328 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralCopy a file (That is already in use) Pin
Monty223-Nov-04 22:00
Monty223-Nov-04 22:00 
Generalmcsd in vc++ Pin
xcavin23-Nov-04 21:32
xcavin23-Nov-04 21:32 
GeneralCListView Problem Pin
Neelesh K J Jain23-Nov-04 21:22
Neelesh K J Jain23-Nov-04 21:22 
GeneralRe: CListView Problem Pin
Mike Danberg24-Nov-04 11:47
Mike Danberg24-Nov-04 11:47 
GeneralWrite to a fiel and read the same fiel in real time. Pin
amitranjanmishra23-Nov-04 21:17
amitranjanmishra23-Nov-04 21:17 
GeneralRe: Write to a fiel and read the same fiel in real time. Pin
toxcct23-Nov-04 22:10
toxcct23-Nov-04 22:10 
GeneralRe: Write to a fiel and read the same fiel in real time. Pin
Robert Bielik23-Nov-04 22:42
Robert Bielik23-Nov-04 22:42 
GeneralPassing object as parameter problem Pin
impeham23-Nov-04 20:29
impeham23-Nov-04 20:29 
a language question. i have the following:
-------------------
class BUFFER{
public:
char* string;
int size;

~BUFFER()
{
delete[size] string;
}
};
-------------------
void func1(BUFFER buf)
{
...
// on exit, the original "buf.string" will be deleted, because the
// destructor is called once
}
-------------------
void main()
{
BUFFER mf;
mf.string = new char[20];
lstrcpy(mf.string, "test");
func1(mf); // <-- after this returns, the mf.string
// was deleted once, and will be deleted the second
// time when "main" returns in the second call to the
// destructor, which will lead to an error
}
-------------------

The question is:
how can i override this behavior? i want the buffer in "string" pointer to be a copy of the original too - just like the "size" attribute, so there won't be a second delete called in destructor for the same pointer.

Thanks.
GeneralRe: Passing object as parameter problem Pin
PJ Arends23-Nov-04 20:59
professionalPJ Arends23-Nov-04 20:59 
GeneralRe: Passing object as parameter problem Pin
impeham23-Nov-04 21:02
impeham23-Nov-04 21:02 
GeneralRe: Passing object as parameter problem Pin
PJ Arends23-Nov-04 21:17
professionalPJ Arends23-Nov-04 21:17 
GeneralRe: Passing object as parameter problem Pin
impeham23-Nov-04 21:26
impeham23-Nov-04 21:26 
GeneralRe: Passing object as parameter problem Pin
toxcct23-Nov-04 22:29
toxcct23-Nov-04 22:29 
GeneralDetermine desktop bits per pixel format. Pin
Nick Z.23-Nov-04 19:10
Nick Z.23-Nov-04 19:10 
GeneralIcons Pin
Flame Gitsnik23-Nov-04 19:07
Flame Gitsnik23-Nov-04 19:07 
GeneralConvert Long To Byte Pin
RYU^^23-Nov-04 19:05
RYU^^23-Nov-04 19:05 
GeneralRe: Convert Long To Byte Pin
geo_m23-Nov-04 23:04
geo_m23-Nov-04 23:04 
GeneralRe: Convert Long To Byte Pin
RYU^^24-Nov-04 13:35
RYU^^24-Nov-04 13:35 
Generalabt Alt+keys Pin
Tripura.K23-Nov-04 18:26
Tripura.K23-Nov-04 18:26 
GeneralRe: abt Alt+keys Pin
rabih_kai23-Nov-04 18:45
rabih_kai23-Nov-04 18:45 
GeneralRe: abt Alt+keys Pin
Anonymous23-Nov-04 23:58
Anonymous23-Nov-04 23:58 
Questionhow to check the execution time of any program that is execute Pin
shiva shankar23-Nov-04 17:03
shiva shankar23-Nov-04 17:03 
AnswerRe: how to check the execution time of any program that is execute Pin
shiraztk23-Nov-04 18:08
shiraztk23-Nov-04 18:08 
GeneralRe: how to check the execution time of any program that is execute Pin
shiva shankar24-Nov-04 17:50
shiva shankar24-Nov-04 17:50 
Generalgraphics program help Pin
glowskull0323-Nov-04 15:28
glowskull0323-Nov-04 15:28 

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.