-
October 21st, 2012, 01:03 PM
#1
Passing pointer into ActiveX control?
I'm writing an ActiveX control. In one of the functions I'd like the user to be able to pass me a pointer to a buffer that they created which I can then fill with data and return a success/error code. What's the appropriate way to do this? I was thinking about just using an OLE_HANDLE type for the parameter and then casting that to pointer inside the OCX but I'm not sure if that's safe or the right way to do it. Any suggestions or advice?
Thanks,
Dan
-
October 21st, 2012, 01:57 PM
#2
Re: Passing pointer into ActiveX control?
Victor Nijegorodov
-
October 22nd, 2012, 02:41 AM
#3
Re: Passing pointer into ActiveX control?
Originally Posted by Dan203
I'm writing an ActiveX control. In one of the functions I'd like the user to be able to pass me a pointer to a buffer that they created which I can then fill with data and return a success/error code. What's the appropriate way to do this? I was thinking about just using an OLE_HANDLE type for the parameter and then casting that to pointer inside the OCX but I'm not sure if that's safe or the right way to do it. Any suggestions or advice?
The safety will depend on the details of your control implementation, but typically it's fine unless it to implement a marshaling of some special type. As well, passing low level pointers will most probably limit your clients to C/C++/Delphi.
Actually, COM has a couple of special mechanisms adapted specifically to passing byte chains: IStream and Safe Array.
Best regards,
Igor
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|