Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

Archive for April, 2011

Checking if ARA is connected?

    I’m writting a program which need to check if ARA is connected or
not. I’ve tried to create a PPP endpoint and then call the
OTOptionManagement function, but I don’t know which options are
available for a PPP endpoint. Does somebody knows the available options?

    Thanks in advance!

posted by admin in Uncategorized and have Comment (1)

Disposing something twice — bad?

What happens if you dispose the same Pointer more than once? i.e.

  // We keep track of the memory in more than one variable
pointerA = NewPtr(kPtrSize);
pointerB = pointerA;

  // Then later, since the code doesn’t know any better…

In my example, it’s obvious that pointerA and pointerB are the same.
Yet, in my program, it would be quite difficult to ensure that the
memory referenced by a pointer has not already been disposed elsewhere.
(Setting a single pointer to NULL after disposing it isn’t the solution,
because there are other pointers to the same memory location.)

So my question: could the above code cause problems, or is it "safe"? In
other words, is the Memory Manager smart enough to know it has already
dispose the block referenced, and do nothing the second time DisposePtr
is called on an already-disposed block?

Or, should I bend over backwards to make sure this doesn’t happen?

-Vern – get the most powerful 2D animation library for the Mac —
soon to be carbonized!

To email me, replace REPLACEME with Jensen. (Sorry, but SPAM is annoying!)

posted by admin in Uncategorized and have Comments (4)

New To Cocoa – Need help with getting ARP information


Is there a way to read in the ARP cache, clear the cache, put an entry in
the cache etc from within Cocoa ?

I know from you can do this… But cant figure out after 2 days
of reading the developer docs how to do this….

Any help would be appreciated.

Jim McMurry

posted by admin in Uncategorized and have Comments (2)

Recording sound from Cocoa?

Are there any frameworks or hidden calls to allow me to record sounds in
Cocoa apps?

A record option is conspiciously missing from the AppKit’s NSSound.

I’ve bee mucking around with the SoundKit (,
which looked promising, but I can’t make it playback or record (although
it does load and recognise sound), and I now understand recording is
prolly broken under Cocoa.

I was also encouraged by the news the PortAudio (
libraries supported OS X, but it seems to be the Carbon libs they
support… and there’s no way to include Carbon calls in a Cocoa app,


posted by admin in Uncategorized and have Comments (4)

plugin for ie

Dear all,

I want to write a plugin for IE/mac version.
But I am new in this field.
My questions are
1.Can I add plugin for IE/Mac?
2.How to do that?
3.Where can i find more help?

Thanks in advance,

posted by admin in Uncategorized and have Comments (6)

Q: AppSwitcher

Hi —

Has anybody deciphered the App Switcher Preferences, stored as a ‘coln’
resource 23790? I try to find out what they mean and write a TMPL or
even a quick application to change them…


– Hans van Maanen

posted by admin in Uncategorized and have Comments (3)

AGL on Darwin: is aglGetCurrentContext broken?

aglGetCurrentContext() is segfaulting on me:

Bus Error

gdb> run

Program received signal EXC_BAD_ACCESS, Could not access memory.
0x714d26d8 in aglGetCurrentContext ()

hmm,  the web docs on say Carbon Status:

how do I get the current openGL context then? (actually, just want to
see if it’s valid– (aglGetCurrentStatus() != NULL)).



posted by admin in Uncategorized and have Comment (1)

Multiple dataSources for multiple TableViews

Is it possible to link multiple TableViews to one self-created class? I know
it’s possible physically, but how do you distinguish between views for
methods like numberOfRowsInTableView(NSTableView aTableView)? Is there a way
to identify the table so that the count from the correct dataSource can be

    Or should I just dataSource initiate a new class for each view?

    This is using Java with Project Builder & OS X.1


posted by admin in Uncategorized and have Comments (10)

Multiprocessing link error


I’m calling the function MPGetNextCpuID, which is in the system header file

(Actually, I have no interest in multiprocessing.  I’m interested in the
processor temperature.  Unfortunately, the function
GetCoreProcessorTemperature requires cpuID as one of its arguments).

I get a link error:

Link Error   : undefined ‘MPGetNextCpuID’ (code)
Referenced from ‘main’ in main.cpp

I’ve looked around for some sort of MultiprocessingLib to add to my project
but can’t find any.  What am I missing?

My application is PowerPC, and I’m using CodeWarrior 6 on Mac OS 9.2.


Jerry Krinock
San Jose, CA

Here is my code:

#include <power.h>
#include <Multiprocessing.h>
#include <MultiprocessingInfo.h>

void    InitializeToolbox( void ) ;

void  main( void )

    Str255 theString1 ;
    MPCpuID cpuID ;
    MPGetNextCpuID((OpaqueMPCoherenceID *)kMPInvalidIDErr, &cpuID) ;

    NumToString( GetCoreProcessorTemperature(cpuID), theString1) ;
    ParamText(theString1, "\p", "\p", "\p") ;

    NoteAlert(128, NULL) ;


void  InitializeToolbox( void )
    InitGraf (&qd.thePort);
    InitDialogs( NULL );
    FlushEvents(everyEvent, 0);

- — -


posted by admin in Uncategorized and have Comments (2)

How to detect an active Internet connection?


does anyone here know how it is possible to detect an active Internet
connection under MacOS X?
Thanks for your help!


posted by admin in Uncategorized and have Comment (1)