Click here to Skip to main content
16,010,650 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Generalregular expression problems Pin
Roman Nurik3-Oct-02 13:33
Roman Nurik3-Oct-02 13:33 
GeneralRe: regular expression problems Pin
Jörgen Sigvardsson3-Oct-02 14:17
Jörgen Sigvardsson3-Oct-02 14:17 
GeneralRe: regular expression problems Pin
Jon Hulatt3-Oct-02 21:52
Jon Hulatt3-Oct-02 21:52 
General*.bmp *.wbmp conversion Pin
3-Oct-02 12:27
suss3-Oct-02 12:27 
GeneralRe: *.bmp *.wbmp conversion Pin
Jörgen Sigvardsson3-Oct-02 13:35
Jörgen Sigvardsson3-Oct-02 13:35 
GeneralRe: *.bmp *.wbmp conversion Pin
Anonymous3-Oct-02 13:59
Anonymous3-Oct-02 13:59 
GeneralRe: *.bmp *.wbmp conversion Pin
Chris Losinger3-Oct-02 18:00
professionalChris Losinger3-Oct-02 18:00 
QuestionThis 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 12:21
RedZenBird3-Oct-02 12:21 
The question came up today in our shop "can I call one constructor from another just like I can in java" and 'out of curiousity' tried to figure out if it can be done...After a few attempts (at what I thought were direct 'and sensible' approaches that only made the compiler whine) I came up with the following....Now, don't get me wrong, I'm not advocating that anyone *should* do this....only that it appears that you can and that it looks like it 'works'....Big Grin | :-D Big Grin | :-D Big Grin | :-D

#include "stdafx.h"
#include "stdlib.h"

int flag;

class CtorTest
{
public:
CtorTest( void )
{
int x = 1;
}

CtorTest( int iFoo )
{
new( this ) CtorTest;
int x = 2;;
}

~CtorTest( void )
{
int x = 1;
}


void operator delete(void* p, CtorTest* poOuter)
{
free( poOuter );
}

void* operator new(size_t s, CtorTest* poOuter )
{
return poOuter;
}

};


int main(int argc, char* argv[])
{
printf("Hello World!\n");

int aNum = 5;
CtorTest x( aNum );

return 0;
}

Just trying to keep the forces of entropy at bay
AnswerRe: This 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 12:49
RedZenBird3-Oct-02 12:49 
AnswerRe: This 'works' but would you ever want to ?? Pin
Jörgen Sigvardsson3-Oct-02 13:47
Jörgen Sigvardsson3-Oct-02 13:47 
GeneralRe: This 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 14:46
RedZenBird3-Oct-02 14:46 
GeneralRe: This 'works' but would you ever want to ?? Pin
Jörgen Sigvardsson3-Oct-02 15:06
Jörgen Sigvardsson3-Oct-02 15:06 
GeneralRe: This 'works' but would you ever want to ?? Pin
RedZenBird3-Oct-02 15:16
RedZenBird3-Oct-02 15:16 
GeneralCAsyncSoccket Pin
moloko3-Oct-02 11:59
moloko3-Oct-02 11:59 
GeneralRe: CAsyncSoccket Pin
Alexthombra3-Oct-02 19:21
Alexthombra3-Oct-02 19:21 
GeneralRe: CAsyncSoccket Pin
moloko4-Oct-02 14:25
moloko4-Oct-02 14:25 
GeneralUndocumented Windows APIs Pin
uniken3-Oct-02 11:59
uniken3-Oct-02 11:59 
GeneralRe: Undocumented Windows APIs Pin
Andreas Saurwein4-Oct-02 0:33
Andreas Saurwein4-Oct-02 0:33 
GeneralCListCtrl OnColumnClick Pin
ns3-Oct-02 10:44
ns3-Oct-02 10:44 
GeneralRe: CListCtrl OnColumnClick Pin
Tomasz Sowinski3-Oct-02 10:52
Tomasz Sowinski3-Oct-02 10:52 
GeneralRe: CListCtrl OnColumnClick Pin
ns3-Oct-02 10:58
ns3-Oct-02 10:58 
GeneralRe: CListCtrl OnColumnClick Pin
Tomasz Sowinski3-Oct-02 11:02
Tomasz Sowinski3-Oct-02 11:02 
GeneralRe: CListCtrl OnColumnClick Pin
ns3-Oct-02 11:02
ns3-Oct-02 11:02 
GeneralRe: CListCtrl OnColumnClick Pin
Tomasz Sowinski3-Oct-02 11:04
Tomasz Sowinski3-Oct-02 11:04 
GeneralRe: CListCtrl OnColumnClick Pin
ns3-Oct-02 11:09
ns3-Oct-02 11:09 

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.