Missing toCFString fpr Windows


#1

The very handy toCFSTring is not available for windows.
the code in juce_mac_Strings will work without modifications on windows.

CFStringRef String::toCFString() const
{
    CharPointer_UTF16 utf16 (toUTF16());
    return CFStringCreateWithCharacters (kCFAllocatorDefault, (const UniChar*) utf16.getAddress(), (CFIndex) utf16.length());
}

#2

Since when did Windows have CFStrings?


#3

Since when did you stop using Quicktime?


#4

you use CFString in juce_win32_QuickTimeMovieComponent.cpp.
You use a static method that does the same conversion as in the CfString method of the String class.

static CFStringRef juceStringToCFString (const String& s)
{
    return CFStringCreateWithCString (kCFAllocatorDefault, s.toUTF8(), kCFStringEncodingUTF8);
}

#5

um… I stopped actively using it since Apple gave up on it. It’s a dying technology.

But regardless of that, I obviously can’t make it so that a crucial header file like String.h will only compile if the user has included Quicktime.h!


#6

Why couldn’t you have made this your initial answer, instead of trying to be a smartass.
I asked a normal question but i get a disrespectful answer.
Anyway, Quicktime as it is now might be dying but i will be around for quite some time. So don’t give up on it yet.


#7

Jeez… Someone needs to switch to decaf!

I wasn’t being a smart-ass, it was a perfectly friendly (if hasty) response, and actually wasn’t sarcastic. I really did wonder for a moment if CFString really was available in Windows, and I just never knew about it… And since you never mentioned Quicktime, why would I have known that that’s what you were talking about?


#8

No you should take some more time to think before responding to a friendly asked question. I always tried to be polite as possible and very extensive in my posts.
You wonder why i would CFStrings on Windows and i point out why, and than i get a response telling that i have to forget about Quicktime. What’s that for a response?
That’s why i called you a … I would stick to just answering the question, or let someone else do it instead of giving me unnecessary advise.
Anyways i can agree on the fact that don’t want the CFString method on windows because you’ll need the Quicktime SDK, i just thought i would be elegant that you don’t have a separate method on Windows in your Quicktime Movie component.