[futurebasic] Re: C API Conversion

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : November 2005 : Group Archive : Group : All Groups

From: <russp@...>
Date: Sat, 26 Nov 2005 16:53:04 -0600
Okay,  Now I'm stuck again.

It succesfully finds all the Skype functions from the framework (or at least
all the ones I've tried).  The problem now is repeated crashes (log below)
whenever I call fn SetSkypeDelegate (delegate ) which is :

// glue to call framework function
local fn SetSkypeDelegate ( aDelegate as ^SkypeDelegate )
beginassem
   lwz    r12,^gSetSkypeDelegate  ;this is the pointer from the framework
   mtspr  ctr,r12
   mr     r31,r2
   bctrl
   mr     r2,r31
endassem
end fn 
// void

I tried calling as err = fn SetSkypeDelegateR (delegate )

I wondered how SetSkypeDelegate in the framework would know where to find the
delegate structure so I also tried (guessed) it as:

local fn SetSkypeDelegate( aDelegate as ^SkypeDelegate )
beginassem
   lwz    r12,^gSetSkypeDelegate
   mr     r3,^aDelegate
   mr     r31,r2
   mtspr  ctr,r12
   mr     r31,r2
   bctrl
   mr     r2,r31
endassem
end fn 

The other functions don't crash but of course they can't do anything or
return anything until I get SetSkypeDelegate to hook up.

One interesting note:  On further reflection I suspect the reason fixing the
plist yesterday didn;t work sooner is because there was a copy of the file
cached somewhere in the file system.  When I replaced the API framework with
a fresh copy it immediately found the functions int he framework.

Lesson learned:  When fiddling with files be sure to copy-duplicate-etc. to
get a fresh copy in the cache.

BTW: Robert, I'm already using the poke long event thing with a value of 60.
Any more and it won't run the applescript often enough catch a call without a
long delay.  I think the problem is just the applscript interface to Skype
isn't very fast so it hangs out there for 5-7 ticks before coming back.

russp



A very repeatable Crash log from SetSkypeDelegate.  Line 2 is the FB routine
discussed above.  Line 1 is in the Skype API.  I don't know what line 0 is
but a Google search shows that exact error in a lot a crash logs posted on
the internet.


0   libobjc.A.dylib          	0x908611ec objc_msgSend + 0xc
1   com.skype.skypeframework 	0xd000371c SetSkypeDelegate + 0x8c
(SkypeAPI-Carbon.mm:173)
2                            	0x000ef340 SetSkypeDelegate + 0x28
3                            	0x000ef5e4 0xb6040 + 0x395a4
4   FB^3.Carbon.Runtime      	0x000ad458 main + 0x1f8


___________________________________________________________
Fidelity Communications Webmail - http://webmail.fidnet.com