11-20-2006 11:41 AM
ClDriverWrap * pcl = new ClDriverWrap(0);
ClDriverWrap::MonitorEnableRt (unsigned short uRtAddress,
bool bEnable)
Would need a function that looks like:
bool EnableRTMonitor(ClDriverWrap* ptr, unsigend short _uRtAddress, bool _bEnable)
{
return ptr->MonitorEnableRt (_uRtAddress, _bEnable);
}
Where ptr is the U32(?) returned from the constructor. Am I on the right track here?
Thanks,
Bill F
11-21-2006 04:27 PM
Hello,
I don't have experience with this, but I would suggest creating a trivial class containing just a single data member, a constructor which initializes it, and an accessor method which returns its value.
Once you get things working with that simple class, you should be able to extend the idea to others.
What you described/exemplified seems to make sense though - you have a wrapper function which returns your pointer to your object, and a wrapper function for each member function of that object's class which takes the pointer as an argument, in addition to the function's original arguments, and uses the pointer to call the original function with those original arguments. Then to use the dll, you call the function to get your object pointer first, and then use it to call the other wrapper functions.
Is that the general idea you are going for?
If you do play with a simple example, please post it for the community!
Best Regards,
JLS
11-22-2006 03:31 AM - edited 11-22-2006 03:31 AM
Message Edited by rolfk on 11-22-2006 10:37 AM