Topic Options
#4228 - 17 Jun 2015 03:41 PM Unsubscribe call crashes
billdea Offline
Junior Member

Registered: 11 Apr 2010
Posts: 11
I am having trouble using the pxCourseofSales.Unsubscribe function which keeps crashing in VBA. I successfully subscribe to some security’s course of sales, which keeps feeding back data as expected. If I subsequently want to subscribe to another Security and first call the Unsubscribe function, it crashes. Sometimes it gives an “access violation error” but usually it gives no error at all. Do I have to do anything before calling the function? What is the correct usage of the function?

Thanks

Top
#4229 - 17 Jun 2015 03:51 PM Re: Unsubscribe call crashes [Re: billdea]
Paul Klink Offline

Paritech
Active Member

Registered: 24 Jan 2002
Posts: 216
Loc: Melbourne
Hi billdea

Don't use xxx.Unsubscribe eg. pxCourseOfSales.Unsubscribe

pxCourseOfSales will automatically unsubscribe when all references to it are gone.

The API should really mark Unsubscribe as deprecated.

Regards, Paul

Top
#4230 - 17 Jun 2015 04:20 PM Re: Unsubscribe call crashes [Re: billdea]
billdea Offline
Junior Member

Registered: 11 Apr 2010
Posts: 11
In that case how to I re-initiate pxCourseOfSales to provide tick data from the start of day if I have previously called a security and have been purging History for it? Or do I just have to start storing all data as it is received in case I need it again?

Top
#4231 - 17 Jun 2015 04:31 PM Re: Unsubscribe call crashes [Re: billdea]
billdea Offline
Junior Member

Registered: 11 Apr 2010
Posts: 11
Just worked out I can set PxCourseOfSales to Nothing to start again!

Thanks for help
Bill

Top
#4291 - 04 Aug 2016 04:25 PM Re: Unsubscribe call crashes [Re: billdea]
John McNamara Offline
Member

Registered: 01 Feb 2007
Posts: 42
Loc: Melbourne
We just had the same problem with a previously API written program.
xxx.unsubscribe will cause the program to crash.

Removing the line fixed the issue.

System is Windows 7 also tested on Windows 10 Latest Pulse

Regards
John

Top