Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

error after upgrading to Codewarrior 5

Posted on 1999-07-12
2
Medium Priority
?
197 Views
Last Modified: 2013-12-26
I upgraded to CodeWarrior 5 and now I get an error when trying to compile.

event is not a struct/union/class member
dispatch.c line 355 switch (callBackParams->eventData.events->what

I looked at the header file and everything looks ok, but I must be doing something wrong.

if (callBackUD != 0)
            switch (callBackSelector)
                  {
                  case kNavCBEvent:
                        {
                        docList = (Document**)callBackUD;
                        if (docList != NULL)
                              switch (callBackParms->eventData.event->what)
                                    {
                                    case nullEvent:
                                          break;
                                          
                                    case updateEvt:
                                          pWindow = (WindowPtr)callBackParms->eventData.event->message;
                                          theDoc = docList[index];
                                          if (theDoc != NULL)
                                                {
                                                while ((theDoc->theWindow != pWindow) && (docList[index] != NULL))
                                                      {
                                                      index++;
                                                      theDoc = docList[index];
                                                      }
                                                theDoc = docList[index];
                                                //if (theDoc != NULL)
                                                      //UpdateWindow(theDoc);
                                                }
                                          break;

                                    case activateEvt:
                                          break;

                                    default:
                                          break;
                                    }
                        break;
                        }
                  }
}
0
Comment
Question by:dwp090598
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
boonstra earned 400 total points
ID: 1291897
CW 5.0 upgrades the interface files to version 3.2.  The NavCBRec struct is defined a little differently in 3.2, as follows:

struct NavCBRec {
      UInt16                                           version;
      NavContext                                     context;                  WindowPtr                                     window;
      Rect                                           customRect;
      Rect                                           previewRect;                  NavEventData                               eventData;
      char                                           reserved[222];
};

To fix your code, in the kNavCBEvent case of the switch, change:
 switch (callBackParms->eventData.event->what)

to:
 switch (callBackParms->eventData.eventDataParms.event->what)

Similarly, in the updateEvt case, change:
 pWindow = (WindowPtr)callBackParms->eventData.event->
    message;

to
 pWindow = (WindowPtr)callBackParms->
     eventData.eventDataParms.event->message;

0
 

Author Comment

by:dwp090598
ID: 1291898
As usual Bob you saved me a headache.

Thanks...
Don
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

715 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question