||Thread Tools||Search this Thread||Display Modes|
|Oct 15, 2010, 09:27 AM||#1|
Param error in UCKeyTranslate()
Does anyone know why the below code is causing UCKeyTranslate to return an error?
const int kBuffSize = 16;
types = MacTypes::kUnicodeDocument;
MacTypes::NewTSMDocument(1, types, &idocID,0);
const MacTypes::UCKeyboardLayout* uchrHandle;
MacTypes::UInt32 deadKeyState = 0;
keyAction = MacTypes::kUCKeyActionDown;
modifierKeyState = 0;
keyboardType = MacTypes::LMGetKbdType();
currentKeyScript = GetScriptManagerVariable(MacTypes::smKeyScript);
lastKeyLayoutID = GetScriptVariable(currentKeyScript, MacTypes::smScriptKeys);
//uchrHandle = MacTypes::GetResource('uchr', lastKeyLayoutID);
uchrHandle = (const MacTypes::UCKeyboardLayout*)MacTypes::GetResource('uchr', 0);
MacTypes::OSStatus status = MacTypes::UCKeyTranslate(uchrHandle, uVirtualKey,keyAction, modifierKeyState, keyboardType, 0, &deadKeyState,
kBuffSize, &actualStringLength, unicodeInputString);
|Oct 15, 2010, 12:34 PM||#2|
Which error is it returning?
What have you already tried to debug this?
|Oct 17, 2010, 04:55 AM||#3|
It is returning a param error (-50), I think it is because the second parameter of the GetResource function is set to zero. I set it to zero because when I used 'lastKeyLayoutID', uchr returned 'invalid'. I'm assuming that in that case I should use the KCHR resource for ascii input instead. So the question is why don't I have the 'uchr' resource for the lastKeyLayoutID on my machine, this question might seem niave but I am a newbie to Mac programming.
|Oct 18, 2010, 01:23 PM||#4|
If you're new to Mac programming, what are you trying to accomplish that needs keycode transformation into Unicode?
Have you seen these:
|Thread Tools||Search this Thread|
|thread||Thread Starter||Forum||Replies||Last Post|
|The operation canít be completed because an unexpected error occurred (error code -50||Hexley||OS X Mavericks (10.9)||6||May 21, 2014 02:16 AM|
|iPhone: [Help] Winterboard error "There was an error loading the preference bundle for winter||becast||Jailbreaks and iOS Hacks||10||Feb 28, 2014 09:58 PM|
|Network users login error 'can't log in at this time due to an error'||RyanelRichie||Mac OS X 10.7 Lion||1||Jan 8, 2014 04:29 AM|
|-fobjc-arc is not supported error and duplicate symbol error in compiling||mehdies||Mac Programming||3||Sep 24, 2013 01:57 AM|
|Cydia mismatch error, and indexed files failed to load error.||Napster100||Jailbreaks and iOS Hacks||6||May 19, 2013 01:31 PM|
All times are GMT -5. The time now is 03:56 PM.