What is the proper way to pass a void* to a C++ instance?

Ryan pixeloutlaw at gmail.com
Wed Dec 14 04:27:59 UTC 2016


Hello all,

I'm working on a C++ project.
For example let's say I have a class called MyClass

In C++ I might have

void* ptr = new MyClass(); // Assume default constructor

What is the proper way to turn ptr into a cl_object?
What is the proper way to decode the encoded cl_object back to C++'s 
void pointer so I can recast it?

I've read the documentation and tried a bunch of things.
Finally giving in and asking for a bit of direction since it's not 
working as I'd expect.

I was using ecl_make_pointer(ptr) to try and make a cl_object
I was using ecl_to_pointer([formerly created cl_object here]) to try and 
convert the cl_object pointer to a C++ void*

Maybe the bug is elsewhere or I'm not understanding...

Sincerely,
Ryan




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20161213/3b7eac0a/attachment.html>


More information about the ecl-devel mailing list