Hello,
I have this old snippet that, when called, it crashes the app. Yes, it is very very old and it even calls Carbon.framework. Yet for an app of mine it would be useful.
Without this code, the system will not ask users if they allow the app to access Quick Time Player, and consequently the app fails to work.
Or is there some code that could be added to the plist file, that could achieve the same purpose, i.e. ask users if they allow the app to access Quick Time Player?
I say this, because, in another app of mine, to access Contacts I have added the relevant strings in its plist file.
Thanks.
[code]Public Function GetAEReplyError(theEvent as AppleEvent) as integer
dim i,j,k As Integer
dim s As OSType
If theEvent Is Nil then Return 0
If theEvent.ReplyPtr=0 then Return 0
dim replyEvent as new MemoryBlock(4)
replyEvent.Long(0)=theEvent.ReplyPtr
replyEvent=replyEvent.Ptr(0)
If StrComp(replyEvent.StringValue(0, 4), “null”,0)=0 then Return 0
Soft Declare Function AESizeOfParam Lib “Carbon.framework” (theAppleEvent as Integer,theAEKeyword as OSType,typeCode as Integer,dataSize as Integer) as Int16
If AESizeOfParam(theEvent.ReplyPtr,“errn”,0,0)<>0 then Return 0//because an error code has not been set
//Soft Declare Function AEPutParamPtr Lib “Carbon.framework” (theAppleEvent as Integer,theAEKeyword as OSType,typeCode as OSType,ByRef dataPtr as Integer,dataSize as Integer) as Short
Soft Declare Function AEGetParamPtr Lib “Carbon.framework” (theAppleEvent as Integer,theAEKeyword as OSType,typeCode as OSType,ByRef actualType as OSType,ByRef dataPtr as Integer,MaxSize As Integer,ByRef DataSize As Integer) as Int16
k=AEGetParamPtr(theEvent.ReplyPtr,“errn”,“long”,s,i,4,j)
//(theAppleEvent as Integer,theAEKeyword as OSType,typeCode as OSType,actualType as OSType,ByRef dataPtr as Integer,MaxSize As Integer,ByRef DataSize As Integer) as Short
//Call AEPutParamPtr(theEvent.ReplyPtr,“errn”,“long”,replyCode,4)
Return i
End Function
[/code]