473,624 Members | 2,254 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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
UpdateListViewD elegate(System: :Collections::H ashtable ^map);

private: System::Void UpdateListView( System::String ^symbol,
System::Collect ions::Hashtable ^map)
{
if(listView1->InvokeRequir ed == false)
{
System::Windows ::Forms::ListVi ewItem ^item =
listView1->FindItemWithTe xt(symbol);

System::Collect ions::IEnumerat or^ myEnum =
map->GetEnumerator( );

while(myEnum->MoveNext())
{
System::Collect ions::Dictionar yEntry ^de =
dynamic_cast<Di ctionaryEntry^> (myEnum->Current);

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

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

int index = FindColunmIndex Du(key);

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

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

item->UseItemStyleFo rSubItems = false;
}
else
{
UpdateListViewD elegate ^UpdateLstDeleg =
gcnew UpdateListViewD elegate(this,
&Form1::UpdateL istView);

this->BeginInvoke(Up dateLstDeleg,
gcnew cli::array<Obje ct^>{symbol,map });
}
}
}

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

System::Collect ions::Hashtable ^hash = gcnew
System::Collect ions::Hashtable ();

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

}

}
Nov 17 '05 #1
0 1119

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

Similar topics

1
1570
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 way that the data is published(pushed) to the browser in realtime so that the webpage does have to request or poll for a refresh?
9
2627
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) making it invisible and have used this whenever i needed it. dat1.databasename = app.path & "mydatabase.mdb" dat1.recordsource = "my query" dat1.refresh
10
2543
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
6322
by: aikwee | last post by:
is it possible to make a thread priority to realtime mode in vb.net ?
2
1070
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 think it is possible? Thank you!
4
1513
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 leaving any error message or error traceback at all. After the incident, the OS itself (linux) appears to remain fully functional. Thank you! malv
1
1449
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) to the machine. The machine has about a dozen status indicators; things like over-temp, powerfail, and so on.
0
1100
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 database(oracle). so what should i do in order to select the realtime data by using a value which i select from the database.. could someone pls help me..
4
4732
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 "textbox" to give realtime update, a status window. it seems that in some part of the program the window form goes blank and there is no status. however once the program stops i get my textbox/status updates.
0
8675
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8619
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8334
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8474
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6108
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4078
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1784
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1482
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.