Click here to Skip to main content
15,891,607 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: help me! NEW and DELETE function Pin
SiddharthAtw8-Jan-04 22:44
SiddharthAtw8-Jan-04 22:44 
GeneralRe: help me! NEW and DELETE function Pin
Cedric Moonen8-Jan-04 23:11
Cedric Moonen8-Jan-04 23:11 
GeneralRe: help me! NEW and DELETE function Pin
Alexander M.,9-Jan-04 5:13
Alexander M.,9-Jan-04 5:13 
GeneralRe: help me! NEW and DELETE function Pin
Cedric Moonen9-Jan-04 5:26
Cedric Moonen9-Jan-04 5:26 
GeneralODBC to read .dbf files in VC++ Pin
Qadddd8-Jan-04 21:58
Qadddd8-Jan-04 21:58 
GeneralRe: ODBC to read .dbf files in VC++ Pin
David Crow9-Jan-04 3:16
David Crow9-Jan-04 3:16 
GeneralRe: ODBC to read .dbf files in VC++ Pin
Qadddd9-Jan-04 4:05
Qadddd9-Jan-04 4:05 
GeneralGDI+ pointer problems Pin
User 404118-Jan-04 21:39
User 404118-Jan-04 21:39 
I am having great difficulty getting pointers to GDI+ objects working in Doc/View under VC6.

The section of code from a Doc/View implementation (Wizard generated, no changes made):

#define TEST_POINTER

void CTestView::OnDraw(CDC* pDC)
{
CTestDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

#ifdef TEST_POINTER
Graphics* graphics = new Graphics(pDC->m_hDC);
Pen* pen = new Pen(Color(255, 0, 0, 0));
graphics->DrawLine(pen, 50, 50, 350, 550);
graphics->DrawRectangle(pen, 50, 50, 300, 500);
graphics->DrawEllipse(pen, 50, 50, 300, 500);
delete pen;
delete graphics;
#else
Graphics graphics(pDC->m_hDC);
Pen pen(Color(255, 0, 0, 0));
graphics.DrawLine(&pen, 50, 50, 350, 550);
graphics.DrawRectangle(&pen, 50, 50, 300, 500);
graphics.DrawEllipse(&pen, 50, 50, 300, 500);
#endif
}

compiles when TEST_POINTER is UNDEF'd but not when it is defined. I get the error message "error C2660: 'new' : function does not take 3 parameters" for the two 'new' functions.

As far as I can see the global new function is being called instead of the operator::new that the classes implement.

Can somebody tell me how to use GDI+ class pointers ? I need to use pointers as I am implementing pen/brush caches in a CAD.

Any advice would be greatly appreciated.
GeneralRe: GDI+ pointer problems Pin
User 404118-Jan-04 21:53
User 404118-Jan-04 21:53 
GeneralListBox in CComboBox Pin
Tonnystar8-Jan-04 21:25
Tonnystar8-Jan-04 21:25 
Generaloperator & on bool type Pin
Jerome Conus8-Jan-04 21:18
Jerome Conus8-Jan-04 21:18 
GeneralRe: operator & on bool type Pin
David Crow9-Jan-04 3:28
David Crow9-Jan-04 3:28 
GeneralExtract icons' formats Pin
bouli8-Jan-04 21:13
bouli8-Jan-04 21:13 
GeneralRe: Extract icons' formats Pin
KaЯl8-Jan-04 22:51
KaЯl8-Jan-04 22:51 
GeneralRe: Extract icons' formats Pin
bouli8-Jan-04 23:19
bouli8-Jan-04 23:19 
GeneralRe: Extract icons' formats Pin
KaЯl8-Jan-04 23:29
KaЯl8-Jan-04 23:29 
Generalremote installation problem Pin
skpanda8-Jan-04 20:53
skpanda8-Jan-04 20:53 
GeneralRe: remote installation problem Pin
Antti Keskinen9-Jan-04 3:57
Antti Keskinen9-Jan-04 3:57 
QuestionWhy it doesn't work? Pin
SiddharthAtw8-Jan-04 20:17
SiddharthAtw8-Jan-04 20:17 
AnswerRe: Why it doesn't work? Pin
Monty29-Jan-04 0:48
Monty29-Jan-04 0:48 
GeneralRe: Why it doesn't work? Pin
SiddharthAtw9-Jan-04 19:07
SiddharthAtw9-Jan-04 19:07 
GeneralProperty Sheet ShortCuts Pin
Prakash Nadar8-Jan-04 19:16
Prakash Nadar8-Jan-04 19:16 
GeneralVisual C++ NET Pin
java_jedi8-Jan-04 18:44
java_jedi8-Jan-04 18:44 
GeneralRe: Visual C++ NET Pin
Antti Keskinen8-Jan-04 20:02
Antti Keskinen8-Jan-04 20:02 
QuestionTBCD ?? Pin
Jagadeesh VN8-Jan-04 18:37
Jagadeesh VN8-Jan-04 18:37 

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.