Priority CoreMessage
-
On 22/02/2014 at 05:08, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R15
Platform:
Language(s) : C++ ;---------
I am using chilkat to download files.To show the progress, I use SpecialEventAdd to send this progress to my main dialog (CoreMessage).
So far so good. I get the information in my dialog.However, looking at the console, I see that the download is completed before CoreMessage receives any messages.
In the console you see first all progress message from the threat and only AFTER that the messages in CoreMessage.
I would expect them one by one.
So progress message in the threat and a message from CoreMessage.PercentDone: %d percent 88
CoreMessage progress 88
PercentDone: %d percent 89
CoreMessage progress 89
PercentDone: %d percent 90
CoreMessage progress 90
...
Here some code from the threat.
GePrint("PercentDone: %d percent: " + String::IntToString(pctDone)); SpecialEventAdd(1014856121, 9001, pctDone);
And from CoreMEssage
Bool MainDialog::CoreMessage( Int32 id,const BaseContainer &msg ) { switch ( id ) { case 1014856121: // internal message { UInt selector; selector = (UInt) msg.GetVoid( BFM_CORE_PAR1 ); if ( selector == 9001 ) { Int32 progress; progress = (Int32) msg.GetVoid( BFM_CORE_PAR2 ); GePrint("CoreMessage progress: " + String::IntToString(progress)); SetInt32(1001, progress); } break; } } return GeDialog::CoreMessage( id, msg ); }
-
On 23/02/2014 at 04:41, xxxxxxxx wrote:
My fault. I receive the message in CorMessage, but I do not handle correctly getting the second parameter.
I am not sure how to do that?Bool MainDialog::CoreMessage( Int32 id,const BaseContainer &msg ) { GePrint("CoreMessage id:" + String::IntToString(id)); switch ( id ) { case 1014856121: // internal message { UInt selector; selector = (UInt) msg.GetVoid( BFM_CORE_PAR1 ); // GOES WRONG selector = (UInt) msg.GetInt32( BFM_CORE_PAR1 ); // THIS GOES WRONG TOO if ( selector == 9001 ) {
The call to CoreMessage is:
SpecialEventAdd(1014856121, 9001, pctDone);
-
On 23/02/2014 at 05:38, xxxxxxxx wrote:
I'm now using GeSyncMessage instead of SpecialEventAdd and that works!
Issue solved (on to the next).