473,395 Members | 1,762 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 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 1096

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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.