Your browser does not seem to support JavaScript. As a result, your viewing experience will be diminished, and you have been placed in read-only mode.
Please download a browser that supports JavaScript, or enable it if it's disabled (i.e. NoScript).
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 27/08/2008 at 16:29, xxxxxxxx wrote:
User Information: Cinema 4D Version: 10.5 Platform: Language(s) : C++ ;
--------- Hi!
Does anyone know, how to call CallCommand from a different thread? I can't find a principe to do it, because CallCommand requires the MainThread.. what would you suggest?
Thank you...
On 28/08/2008 at 03:24, xxxxxxxx wrote:
It seems to work for me, see code:
> \> class MyThread : public Thread \> { \> private: \> \> public: \> MyThread() { } \> virtual ~MyThread() { End(); Wait(FALSE); } \> \> virtual void Main(void); \> virtual const CHAR \*GetThreadName(void) { return "Test Thread"; } \> }; \> \> void MyThread::Main(void) \> { \> GePrint("render thread"); \> CallCommand(5159); \> } \> \> class MenuTest : public CommandData \> { \> public: \> virtual Bool Execute(BaseDocument \*doc); \> }; \> \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \> MyThread mt; \> mt.Start(FALSE); \> \> return TRUE; \> } \>
\> class MyThread : public Thread \> { \> private: \> \> public: \> MyThread() { } \> virtual ~MyThread() { End(); Wait(FALSE); } \> \> virtual void Main(void); \> virtual const CHAR \*GetThreadName(void) { return "Test Thread"; } \> }; \> \> void MyThread::Main(void) \> { \> GePrint("render thread"); \> CallCommand(5159); \> } \> \> class MenuTest : public CommandData \> { \> public: \> virtual Bool Execute(BaseDocument \*doc); \> }; \> \> Bool MenuTest::Execute(BaseDocument \*doc) \> { \> MyThread mt; \> mt.Start(FALSE); \> \> return TRUE; \> } \>
cheers, Matthias
On 28/08/2008 at 14:55, xxxxxxxx wrote:
Hi!
Perhaps I am wrong, but I checked out CallCommand
void CallCommand(LONG id, LONG subid) { if (!GeIsMainThread()) return; BaseContainer msg(COREMSG_CINEMA_EXECUTEEDITORCOMMAND); msg.SetLong(COREMSG_CINEMA_EXECUTEEDITORCOMMAND, id); msg.SetLong(COREMSG_CINEMA_EXECUTESUBID,subid); SendCoreMessage(COREMSG_CINEMA, msg, 0); }
and if CallCommand is not called from the main thread, it aborts, so it shouldn't be executed, should it?
Thanks a lot.
On 03/09/2008 at 15:43, xxxxxxxx wrote:
Hi Matthias,
you wrote that CallCommand works in a different thread. Do you know why this works, altough !GeIsMainThread() should prevent that?
Bye..