472,954 Members | 2,359 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,954 software developers and data experts.

C++/CLI Realtime Data intensive Application

Hello

I have created a realtime data intensive application in C++/CLI. Data
streams into this application through a set of ActiveX controls. For
example, each stock symbol will be assigned to one of these controls and
the symbol will be updated through one of the events of these controls.

Symbols and their corresponding data are displayed in a listview. Data
is updated few times a second per symbol.

Unfortunately I have encountered several problems:

1) CPU utilization of this app is quite high for a sustained period of
time. Utilization of up to 100% is often seen for close to a minute at
a time.

2) The ever nagging Listview flickering problem which is constant due to
the rapid data updates.

Below is the relevant fragment of code. Is the basic use of delegates
correct? Is there any way to avoid the flicker? BeginUpdate and
EndUpdate make the app unusable!

Any general or specific hint or help is greatly appreciated.

Regards

---------------------------------------

public ref class Form1 : public System::Windows::Forms::Form
{

private: delegate System::Void
UpdateListViewDelegate(System::Collections::Hashta ble ^map);

private: System::Void UpdateListView(System::String ^symbol,
System::Collections::Hashtable ^map)
{
if(listView1->InvokeRequired == false)
{
System::Windows::Forms::ListViewItem ^item =
listView1->FindItemWithText(symbol);

System::Collections::IEnumerator^ myEnum =
map->GetEnumerator();

while(myEnum->MoveNext())
{
System::Collections::DictionaryEntry ^de =
dynamic_cast<DictionaryEntry^>(myEnum->Current);

System::String ^key =
dynamic_cast<System::String^>(de->Key);
System::String ^value =

dynamic_cast<System::String^>(de->Value);

int index = FindColunmIndexDu(key);

item->SubItems[index]->Text = value;

item->SubItems[index]->BackColor = Color::Lime;

item->UseItemStyleForSubItems = false;
}
else
{
UpdateListViewDelegate ^UpdateLstDeleg =
gcnew UpdateListViewDelegate(this,
&Form1::UpdateListView);

this->BeginInvoke(UpdateLstDeleg,
gcnew cli::array<Object^>{symbol,map});
}
}
}

private: System::Void TRecordSet_DataChange(System::Object^ sender,
DataChangeEvent^ e)
{
TRecordSet ^obj = safe_cast<TRecordSet^>(sender);

System::Collections::Hashtable ^hash = gcnew
System::Collections::Hashtable();

hash->Add("Open", obj->GetOpenStr());
hash->Add("High", obj->GetHighStr());
...
...
...
UpdateListView(obj->GetSymbolStr(), hash);
}

}

}
Nov 17 '05 #1
0 1079

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: rawCoder | last post by:
Hi, (NOTE: For the following post, please Only Consider HTTP Via WebBrowser) Data Publishing over HTTP is 'pull' based, i.e. the browser has to request(refresh) to get data. Is there any...
9
by: the_grove_man | last post by:
I guess my question can go in two directions. I create applications that run multiple queries against a database. Generally speaking in the past I have used a Data Control (calling it dat1)...
10
by: Rafał | last post by:
Hi. Timer in C# not work, Thread + Loop + Sleep + DateTime.Now too not work (Process.Prioritet = RealTime) What i do wrong? Best regards. Rafal
6
by: aikwee | last post by:
is it possible to make a thread priority to realtime mode in vb.net ?
2
by: Bill | last post by:
Hi all, I have little experience of B/S application. I face a project that marketing want a pure B/S structure.But the refresh rate is 60 times/sec at the most,For example,a realtime curve. Do you...
4
by: malv | last post by:
How would you approach the following? In a multithreaded realtime data acquisition system (all python v2.4), after hours of running without a snag, without warning python hangs at once without...
1
by: CptDondo | last post by:
OK, let me explain what I am trying to do. I have an embedded PC that runs a httpd+php server and controls a machine. I have a browser front end that provides the HMI (human machine interface)...
0
by: noxs | last post by:
hello..im using vb.net,but my prob is i wanted to get data from a datagrid which contain a realtime data (using port reader).but the way of gettin it is by using parsing value which i get from the...
4
by: =?Utf-8?B?YXVsZGg=?= | last post by:
hello, i'm not sure if this is possible. i have a small VS 2005 C# windows application. it has a textbox and a button. once the user presses the button it fires off many tasks. i want to use the...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
1
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.