FIXED: Ptr Function nearly working
Posted: Fri May 21, 2010 5:48 pm
Hi Bernd,
thanks for the new beta. I gave it a test drive with a call to AppleScript:
This code when compiled results in an exception:
errorInfo (name of argument) becomes part of the method name!
If I look into the resulting Objective-C++ code, I see:
It should have read:
When I compile the resulting Objective-C++ files within XCode the program runs as expected!
If you fix this, it will be fun to use.
Kind regards,
Udo
thanks for the new beta. I gave it a test drive with a call to AppleScript:
- Code: Select all
Declare Class "NSAppleEventDescriptor"
Declare Class "NSAppleScript"
Declare Function "NSAppleScript" + (id)alloc
Declare Function "NSAppleScript" - (id)initWithSource:(NSString *)source
Declare Function "NSAppleScript" - (id) executeAndReturnError: (NSDictionary **) errorInfo
'Declare Class "NSError"
Event AwakeFromNib()
Dim myScriptString As String
Dim myASScript As NSAppleScript
Dim myAEDescriptor As NSAppleEventDescriptor = Nil
Dim err As id = Nil
myScriptString = "choose URL"
myASScript=myASScript.initWithSource(myScriptString)
myAEDescriptor=myASScript.executeAndReturnError( errinfo:=err )
End Event
This code when compiled results in an exception:
errorInfo (name of argument) becomes part of the method name!
If I look into the resulting Objective-C++ code, I see:
- Code: Select all
- (id) NSAppleScript_executeAndReturnError:(id)objb_self:(id) errorInfo
{
[objb_self executeAndReturnError: errorInfo];
}
It should have read:
- Code: Select all
- (id) NSAppleScript_executeAndReturnError:(id)objb_self:(id) errorInfo
{
[objb_self executeAndReturnError: &errorInfo]; // Ampersand missing!
}
When I compile the resulting Objective-C++ files within XCode the program runs as expected!
If you fix this, it will be fun to use.
Kind regards,
Udo