|
The signal strength values comes from a receiver, very much like a radio which will be connected to our serial port.
I am not sure the method you were referring( maybe you can further elaborate in a simple way which i can easily understand?). What I did was my program will be collect signal strength values at the predefined frequency. As the signal strength value of a fixed frequency keep on changes, I created a timer with 250ms time interval to read and update the display. This timer will trigger an event to collect signal strength and update the meter
-- modified at 11:05 Tuesday 6th February, 2007
|
|
|
|
|
Take a look at these[^] articles.
They are aimed at game developers and outline some of the timing issues related to running games at the same speed on various PC's. I feel they relate quite closely to what you are trying to do.
|
|
|
|
|
Your main problem is that the application slow and inresponsive, right?
Is your application multithreaded?
How do you interface with the serial port?
Does the receiver require you to request each sample, or is it sent automatically?
Are you using overlapped I/O? If you're not, then each call to ::ReadFile() will "hang" the application until something is received if the call is made from the primary thread.
There's a fairly large risk that it's the serial communication part that's causing you troubles. Have a look at Joe Newcomer's article on serial communication and see if that helps: clickety[^].
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Hi,
I need to do that develop a tree tree control within ListCtrol. How can i do this ?
Can any one suggest me in this ?
Thanks.
|
|
|
|
|
|
<br />
class base<br />
{<br />
protected:<br />
base() { }<br />
};<br />
<br />
class derived : public base<br />
{<br />
public:<br />
derived() { }<br />
};<br />
<br />
int main()<br />
{<br />
derived* d = new derived; <br />
<br />
}<br />
<br />
Since the base constructor is protected, is creating a derived class in function main() legal? gcc does not give even a warning. I was looking for a means to prevent creation of instances of derived class.
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Thomas George wrote: Since the base constructor is protected, is creating a derived class in function main() legal?
Yes, it is.
Thomas George wrote: I was looking for a means to prevent creation of instances of derived class.
Make derived class's c'tor as private , or protected if want to make it inheritable.
|
|
|
|
|
Thank you
modified 29-Aug-18 21:01pm.
|
|
|
|
|
You using public inheritance which gives the subclass access to protected members of the baseclass.
Declare the base class ctor as private, then the inheritance type won't matter.
You could also use protected or private inheritance:
class derived : protected base
class derived : private base ...but then the protection would be the responsability of the subclass which is not so great even if it's syntachtically correct.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Thank you. I will check it out.
modified 29-Aug-18 21:01pm.
|
|
|
|
|
I have got a window divided into 4 parts by means of a splitter. Each part is a CView-derived view which will display a jpeg image.
My problem lies in getting each view to display an image. After I select an image then the window appears transparent and only becomes opaque when I click on the menu bar. The image in the first view remains being displayed but the images in the rest of the views disappear. I have overriden the Paint function so the images should be repainted but this doesn't help.
I am using Visual Studio 2003 on Windows XP SP2.
Any help will be appreciated.
I am the handsome one in the crowd.
|
|
|
|
|
Are all the views displaying the same image?
|
|
|
|
|
No. Each View will display a different image. Each time File Open is selected from the menu then the next view is given an image to display. So eventually all 4 views will have a different image in it.
I am the handsome one in the crowd.
|
|
|
|
|
Are you using Doc/View architecture?
Regardless, each "view" window needs to have access to the image data so it can redraw the image
when necessary (tyically redrawing is done in response to a WM_PAINT message).
|
|
|
|
|
Yes I am using the Doc\View architecture. I have overriden the WM_PAINT and each view then should redraw/paint its own image. I am using CPicture as found here:
http://www.codeproject.com/bitmap/pictureshow.asp[^].
I tried storing the CPicture variable in the CDocument derived class but it seems only one CDocument is created for all 4 views.
I am the handsome one in the crowd.
|
|
|
|
|
Franz Klein wrote: but it seems only one CDocument is created for all 4 views
That's what I was afraid of
Do you create all 4 views at the start before you have 4 documents?
If so then Doc/View will get in your way a bit since a CView has no way to set a document later.
Maybe create the views with an "empty" document - by empty, I mean with some flag or variable
that indicates the image isn't loaded/available yet. When the image becomes available, use
CDocument::UpdateAllViews() to force a refresh on the views.
In your view classes you can override OnDraw() instead of handling WM_PAINT.
|
|
|
|
|
Hi,
I am making VC++.NET windows application. I made a configuration file (app.config) for my database server settings. But when I am trying to get setting from the file using “ConfigurationSettings” class I am getting NULL in it. Here is my code for that.
NameValueCollection* configCol = ::ConfigurationSettings::AppSettings;
Can I know what is the problem in this?
Thanks in advance,
Priyank
|
|
|
|
|
|
hi experts
my problem is something like this..
i have a main dialogue in which i have a list control, and in the main dialogue i also have tab control. on the tabpane i have a list control again.
now my job is when i click on an item in the list control of my main dialogue and press ADD button on the main dialogue, that item should be added to the list control in tabpane, but this is not happening. please help me.
note: instead of having ADD button in the main dialogue , if i have it in tabpane itself the above problem is not there. and i am able to add the item from list control of main dialog to list contrtol of tab pane but i cannot have ADD button in tabpane
Harsha
|
|
|
|
|
Can you post following code :
- Event handler when you click on the button
- Adding the string to the list in the tab control
Company policy : no access to the internet but CP
~RaGE()
|
|
|
|
|
This below event handler belongs to ADD button of main dialogue
void CNewUiDlg::OnBnClickedAdd()
{
CPhoneBook m_ph(this);
CString val;
int mark=m_mainlist.GetSelectionMark();
m_checken=m_mainlist.GetItemText(mark,0);
//m_ph.AddtoPB(m_checken);
}
This below function belongs to class that is controling tab pane
BOOL CPhoneBook::AddtoPB(CString s)
{
m_phoneval=s;
m_listphone.InsertItem(0,m_phoneval);
m_listphone.SetItemText(0,1,m_address);
UpdateData(false);
//MessageBox(m_phoneval); the message box displays the string
}
Instead if we add an ADD button to the tabpane itself and add the handler as below it works and displays the contents from list control of main dialogue to list control of tabpane
void CPhoneBook::OnBnClickedAdd()
{
m_listphone.InsertItem(0,m_checken);
m_listphone.SetItemText(0,1,m_address);
}
Harsha
|
|
|
|
|
can you show the code inside the button click of Add.
nave
|
|
|
|
|
This below event handler belongs to ADD button of main dialogue
void CNewUiDlg::OnBnClickedAdd()
{
CPhoneBook m_ph(this);
CString val;
int mark=m_mainlist.GetSelectionMark();
m_checken=m_mainlist.GetItemText(mark,0);
//m_ph.AddtoPB(m_checken);
}
This below function belongs to class that is controling tab pane
BOOL CPhoneBook::AddtoPB(CString s)
{
m_phoneval=s;
m_listphone.InsertItem(0,m_phoneval);
m_listphone.SetItemText(0,1,m_address);
UpdateData(false);
//MessageBox(m_phoneval); the message box displays the string
}
Instead if we add an ADD button to the tabpane itself and add the handler as below it works and displays the contents from list control of main dialogue to list control of tabpane
void CPhoneBook::OnBnClickedAdd()
{
m_listphone.InsertItem(0,m_checken);
m_listphone.SetItemText(0,1,m_address);
}
Harsha
|
|
|
|
|
harsh_2961 wrote: int mark=m_mainlist.GetSelectionMark();
you should not use GetSelectionMark() to get the selected item. Use GetNextItem instead. Also give show selection always style to list control and check. Let me know the result after this modification.
nave
|
|
|
|
|
Hello everybody,
I'm trying to port old apps to the new system (the express version), just before buying the new VC8 software.
I've found this: in the old code there is a #include <fstream> clause in one of the implementation files (and it works).
In the new VC8, it appears an error that says: fatal error C1083: Cannot open include file: 'fstream.h': No such file or directory
Any idea on how to solve that?
As always thank you in advance.
|
|
|
|