Xojo Developer Conference
25/27th April 2018 in Denver.
MBS Xojo Conference
6/7th September 2018 in Munich, Germany.

[MBS] CoreFoundation help. (MBS Xojo Plugin Mailinglist archive)

Back to the thread list
Previous thread: [MBS] Application Services Menu Support?
Next thread: [MBS] Not compiling plugin version 6.3 Universal binary


Re: [MBS] MIDI Destinations and External Devices   -   Ron Benditt
  [MBS] CoreFoundation help.   -   Charlie Boisseau
   Re: [MBS] CoreFoundation help.   -   Christian Schmitz

[MBS] CoreFoundation help.
Date: 26.09.06 18:49 (Tue, 26 Sep 2006 18:49:03 +0100)
From: Charlie Boisseau
Cristian,

Any idea how to port this code to RB using your CF plugin - I'm
really stuck:

// Fill in the dictionary in the delegate
CFTypeRef keys[] = { GROWL_NOTIFICATIONS_ALL,
GROWL_NOTIFICATIONS_DEFAULT };
CFTypeRef values[] = { allNotifications, defaultNotifications };
delegate.registrationDictionary = CFDictionaryCreate(
kCFAllocatorDefault, keys, values, 2,
&kCFTypeDictionaryKeyCallBacks,
&kCFTypeDictionaryValueCallBacks);

Cheers.

Re: [MBS] CoreFoundation help.
Date: 27.09.06 12:17 (Wed, 27 Sep 2006 13:17:03 +0200)
From: Christian Schmitz
Charlie Boisseau <<email address removed>> wrote:

> Cristian,
>
> Any idea how to port this code to RB using your CF plugin - I'm
> really stuck:
>
> // Fill in the dictionary in the delegate
> CFTypeRef keys[] = { GROWL_NOTIFICATIONS_ALL,
> GROWL_NOTIFICATIONS_DEFAULT };
> CFTypeRef values[] = { allNotifications, defaultNotifications };
> delegate.registrationDictionary = CFDictionaryCreate(
> kCFAllocatorDefault, keys, values, 2,
> &kCFTypeDictionaryKeyCallBacks,
> &kCFTypeDictionaryValueCallBacks);

Well, something like this:

dim k1,k2,v1,v2 as CFStringMBS
dim d as CFMutableDictionaryMBS

k1=NewCFStringMBS("GROWL_NOTIFICATIONS_ALL")
k1=NewCFStringMBS("GROWL_NOTIFICATIONS_DEFAULT")
v1=NewCFStringMBS("allNotifications")
v2=NewCFStringMBS("defaultNotifications")

d=NewCFMutableDictionaryMBS
d.Add k1,v1
d.Add k2,v2

And than go on with d or d.handle for setting it.
But I'm not sure if the values of the C constants are the same as the
name of the constants.

Gruß
Christian