Carbon Help
I need Help with carbon. I am running OS X 10.4 and i am using Xcode 2. I am having trouble because every time that I make an application there is an error with the Menus. I am inable to click them without the program issuing a warning:
ZeroLink: unknown symbol '__Z16doMouseDownEventv'
please could some one help me?
ZeroLink: unknown symbol '__Z16doMouseDownEventv'
please could some one help me?
It means that you haven't defined
anywhere. Is that function in one of your source files? Is it in a C++ source file? Is the C++ source file in your project? Is it ticked for the target?
Code:
void doMouseDownEvent()anywhere. Is that function in one of your source files? Is it in a C++ source file? Is the C++ source file in your project? Is it ticked for the target?
Sorry For the innapropriate name=(.
My code looks like this:
*i have not finnished with the menu, this is just handles mouse down events so far.
My code looks like this:
Code:
int main(int argc, char* argv[])
{
IBNibRef nibRef;
WindowRef window;
WindowRef window1;
EventRecord Event;
OSStatus err;
EventRef EvntRef;
EventHandlerUPP handlerUPP;
Boolean gotEvent;
err= CreateNibReference(CFSTR("main"), &nibRef);
err = SetMenuBarFromNib(nibRef,CFSTR("MenuBar"));
err = CreateWindowFromNib(nibRef, CFSTR("Window2"), &window1);
ShowWindow(window);
ShowWindow(window1);
SetPortWindowPort(window1);
gQuit=false;
while(!gQuit)
{
gotEvent = WaitNextEvent(everyEvent,&Event,MAX_UNIT32,NULL);
if(gotEvent)
{
doEvents(&Event);
}
}
return 0;
}
void doEvents(EventRecord * Event)
{
switch(Event->what)
{
case mouseDown:
doMouseDownEvent();
break;
case keyDown:
break;
case updateEvt:
break;
case autoKey:
break;
case activateEvt:
break;
case osEvt:
break;
case mouseUp:
break;
}
}
void doMouseDownEvent(EventRecord *EvtRec)
{
WindowPartCode PartCode;
WindowRef windowRef;
SInt32 menuChoice;
PartCode= FindWindow(EvtRec->where,&windowRef);
switch (PartCode)
{
case inMenuBar:
menuChoice=MenuSelect(EvtRec->where);
doMenuChoice(menuChoice);
break;
case inContent:
if (windowRef!=FrontWindow())
SelectWindow(windowRef);
break;
case inDrag:
DragWindow(windowRef,EvtRec->where,NULL);
break;
case inGoAway:
if (TrackGoAway(windowRef,EvtRec->where))
gQuit=true;
break;
}
}
void doMenuChoice(SInt32 MenuChoice)
{
MenuID menuID;
MenuItemIndex MenuItem;
OSErr err;
MenuCommand commandID;
menuID =HiWord(MenuChoice);
MenuItem = LoWord(MenuChoice);
}*i have not finnished with the menu, this is just handles mouse down events so far.
Your function is doMouseDownEvent(EventRecord *EvtRec), but you're calling it with no arguments.

