thanks, ok, I think I'm almost getting it to work. I translated enougth headers to call NSApplicationLoad and NSRunAlertPanel, but I got stuck at the @"string" syntax. I tryed to just define PNSString as a generic pointer and pass a PChar to it, but it doesn't work, the application crashes with messages that the autorelease pool isn't installed:
2008-01-06 19:01:46.396 cocoamsgbox[1752] *** _NSAutoreleaseNoPool(): Object 0x318310 of class NSCFString autoreleased with no pool in place - just leaking Here is my current code: program cocoamsgbox; {$mode objfpc}{$H+} uses objc, appkit; const Str_NSAutoreleasePool = 'NSAutoreleasePool'; Str_alloc = 'alloc'; Str_init = 'init'; Str_release = 'release'; var { classes } NSAutoreleasePoolId: id; { objects } pool: id; begin // NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; NSAutoreleasePoolId := objc_getClass(PChar(Str_NSAutoreleasePool)); pool := objc_msgSend(NSAutoreleasePoolId, sel_registerName(PChar(Str_alloc)), []); objc_msgSend(NSAutoreleasePoolId, sel_registerName(PChar(Str_init)), []); NSApplicationLoad(); { uses a default "OK" button and no alternate buttons } // NSRunAlertPanel(@"This is the title", @"This is the message", nil, nil, nil); NSRunAlertPanel(PChar('This is the title'), PChar('This is the message'), nil, nil, nil, []); // [pool release]; pool := objc_msgSend(NSAutoreleasePoolId, sel_registerName(PChar(Str_release)), []); end. thanks, -- Felipe Monteiro de Carvalho _______________________________________________ fpc-devel maillist - fpc-devel@lists.freepascal.org http://lists.freepascal.org/mailman/listinfo/fpc-devel