Click here to Skip to main content
15,920,217 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
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 
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 
do this in your class definition :
<font color=#0000FF>class</font> CBuffer {
    <font color=#0000FF>char</font>* m_pcString;
    <font color=#0000FF>int</font>   m_iSize;
<font color=#0000FF>public</font>:
    CBuffer() {
        <font color=#008000>// Do the 'Default' constructor behavior here...</font>
        m_pcString = 0x00000000;
        m_iSize    = 0;
    }
 
    CBuffer(<font color=#0000FF>const</font> CBuffer& refBuf) {
        <font color=#008000>// Do the 'Copy' constructor behavior here...</font>
        m_pcString = <font color=#0000FF>new</font> <font color=#0000FF>char</font>[refBuf.m_iSize];
        <font color=#0000FF>if</font> (m_pcString != NULL) {
            <font color=#0000FF>this</font>->m_iSize = refBuf.m_iSize;
        }
    }
 
    ~CBuffer() {
        <font color=#008000>// Do the destructor behavior here...</font>
        <font color=#0000FF>delete</font>[m_iSize] m_pcString;
        m_iSize = 0;
    }
};
then, when you call your function with a CBuffer as parameter, this one is copied by the copy constructor in local when the function is called, and destroyed when the function exits. in any case the global object is affected by the construction/destuction of the local object.


TOXCCT >>> GEII power
[VisualCalc]

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 
GeneralTooltip on CHeaderCtrl of CListCtrl Pin
Vancouver23-Nov-04 15:08
Vancouver23-Nov-04 15:08 
GeneralInvisiable dialog on the entire screen Pin
Jon823-Nov-04 13:47
Jon823-Nov-04 13:47 
GeneralRe: Invisiable dialog on the entire screen Pin
John R. Shaw23-Nov-04 14:25
John R. Shaw23-Nov-04 14:25 
GeneralRe: Invisiable dialog on the entire screen Pin
Ryan Binns23-Nov-04 17:09
Ryan Binns23-Nov-04 17:09 
Generalascii conversion HELP!!! Pin
Member 153128723-Nov-04 13:38
Member 153128723-Nov-04 13: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.