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 05/05/2011 at 12:58, xxxxxxxx wrote:
User Information: Cinema 4D Version: 12 Platform: Windows ; Language(s) : C++ ;
--------- Hi
After really crazy experiance with thread and dialog in a recent post, I'm trying to use SendMessage to set the GeDialog properties. If I try to call SendMessage like this:
SendMessage(DLG_BTN_UP, BaseContainer(BFM_ENABLE));
I receive the compile error:
error C2660: 'SendMessageA' : function does not take 2 arguments
This happens in any part of the program I try to call this method. My c4d includes are:
#include "c4d.h" #include "c4d_gui.h" #include "c4d_symbols.h" #include "c4d_general.h" #include "c4d_baseplugin.h" #include "C4D_Thread.h"
With the VS intellisense I see that the method called is one in winuser.h which is not in my includes. The prototype is:
LRESULT SendMessageA(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
I don't understand which is the problem...why this conflict?
Thanks for any help.
Bye.
On 05/05/2011 at 14:51, xxxxxxxx wrote:
I'm not sure what you're trying to do. Do you want to enable/disable controls in the GeDialog? If so, just use the Enable(LONG id, Bool TRUE/FALSE) function. Much easier than sending a message, even if that's possible.
On 06/05/2011 at 02:39, xxxxxxxx wrote:
Hi spedler, thanks for your reply.
Unfortunatly, is not so simple. As described here:
https://plugincafe.maxon.net/topic/5664/5700_manipulate-extended-gedialog-from-ext-methods
I'm interested to call the "Enable" method on GeDialog from Threading context. This is not allowed. So, I have to to try with SendMessage sdk routine to achieve my goal but I have the described problem.
Many thanks for any ideas.
Bye
Originally posted by xxxxxxxx I'm not sure what you're trying to do. Do you want to enable/disable controls in the GeDialog? If so, just use the Enable(LONG id, Bool TRUE/FALSE) function. Much easier than sending a message, even if that's possible.
Originally posted by xxxxxxxx
On 06/05/2011 at 06:29, xxxxxxxx wrote:
I don't think SendMessage will help in your case.
What you probably can do is to send a custom message through SpecialEventAdd() from your thread. Then this message can be received in your dialog's overridden CoreMessage method.
There is a small example in the docs for SpecialEventAdd().
cheers, Matthias
On 06/05/2011 at 07:51, xxxxxxxx wrote:
Hi Matthias, thanks for your constants replies. I will try the SpecialEvent...I've already seen this method but I don't remember if I've already tested this solution. Tonight I try...this "problem" made me crazy...thanks again, I'll know if it works...
bye
On 06/05/2011 at 11:26, xxxxxxxx wrote:
Definitively thanks, using SpecialEvent we can manipulate now the gedialog using threading context. Bye.
On 06/05/2011 at 12:49, xxxxxxxx wrote:
In any case, the SendMessage problem described stay...
On 06/05/2011 at 13:30, xxxxxxxx wrote:
Originally posted by xxxxxxxx In any case, the SendMessage problem described stay...
And it will stay as long as you're calling the Windows-specific method (which you can't use in the context of Cinema's event system) instead of the GeDialog method...
Best regards,
Wilfried
On 06/05/2011 at 13:41, xxxxxxxx wrote:
Did I understand you right ? You want to to something in the dialog from another thread ? I don't know about C++, but maybe this helps you:
When you want to send the message, don't send the message itself, instead create a variable the defines wether the message should be sent or not. Just some Pseudocode to clarify what I mean:
//Pseudocode, don't copy class MyDialog extends GeDialog { boolean sendEvent = FALSE; void Set_SendMessageOnNextUpdate() { sendEvent = TRUE; } void Do_SendMessage() { SendMessage(); sendEvent = FALSE; } boolean CoreMessage(id,msg) { if (sendEvent) { Do_SendMessage(); } return TRUE; } } class MyThread extends Thread { void doMyStuff(GeDialog *dlg) { dlg.Set_SendMessageOnNextUpdate(); } }
I'm not sure if this will really work as you wish, but maybe it helps you
Cheers, Niklas
On 07/05/2011 at 00:54, xxxxxxxx wrote:
Originally posted by xxxxxxxx Originally posted by xxxxxxxx In any case, the SendMessage problem described stay... And it will stay as long as you're calling the Windows-specific method (which you can't use in the context of Cinema's event system) instead of the GeDialog method... Best regards, Wilfried
I don't call any windows specific method now...
On 07/05/2011 at 03:34, xxxxxxxx wrote:
Originally posted by xxxxxxxx Originally posted by xxxxxxxx Originally posted by xxxxxxxx In any case, the SendMessage problem described stay... And it will stay as long as you're calling the Windows-specific method (which you can't use in the context of Cinema's event system) instead of the GeDialog method... Best regards, Wilfried
Originally posted by xxxxxxxx Originally posted by xxxxxxxx In any case, the SendMessage problem described stay...
I don't call any windows specific method now... [/QUOTE]
You do. The compiler's error message proofs it.
On 07/05/2011 at 13:07, xxxxxxxx wrote:
Bho....If I do, I don't know where I do...I've removed all "trash" includes, I've only:
#include "c4d.h" #include "c4d_gui.h" #include "c4d_symbols.h" #include "c4d_general.h" #include "c4d_baseplugin.h" #include "C4D_Thread.h" #include <string> #include <sys/stat.h>
I don't use any windows dependent method, the Thread is C4D Sdk based, but the message is:
error C2039: 'SendMessageA' : is not a member of 'C4DScenePlugin'
Now the prototype viewed with vs intellicode is correct but the error on define still stay...
Bho....
Originally posted by xxxxxxxx Originally posted by xxxxxxxx Originally posted by xxxxxxxx Originally posted by xxxxxxxx In any case, the SendMessage problem described stay... And it will stay as long as you're calling the Windows-specific method (which you can't use in the context of Cinema's event system) instead of the GeDialog method... Best regards, Wilfried
Originally posted by xxxxxxxx Originally posted by xxxxxxxx Originally posted by xxxxxxxx In any case, the SendMessage problem described stay...
Wilfried [/QUOTE]
On 07/05/2011 at 13:26, xxxxxxxx wrote:
With a redefine of method name in my plugin now compile fine...very strange for me...