Function Prototype With Default Parameters

  • Thread starter Thread starter Wanderley Caloni Jr
  • Start date Start date
W

Wanderley Caloni Jr

Hi,

I get a problem when ported my code from VS 2002 to VS 2003.
Aparently, a typedef of a function with default parameters doesn't work
anymore. I used to compile this code in VS 2002.

Anyone already has this problem?


Code:
typedef int (*GIMP_SCUAIMPORTOBJECTS)
(CHAR szPath[MAX_PATH],
CHAR szServerName[100],
CHAR szSecServer[100],
DWORD modules = GIMP_MOD_ALL,
LPVOID reserved = NULL);

error C2383: 'GIMP_SCUAIMPORTOBJECTS' : default-arguments are not
allowed on this symbol.


Thanks by attention.

[]s
 
Wanderley said:
Hi,

I get a problem when ported my code from VS 2002 to VS 2003.
Aparently, a typedef of a function with default parameters doesn't
work anymore. I used to compile this code in VS 2002.

That's correct. The C++ standard does not allow specification of default
parameters on a typedef -VC7 (and before) should not have accepted it.

-cd
 
Back
Top