<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
R.Nagarajan wrote:
<blockquote cite="mid001b01c52988$2b3aebe0$3ce1a8c0@technicac509e3"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta content="MSHTML 6.00.2800.1491" name="GENERATOR">
  <style></style>
  <div><font face="Arial" size="2">
  <div><font face="Arial" size="2">I&nbsp;get the&nbsp;following compilation
error when I try to include the class vtkMyCallBack in my program&nbsp;</font></div>
  <div>&nbsp;</div>
  <div><font face="Arial" size="2">&nbsp;<u>error C2660: 'new' : function
does not take 3 parameters</u>&nbsp; (VC++ 6.0)</font></div>
  </font></div>
</blockquote>
This probably comes from MFC's "debug-new-wrapping" trick that helps
them give decent file name and line numbers in their memory leak
reporting code. Look for this near the top of your MFC (probably
wizard-generated) source file:<br>
<font color="#000099">#define new DEBUG_NEW<br>
</font><br>
Then, if you look at the definition of DEBUG_NEW, you'll find code like
this in afx.h:<br>
<font color="#000099"><font color="#009900">// Memory tracking
allocation<br>
</font>void* AFX_CDECL operator new(size_t nSize, LPCSTR lpszFileName,
int nLine);<br>
#define DEBUG_NEW new(THIS_FILE, __LINE__)<br>
</font><br>
One way around this is to undef new prior to the callback function's
definition and then re-define it after your callback function.<br>
<font color="#000099">#undef new<br>
</font><font color="#009900">//&nbsp; callback stuff goes in here<br>
</font><font color="#000099">#define new DEBUG_NEW<br>
</font><br>
Another alternative would be to put your callback stuff into a separate
source file that isn't "polluted" by the MFC #defining of new...<br>
<br>
Hope this helps,<br>
David<br>
<br>
</body>
</html>