Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!tut.cis.ohio-state.edu!pt.cs.cmu.edu!rover.ri.cmu.edu!mkb From: mkb@rover.ri.cmu.edu (Mike Blackwell) Newsgroups: comp.sys.mac.programmer Subject: Another C++/MacApp question: Each() Message-ID: <10615@pt.cs.cmu.edu> Date: 30 Sep 90 18:20:33 GMT Reply-To: mkb@rover.ri.cmu.edu (Mike Blackwell) Organization: Carnegie-Mellon University, CS/RI Lines: 37 I have another question about using MacApp with C++, involving the Each method. I'm aware that this is discussed briefly in the August MacTutor, but I still can't figure it out. It is also apparently discussed in the MacApp 2.0 final docs, but due to a screwup, I only have the beta docs and I'm still trying to get that fixed. I'm going through the 2.0 tutorial, but coding in C++. The problem I have stems from the following Object Pascal: PROCEDURE TIconDocument.RedrawViews; PROCEDURE InvalidateView (aView: TView) BEGIN aView.ForceRedraw; END; BEGIN ForAllViewsDo(InvalidateView); END; I realize I need to use static links to get the parameters passed in C++, and I've been trying variations on the theme: pascal void InvalidateView(TView *aView) { aView->ForceRedraw(); } typedef pascal void (*DoToView)(Tview *aView, void *DoToView_StaticLink); pascal void TIconDocument::RedrawViews(void) { ForAllViewsDo((DoToView)InvalidateView); } ... but I can't seem to divine the correct syntax. Any help in this matter will be greatly appreciated (and I hope I get my docs soon!). Mike Blackwell mkb@rover.ri.cmu.edu