AutoCAD 2019 porting problem

AutoCAD 2019 porting problem

danipon71
Enthusiast Enthusiast
1,014 Views
2 Replies
Message 1 of 3

AutoCAD 2019 porting problem

danipon71
Enthusiast
Enthusiast

Hi,

 

After the migration of an ARX project to AutoCAD 2019, I get the following compilation error:

 

error C2664: 'bool acedRemoveFilterWinMsg(const AcedFilterWinMsgFn)': cannot convert argument 1 from 'const AcedFilterWinMsgFn (__cdecl *)(MSG *)' to 'const AcedFilterWinMsgFn'.

 

I get that same error with the following methods:

 

acedRegisterFilterWinMsg ( const AcedFilterWinMsgFn pfn )

acedRemoveFilterWinMsg ( const AcedFilterWinMsgFn pfn )

acedRegisterWatchWinMsg ( const AcedFilterWinMsgFn pfn )

 

my hook function is declared like these:

 

const AcedFilterWinMsgFn MouseHook (MSG *pMsg)

{

...

}

 

what's wrong?

 

Thanks in advance

0 Likes
Accepted solutions (1)
1,015 Views
2 Replies
Replies (2)
Message 2 of 3

thierry_prince
Advocate
Advocate
Accepted solution

Hi,

 

A change in 2019 is that the callback function must now return a 'bool' and not a 'BOOL / int' as previous versions.

But if you use the typedef for AcedFilterWinMsgFn, it should be correct.

 

Try to remove the 'const' statement at the beginning of the function implementation :

  const AcedFilterWinMsgFn MouseHook (MSG *pMsg)

  {

    ...

  }

 

Cheers,

Thierry

0 Likes
Message 3 of 3

danipon71
Enthusiast
Enthusiast

Thanks a lot for your fast reply!

0 Likes