Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / July 2006



Tip: Looking for answers? Try searching our database.

Compile error with filter function

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mythic Wave - 05 Jul 2006 16:43 GMT
Hello,

I've just switched from CodeWarrior 9 to 10 and am getting the
following compile error.  It didn't occur with CW 9.

    Error   : function call '[VoCompApp].NewNavObjectFilterUPP(pascal
unsigned char (*)(AEDesc *, void *, void *, short))' does not match
    'NewNavObjectFilterUPP(pascal extern "C" unsigned char (*)(AEDesc *,
void *, void *, short))'

I've declared my filter function as follows:

    static pascal Boolean MyFileFilter(AEDesc *theItem, void *info, void
*callBackUD, NavFilterModes filterMode) {...}

I've created the function pointer as follows:

    g_FilterProc = NewNavObjectFilterUPP((pascal Boolean (*) (AEDesc *,
void *, void *, NavFilterModes))MyFileFilter);

Any help would be appreciated.

Thanks,

Brian
David Phillip Oster - 05 Jul 2006 17:33 GMT
> Hello,
>
[quoted text clipped - 17 lines]
>
> Any help would be appreciated.

The error message is saying that your filter function was declared
inside an

extern "C" {

.... declaration here...

}

but the NewNavObjectFilterUPP isn't (or vice versa.)

Since extern "C" declarations nest, you can wrap it around #include's:

extern "C" {
#include <NavServices.h>

}

but you might have to do it in your precompiled header build file
(.pch++) for it to take effect.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.