Hello,
I have encountered similar problem to this and i am posting the record of my conversation w jemmyell:
ME:
Hello
I have came across your problem with SetDRO when developing plugin for mach (here;s the link:
http://www.machsupport.com/forum/index.php/topic,1339.0.html). I have similar situation. I cannot touch dro's in my plugin because setdro doesn't seem to have any effect and getDro always returns value of 0.1 . I want to ask you, how have you solved your issue? i.ve tried to rename the function but should it work ? i mean we only instantiate the pointers to the functions and then call this pointers but does the name of the pointer matter? I would very appreciate your help.
Regards
JEMMYELL:
Hi, at that same link you can see that I posted to use SetOemDro and GetOemDro. The DRO's that Mach3 uses CANNOT be set. You must change the values that they reflect. You CAN get the values of these DROs. See my tutorial plugin for header files with all the right values.
ME:
Hi,
Thank you very much for your quick reply. After two hrs of digging through forum i've finally found SetOEMDRO in scripter class in the tutorial you've provided ( on which i try to build my plugin). However i still cannot read any dros via this (get...) function. It returns -INF ( for int -217...) which i think to be some kind of error value for double values when eg overflows occur, so after conversion to int i got -217.... I also got the dbg message " Warning: attempt to call Invoke with NULL m_lpDispatch!" when executing these functions. I execute them : scripter.SetOEMDRO(X_DRO,12); (int)scripter.GetOEMDRO(X_DRO); /*i know that it returns double*/ I am now rather desperate. One more thing. Since i cannot set dros which mach uses, should i add to my screen my own dros (with functions i want control) and only then i will be able to control them by scripter.SetOEMDRO(X_DRO,12); or scripter.SetOEMDRO(X_DRO + 1000,12); ?
Thank you very much for your help. I hope that you will be able to understand my thought which hides under my english
Best Regards,
Maciek
I found on the net that i need to call scripter.CreateDispatch("progNameOrSmth"); but it returns 0 and i still have the warning. Any ideas ?
Maciek
JEMMYELL:
Get the ZIP file from reply #41 in this thread. It's all in there.
http://www.machsupport.com/forum/index.php/topic,4884.40.html
You should really ask these questions on the forum so all can benefit.
OK, the problem is you need to call SetOEMDRO from CMyScriptObject class, but before that you must call Mach3ObjectModelStartup() so that it could work. At the exit you call Mach3ObjectModelShutdown(). That was all in the newest version of the plugin from #41 reply, but i have overlooked it in my version 1.b. Thanks again Jemmyell. now everything works fine.