|
You could do something like this:
<br />
CWnd* pWnd = CFrameWnd::GetFocus();<br />
Then you can work with pWnd, when really you are working with the control that has the focus. For testing purposes you can try this:
<br />
CWnd* pWnd = CFrameWnd::GetFocus();<br />
<br />
pWnd->SetWindowText("THIS WORKS MAN !!");<br />
Hope it helped...;)
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
while ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
thank you both for answering and helping
|
|
|
|
|
I'm looking for a way to limit the tcp/ip bandwidth of an application (or set of applications) from another application.
Basically I need to provide the facility to limit the upload and download KBytes/Sec of a set of processes, with the limits set by the application I am writing.
I know this is possible (as there are a number of applications out there that can do this, www.netlimiter.com is one example), however I need to be able to include the functionallity in my own program.
Any suggestions of what approach to take, where to look for ideas etc...?
Thanks...
Blade[DMS]
|
|
|
|
|
If it will help in your search, this technique is often called 'throttling'.
Elaine
The tigress is here
|
|
|
|
|
Thanks... Thats the word I was looking for
So far my search has lead me to "Packet Filtering" with potential solutions here on codeproject[^] for Win XP and 2000.
Not sure if this is the right direction to head yet tho...
Blade[DMS]
|
|
|
|
|
|
I'm currently modifying a program originally written in C, and I'm fairly inexperienced in programming using MFC and Visual C++
I have a class that gets read in from a menu command, which works OK.
How can I access this class from the automatically generated View classses so that I can display it?
Any help and/or comments are welcome
Keck
|
|
|
|
|
If you have the class in your document class use GetDocument() in your view class to get a pointer to the document and access the member variable from there.
John
|
|
|
|
|
Thanks - I realise now exactly what's going on in this case
thank you again
Working as intended
Keck
|
|
|
|
|
Hi, i want to block net access in pc (in a local network)
this pc connect to web althrought Proxy or connection
sharing. Can anyone help me, thank for advance.
|
|
|
|
|
Program the router to do so. For non sophisticated users, set up a firewall on the PC in question.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
|
I'm curious, is the intent here to keep another student or classmate from accessing the Internet?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thank, for your humour, but i search for this idea to
include it in my software dedicated for CyberCafe .
|
|
|
|
|
I see that when I step into OnHScroll() upon clicking the slider (not even sliding it, just clicking it) why does it step in three times and then finally show the adjusted display after exiting onHScroll?
Thanks,
ns
|
|
|
|
|
I saw that the third time, it steps in with nPos coming in as 0!!! Even though I scrolled right quite a bit, and nPos is NOT 0!. The nSBCode is END_SCROLL. Got around the problem by skipping the third step-in, but in another part of my project where the slider and SetBrightness() function both are in the same class (here they are in two different classes), the third time also, nPos is non-zero and really what it should be.
void CDlgSettings::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
pSld = (CSliderCtrl*)pScrollBar;
if (pSld !=0 && nSBCode != SB_ENDSCROLL)
{
if(*pSld == m_sliderBright)
{
m_pParentWnd->SetBrightness(nPos);
}
m_pParentWnd->DisplayLocal();
}
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
thanks,
ns
|
|
|
|
|
As Mike Dunn (I think) already pointed out, you should be doing using GetPos() to get the slider's current position and not the message-specific nPos value.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Yikes! I didnt see that response about SetPos.,.....
Thanks much! I must have missed it over the weekend.
|
|
|
|
|
ns wrote:
I must have missed it over the weekend
What!? You don't work weekends!? Oh I forgot, you're normal.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
haha! You are so funny!
Revamped my project yet again.....waiting for something new, but keep ripping up the current one and redoing it. Did a QT project a while ago.
The HScroll issue was so perplexing. Wonder why nPos cant be relied on....
|
|
|
|
|
I'm a wegular wiot, Alice!
ns wrote:
Wonder why nPos cant be relied on....
It can. A closer look at the documentation will reveal that nPos is only specified for the SB_THUMBPOSITION and SB_THUMBTRACK scroll message types. When you're done scrolling, Windows sends a WM_HSCROLL message with the SB_ENDSCROLL message type. In this case, nPos is zero (as it should be).
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I cannot see nothing strange here, are you sure that the "bug" is into this piece of code ??
I think Ravi is right... there's nothing that could be creating problems but of that...
Written by: Rafael Fernández López.
void life ( bool me, bool her )
{
while ( her )
{
me = true ;
}
else
{
me = false ;
} }
|
|
|
|
|
i have a mdi app (using vc++ 7) and i'm trying to enable keyboard accelerators. when there is no document open, the accelerators work fine. however, when a document is open, the accelerators do not work. i added a HACCEL member to my view class, initialized it with a call to ::LoadAccelerators() and overrode PreTranslateMessage() like so,
BOOL MyFormViewView::PreTranslateMessage(MSG* pMsg)
{
if ( CFormView::PreTranslateMessage(pMsg) )
return TRUE;
return ((FAccelTable != NULL) && ::TranslateAccelerator(m_hWnd, FAccelTable, pMsg));
}
as far as i can tell, FAccelTable is initialized properly.
what am i doing wrong?
thanks.
|
|
|
|
|
You need to create an accelerator table (resource) for each doc template.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
how do you associate the new accelerator table with the doc template? i tried using a new table with the method i described above, but it still didn't work.
|
|
|
|