Professional OPC
Development Tools

logos

convert eventargs in delphi

More
12 Feb 2018 07:43 #6028 by support
Replied by support on topic convert eventargs in delphi
My understanding was that you wanted to change the eventArgs.Succeeded property.

I simply did:
  eventArgs.Exception := CoCLRException.Create();
  WriteLn(eventArgs.Succeeded);
and that changes it from the default TRUE to FALSE.

Regards

Please Log in or Create an account to join the conversation.

More
12 Feb 2018 06:45 #6026 by alr1976
Replied by alr1976 on topic convert eventargs in delphi
Ok but i have not succesfully create _exception... I have tried..... So if You help me to create _exception i can transfer data

Please Log in or Create an account to join the conversation.

More
12 Feb 2018 05:49 #6025 by support
Replied by support on topic convert eventargs in delphi
It can have easily 5000 - 7000 bytes per one data change notification - are you OK with that?

Please Log in or Create an account to join the conversation.

More
12 Feb 2018 00:32 #6023 by alr1976
Replied by alr1976 on topic convert eventargs in delphi
Ok i Need more data in eventargs so is difficile recreate eventargs.... I prefer Serialize/Deserialize eventargs.... Can You show me with anche example how to do It in Delphi?
Thanks Alessandro

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 16:12 #6018 by support
Replied by support on topic convert eventargs in delphi
It has a ProgID of "System.Exception" so it should be creatable using that, but since we instruct our users to import the type libraries including the "mscorlib", there should be a wrapper class for in Delphi too.

Let me see.... yes, it is most likely CoCLRException, in the imported mscorlib_TLB.pas.

Regards

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 15:47 #6017 by alr1976
Replied by alr1976 on topic convert eventargs in delphi
Hi!

Thank you.....

How can I create _Exception?

Thank you

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 14:53 #6016 by support
Replied by support on topic convert eventargs in delphi
I understand now.

With the Succeeded property, it is similar to those before. It is also derived from something else. In this case, it is derived from the (read-write) property Exception. Succeeded is false when Exception is not null, and it is true when Exception is null.

So, if you are not interested in details of the error (exception), you can just "transmit" the boolean Succeeded value. Then, on the receiving end, when Succeeded was true, simply keep the Exception at null. When Succeeded was false, create instance of any Exception or some class derived from it, and assign it to the Exception. That should do it. You can even set its exception text to something to indicate "Due to transfer limitations, the true type of the exception, its message and other details are unknown.".

Best regards

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 14:33 #6015 by alr1976
Replied by alr1976 on topic convert eventargs in delphi
ok now I have HasGood,HasBad value in eventargs transfer only statuscode bytes. I need to have also eventargs.succeed so I transfer Boolean in remote computer. In remote computer I create eventargs to simulate my own data..... now I have transfer only data that I need....

before my problem was that Hasgood,HasBad are readonly so your support explain me that I need to transfer statuscode bytes to have exact Hasgood,Hasbad values.
Now I have transferred eventargs.succeed but I can change it in remote computer because it is readonly.

so in remote computer how can change succeed value?

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 14:21 #6014 by support
Replied by support on topic convert eventargs in delphi
I am sorry but I do not understand you now. Please try to formulate it in a different way and better.

Regards

Please Log in or Create an account to join the conversation.

More
09 Feb 2018 14:17 #6013 by alr1976
Replied by alr1976 on topic convert eventargs in delphi
Ok I have done all data that I need....

Missing only 1 data that is readonly .....

Succeeded

How can I change this data?

I need if data is available or not....

Please Log in or Create an account to join the conversation.

Moderators: support
Time to create page: 0.200 seconds

      

 Recommend this on Google