SendMessage
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 16/02/2003 at 11:33, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.012
Platform:
Language(s) : C.O.F.F.E.E ;---------
Hi
in the documentation of COFFEE there's a member's function for the class GeBaseDialog described:
[bool] SendMessage( [int] id, [BaseContainer] msg);
This is a member of GeBaseDialog. It is funny... but when I call this:
println(instanceof(this,GeBaseDialog));
the console prints TRUE (or 1)
but if I write
SendMessage(Tabgroup,msg);
instead of the println(instanceof(this,GeBaseDialog));, the compiler complains.
this->SendMessage(Tabgroup,msg);
Doesn't work, too - member not found.
Any explanation for that?
cya -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/02/2003 at 13:31, xxxxxxxx wrote:
HI
I don't know how to express this... I am kinda disapointed.
No answers. Ok, I gave no example, but I'll do that now.
If I could perform SendMessage as documentated I could (maybe) switch the tab manually. I catched the message the occurs when I am changing the tabs and it seems to be pretty simple... IF I COULD SEND A MESSAGE.
So - why does this not work???//demo for non working function: SendMessage // be sure to use a unique ID obtained from [www.plugincafe.com](http://www.plugincafe.com) var PLUGIN_ID = 1000161; // be sure to use a unique ID obtained from [www.plugincafe.com](http://www.plugincafe.com) include "c4d_symbols.h" // ******** make a dialog class ************** var resource; class MyDialog : GeBaseDialog { public: MyDialog(); CreateLayout(); } MyDialog::MyDialog() { SendMessage(0,NULL); super(0); } MyDialog::CreateLayout() { // return LoadDialogResource(R_HELLOWORLD,resource,0); return TRUE; } // ****** register plugin in menu ************** class MyMenuPlugin : MenuPlugin { public: MyMenuPlugin(); GetID(); GetName(); GetHelp(); Execute(doc); } MyMenuPlugin::MyMenuPlugin() { super(); } MyMenuPlugin::GetID() { return PLUGIN_ID; } MyMenuPlugin::GetName() { return "SendMessage"; } MyMenuPlugin::GetHelp() { return "Shows nonworking SendMessageFunction"; } MyMenuPlugin::Execute(doc) { var d = new(MyDialog); d->Open(FALSE,-1,-1); } main() { Register(MyMenuPlugin); }
Compiling this does not work - it complains about "SendMessage". It doesn't know this function. It is important to me that I find a way to switch between layouts. Anyhow - why does this not work??? Is there a workaround?
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/02/2003 at 16:54, xxxxxxxx wrote:
Sorry I'm no COFFEE coder, but perhaps this is a simple type mismatch? So try to send a BaseContainer instead of NULL (just an idea) :
var bc = new(BaseContainer); SendMessage (0, bc);
Ciao,
Marcus -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/02/2003 at 16:57, xxxxxxxx wrote:
... But I think you have to be careful with your IDs. The documentation says, that SendMessage(...) is used for internal messages. If have bad luck, your message will be read as an internal message - with an unfitting BaseContainer resulting a nice crash. However, I'm just guessing...
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/02/2003 at 17:07, xxxxxxxx wrote:
The point is, that the compiler don't even know this function. It can't compile the file. Try to use Sendmessage. Just try it - it won't compile.
If I could send a message I know very exactly what to send, but it just don't work. -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 17/02/2003 at 17:42, xxxxxxxx wrote:
Ok, I tried it and it didn't work in R8. Either this member is not implemented or somewhat "private" so that only C4D is able to call it. I don't know.
If I did understand you, you want to switch between tabs? Can't you use GeBaseDialog.Activate(...) for this? Sorry, I don't have no clue how you can switch between tabs in COFFEE...
Ciao,
Marcus -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/02/2003 at 02:11, xxxxxxxx wrote:
This would do the job... at least this is the Message that I can catch when the tabs are changed. So sending this to the tabgroup should do the same I guess.... this->Activate(ID) does not have any effect. I have searched this forum, and an answer was that you cannot do this in COFFEE. But the answer was not that SendMessage does not work!
Btw. If it was declared private the compiler would say that you have no access, but it seems to me that it is not implemented.ActivateTab(Tabgroup,Tabid) { var msg=new(BaseContainer); msg->SetId(1648444244); msg->InsData(1835362660,Tabgroup); msg->InsData(1835365985,Tabid); SendMessage(Tabgroup,msg); }
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/02/2003 at 02:21, xxxxxxxx wrote:
Ok one last try: What if you use GeBaseDialog.Message(msg)? Sorry I should try it by myself, instead of guessing around, but I really don't have the time.
All I can say is, that SendMessage(..) is implemented in C++, pretty useless for you, I know...
Ciao,
MarcusPS: Mikael, David - please help
-
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/02/2003 at 04:09, xxxxxxxx wrote:
Have tried that already, but as long as the message is not forwarded to its childs it is pretty useless.
I have worked out a workaround now, so this is not as important to me... although it would be easier for me to switch between the groups, it is also working when I delete the group and insert the new one. Works fine so far...
Thanks for your help anyway. Maybe you could try to write a wrapper in C++ that can be called from COFFEE, forwarding the basedialog ("this"), the ID and the msg.... so it would look like the original call - with the exception that coffee works with all configurations (R6-R8, Mac/PC) and C++... only with the version it was compiled for.
Btw. It doesn't seem to me that there are lot's of COFFEE programmers out there, although the language is quite easy to learn. Any reason for that??
cya -
THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 18/02/2003 at 07:03, xxxxxxxx wrote:
The main reason, why I don't use COFFEE is the lack of functionality. The second reason: I love C++ It's well-thought and fast and most projects I do are in C++.
But the disadvantages for plugin programming are obvious, but then there is reason 1...