Programming with Growl Growl_Delegate autoinstaller crashes

The Growl forums have moved to Google Groups, this forum is read only.
Locked
r_welz
Harmless
Posts: 1
Joined: Mon Feb 11, 2008 1:44 pm

Programming with Growl Growl_Delegate autoinstaller crashes

Post by r_welz »

Hello

I want to use Growl 1.1.2 from inside my C++ code but it always crashes when I use the Growl-WithInstaller.framework .

I use Metrowerks CodeWarrior on OS X.4 tiger since I have a huge Source Base, which, unfortunately, cannot be migrated to XCode within a realistic timeframe.

But growl itself works nice, sends messages and so, and a port to QT is emerging soon.

Unfortunately, when growl 1.1.2 is not installed on Tiger, the application, which should launch its own installer, crashes somwhere inside growl and I wonder If someone could help me, thereby keeping this information in this forum for everyone else who might run into the same problem.

Besides I have a lot of NULL assignments there but as far as the documentation tells, this should work.

In short, what I have is:

// begin code snippet

mDelegate = (struct Growl_Delegate *) malloc(sizeof(struct Growl_Delegate));

InitGrowlDelegate(mDelegate);

mDelegate->applicationName = CFStringCreateWithPascalString(NULL, LStr255 string("StingRay Client"), CFStringGetSystemEncoding());

mDelegate->growlInstallationWindowTitle=NULL;

mDelegate->growlInstallationInformation=NULL;

mDelegate->growlUpdateWindowTitle=NULL;

mDelegate->growlUpdateInformation=NULL;

Boolean result = Growl_SetDelegate(mDelegate);

CFStringRef eventTitle = CFStringCreateWithPascalString(NULL, LStr255("Hello this is Growl"), CFStringGetSystemEncoding());

size_t namelen = 255;
char hostname[255];
int result = gethostname(hostname, namelen);

CFStringRef eventDescriptions[] = { CFStringCreateWithPascalString(NULL, LStr255("on Host"), CFStringGetSystemEncoding()), CFStringCreateWithCString(NULL, hostname, CFStringGetSystemEncoding()), };

CFArrayRef eventDescriptionArray = CFArrayCreate(NULL,(const void **) eventDescriptions, sizeof(eventDescriptions) / sizeof(eventDescriptions[0]), &kCFTypeArrayCallBacks);

CFStringRef cfString = CFStringCreateByCombiningStrings (NULL, eventDescriptionArray, CFSTR("\n"));

Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext(
eventTitle,
cfString,
eventTitle,
mNotificationIcon,
mGlobalPriority,
mIsAlwaysSticky,
mGlobalClickedCallback);

// end code snipped

So as soon as Growl_NotifyWithTitleDescriptionNameIconPriorityStickyClickContext is called, my application crahes.

So can somebody help? I know CW is dead but maybe we keep our bread alive.
Locked