Hi,
When I develop a VC++ program with eSignal Desktop API, I encountered a very strange problem:
My program requests quote data, time&sale data, it works well in my computer (Windows XP professional), it also works in my friend's computer(Winodws 2000 server), BUT, the time&sale DOES NOT WORK in the Server(Windows 2000 advanced server) !!
Following is my code snippet:
SCODE EventSink::OnTimeSalesChanged(long lHandle)
{
TimeSalesData item;
long lNumBars, lNumRtBars, lBar, lDiff;
lNumRtBars = (*theApp.m_piHooks)-> GetGetNumTimeSalesRtBars(lHandle); // ** Gets number of real-time bars
// ** I requested real-time data, but lNumRtBars often return 0
// ** When lNumRtBars > 0, the real-time time&sale data is what I want
lNumBars = (*theApp.m_piHooks)->GetGetNumTimeSalesBars(lHandle); // ** Gets number of historical bars
// ** I know lNumBars is not necessary, copied from sample code in developer's guide
// ** Check whether lHandle exists, (it does exist, don't worry about this part)
intitem* pIntItem = theCfg.mtmselhdmap.FindItem(lHandle);
if (!pIntItem) {
theCfg.mlog.AddLogStrFmt("Can't find handle:%d", lHandle);
return S_OK;
}
st_symbol* pst = (st_symbol*)pIntItem->val;
lDiff = (lNumRtBars - pst->mtimesalelastbarnum) * -1;
for (lBar=lDiff + 1; lBar<=0; lBar++) {
item = (*theApp.m_piHooks)->GetGetTimeSalesBar(lHandle, lBar);
// ** After this statement, OnTimeSalesChanged RETURN immediately ! why?
// ** Check time&sale data, send it to other servers, ...
... ...
}
}
I spent lots of time to figure it out, but failed. I don't understand why time&sale data has such strange problem while quote data has no problem (quote data is OK in windows 2000 server, advanced server, windows XP professional).
My code is based on the sample C++ code and desktop API developer reference.
Does anyone can help me? My boss is very unhappy about this problem.
Thanks
When I develop a VC++ program with eSignal Desktop API, I encountered a very strange problem:
My program requests quote data, time&sale data, it works well in my computer (Windows XP professional), it also works in my friend's computer(Winodws 2000 server), BUT, the time&sale DOES NOT WORK in the Server(Windows 2000 advanced server) !!
Following is my code snippet:
SCODE EventSink::OnTimeSalesChanged(long lHandle)
{
TimeSalesData item;
long lNumBars, lNumRtBars, lBar, lDiff;
lNumRtBars = (*theApp.m_piHooks)-> GetGetNumTimeSalesRtBars(lHandle); // ** Gets number of real-time bars
// ** I requested real-time data, but lNumRtBars often return 0
// ** When lNumRtBars > 0, the real-time time&sale data is what I want
lNumBars = (*theApp.m_piHooks)->GetGetNumTimeSalesBars(lHandle); // ** Gets number of historical bars
// ** I know lNumBars is not necessary, copied from sample code in developer's guide
// ** Check whether lHandle exists, (it does exist, don't worry about this part)
intitem* pIntItem = theCfg.mtmselhdmap.FindItem(lHandle);
if (!pIntItem) {
theCfg.mlog.AddLogStrFmt("Can't find handle:%d", lHandle);
return S_OK;
}
st_symbol* pst = (st_symbol*)pIntItem->val;
lDiff = (lNumRtBars - pst->mtimesalelastbarnum) * -1;
for (lBar=lDiff + 1; lBar<=0; lBar++) {
item = (*theApp.m_piHooks)->GetGetTimeSalesBar(lHandle, lBar);
// ** After this statement, OnTimeSalesChanged RETURN immediately ! why?
// ** Check time&sale data, send it to other servers, ...
... ...
}
}
I spent lots of time to figure it out, but failed. I don't understand why time&sale data has such strange problem while quote data has no problem (quote data is OK in windows 2000 server, advanced server, windows XP professional).
My code is based on the sample C++ code and desktop API developer reference.
Does anyone can help me? My boss is very unhappy about this problem.
Thanks
Comment