We help IT Professionals succeed at work.

PicHandle cast as unsigned char handle

Medium Priority
338 Views
Last Modified: 2013-12-26
I have to cast a PicHandle as an unsigned char handle to work with a callback function for an application. I am writing a plugin for the application. I don't think I'm working with the pointers correctly. How would one accomplish this task? I have to copy the Picture record to the unsigned char handle. Help, please.

Thanks.
Comment
Watch Question

Commented:
Unlock this solution and get a sample of our free trial.
(No credit card required)
UNLOCK SOLUTION

Commented:
More details please, you start with a pic handle you want to pass to a code module (plugin) that is prototyped to accept an unsigned char handle, right?  Is the problem in the plugin, is that the code you are writing that does not work?  If so, you need to get the handle size in the plugin, then create the unsigned char handle big enough to hold it, then BlockDataMove the passed in handle to the newly created handle.  However it is not clear from the few words in you question exactly what you are doing. Like 'agolan', I would like to know if you fully understand what a Macintosh handle is and how you use them?  How about showing us the specific code you got that don't work?  What's the callback typedef and what routine are you calling that needs that callback.  I don't see what a plugin has to do with it.  If you are calling a Macintosh API that accepts a callback proc, what's that got to do with a plugin, or is all your code in a plugin you are writing?  In any event, what is the api call that takes the callback proc ptr (or UPP) and show us the callback proc code you have and the line of code that passes that supplies the handle to the callback.

Author

Commented:
It is a FileMaker Pro Plugin. I have a feeling that FileMaker Pro refuses to coerce the data the plugin returns, which is a handle to and unsigned char, back to a picHandle. The calculation in FileMaker that activates the plugin attempts to set a container field, which should accept a Picture Handle (works find from the Clipboard). I get a bunch of garbage, though, that looks like what a picHandle might look like as text. The problem is I don't know for sure. I finally had the plugin put the picHandle on the clipboard. It works fine that way. And yes, I fully understand what a Macintosh Handle is. I think FileMaker plugins will only work for text or numeric (converted to text) calculations.

If you have any suggestions, though, about the the unsigned char handle in FileMaker, I'd love to work it out without using the clipboard.

Thanks

Commented:
Maybe it wants a pointer to a pic handle or a handle to pic handle, dunno.  Don't think I can help without more details about the plugin calling conventions and what in Filemaker gets the data from the plugin you wrote.   What is the prototype for the routine in your plugin look like and what parameter in it is supposed to contain the pic handle or some kind of reference to it?
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.