jxz1995
-Interested User-
Posts: 24
Joined: Jan 9, 2006
|
Posted: Jan 9, 2006 03:34 PM
Msg. 1 of 6
1. I am using COM to get history data. I found if I add more than one event handler, my C# program crash. It will be fine for only one event handler. The following is the code DTNHistoryDay = new DTNHISTORYLOOKUPLib.HistoryLookupClass(); DTNHistoryDay.DayCompleted +=new DTNHISTORYLOOKUPLib._IHistoryLookupEvents_DayCompletedEventHandler(DTNHistory_DayCompleted); DTNHistoryDay.AbortedLoad +=new DTNHISTORYLOOKUPLib._IHistoryLookupEvents_AbortedLoadEventHandler(DTNHistoryDay_AbortedLoad);
Could you please let me know how I can work around it? I need to use the AbortedLoad to know the symbol is invalid or other errors.
2. Another question about request multiple symbols?
RequestDayHistory("MSFT", 300); RequestDayHistory("INTC", 300);
if I request two symbols, in the event _DayCompleted, I can't tell the which data is for which symbol, my current work around is to Request one symbol and wait for the first finishes and request the sencond one. Please let me know my work around is the only way or if there are other better ways.
Thanks.
|
jxz1995
-Interested User-
Posts: 24
Joined: Jan 9, 2006
|
Posted: Jan 9, 2006 03:45 PM
Msg. 2 of 6
The version I am using is 4.1. The 4.0 has the same crash issue.
Thanks.
|
David
-DTN Evangelist-
Posts: 113
Joined: May 7, 2004
I'd rather be...
|
Posted: Jan 9, 2006 04:00 PM
Msg. 3 of 6
Quote: if I request two symbols, in the event _DayCompleted, I can't tell the which data is for which symbol, my current work around is to Request one symbol and wait for the first finishes and request the sencond one. Please let me know my work around is the only way or if there are other better ways.
If you request more than one symbol the return information is interleaved. There is no packet/message id to separate the response messages. Use tcp/ip and open separate connections to get data on more than one symbol at the same time. You have to trap for all error message conditions and timeouts - things are a lot better re error responses in the version 4.xx series. GL! David IQXP Software http://www.iqxp.com
LiveWire Update Service PO Box 1417 Fairfield, IA 52556 641-472-8393 http://www.livewire-cablesoft.com/
|
jxz1995
-Interested User-
Posts: 24
Joined: Jan 9, 2006
|
Posted: Jan 9, 2006 04:14 PM
Msg. 4 of 6
David,
Thank you for the suggestion. I am using COM with C#. Does it mean that my workaround is the only to do it?
Thanks
Jim
|
David
-DTN Evangelist-
Posts: 113
Joined: May 7, 2004
I'd rather be...
|
Posted: Jan 9, 2006 04:38 PM
Msg. 5 of 6
FWIW: I gave up on com years ago but the DTN interface has progressed a lot. I suspect that the only solution if you stay with com is to wait for completion of the request before going on. But that is based on ignorance not actually having an implementation. I found the tcp/ip straight forward and finally with the cleaned up client reflected in version 4.xxx most errors are caught by DTN so time-outs are less frequent to non-existing. Unfortunately there is no way to clear or cancel the last request to the client so a non-response can be troublesome. David IQXP Software http://www.iqxp.com
LiveWire Update Service PO Box 1417 Fairfield, IA 52556 641-472-8393 http://www.livewire-cablesoft.com/
|
jxz1995
-Interested User-
Posts: 24
Joined: Jan 9, 2006
|
Posted: Jan 9, 2006 06:52 PM
Msg. 6 of 6
David,
Thank you for your suggestion. I will use TCP/IP instead of COM.
Jim
|