• Advertisement
Sign in to follow this  

How to alter an object handle value from host application?

This topic is 1099 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I faced a problem when I wanted to change the content of a member variable in my script class.

 

This is my class:

class Foo
{
  int baz1;
  Bar@ baz2;
}

I can easily change value types in C++ by:

int* value = (int*)addressOfbaz1;
(*value) = 456;

But this doesn't work with object handles and I know why, but I don't know how I can alter the address that object handles are pointing to.

Edited by MahanGM

Share this post


Link to post
Share on other sites
Advertisement

Just don't forget to properly update the reference count of the objects referred to by the handle. Otherwise you'll get memory leaks (if you forget to call Release()), or dangling pointers (if you forget to call AddRef()).

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement