THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/04/2011 at 12:22, xxxxxxxx wrote:
Cinema 4D Version: 12
Platform: Windows ;
Language(s) : C++ ;
I have a "strange" problem using win thread and GeDialog.
I've extended the GeDialog class usually with my own class and in the overrided 'Command' method I've recall a thread using w32 api like this:
l_thread_exec->st_f_callback = callbackFun
l_thread_exec->ref_dialog = this;
HANDLE l_upload_thread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadFun, l_thread_exec, 0, NULL);
The 'callbackFun' is called by the created thread ('ThreadFun') and this is define like this:
callbackFun(int p_result, GeDialog* p_dialog)
I want to pass to the 'ThreadFun' parameters the current GeDialog pointer (using 'this' in the 'ref_dialog' structure variable) because in the callback function ('callbackFun') I want to access this dialog to set some properties like button enable/disable and similar stuffs. In effect, in the 'callbackFun' I'm able to call GeDialog methods like this:
Bool result = p_dialog->Enable(DLG_BTN_UPLOAD_STOP, false);
I have NO compilation or runtime error, but the propertie isn't set!!! Simple, the 'result' above value is set to false ever and ever! Idem if I use any other GeDialog method like 'HideElement', 'SetString' on 'EditText' control or similar. The GeDialog pointer seems to be correct (same pointer location verified using the vs degubber) but all interface changes have no results!! If I made these changes within a 'GeDialog' method extended class all work fine.
Finally, I can't pass the GeDialog pointer through the methods to change the UI properties? These changes should be made only within the GeDialog extended class? There are others solutions?
< ="-" ="text/; =utf-8">