|
A client rect always starts from 0,0. You can convert between different coordinate spaces by calling MapWindowPoints
|
|
|
|
|
how could i do it?
thanks!
|
|
|
|
|
kfaday!
You are not lazy, are you
Here is the declaration from MSDN:
void MapWindowPoints( CWnd* pwndTo, LPRECT lpRect ) const;
which I strongly suggest for reading (http://www.msdn.microsoft.com/[^]).
Something like:
CStatic* pflecha = ( CStatic* ) GetDlgItem( IDC_FLECHA );
pflecha->GetClientRect( &flecharect );
pflecha->MapWindowPoints( this, &flecharect );
should get flecharect in the coordinate space for the owning window.
|
|
|
|
|
thanks!!
that did it!!
msdn makes me dizzy sometimes..
there are many MapWindowPoints functions
|
|
|
|
|
Hie, I am a beginner in MFC programming.I want to know how to create a reset button using MFC.
Thanks in advance.
syasya
|
|
|
|
|
You draw a button in the resource editor and label it "Reset"
For more detailed help, you should probably try to describe what you want the button to do.
|
|
|
|
|
I am using Visual C++ 6.0 and am having problems with the threads dialog box. I find that after suspending execution and opening the threads box, sometimes not all the threads in the process are displayed. I can see the threads in a suspended state in Spy++ though.
Has anyone encountered this problem? Any help would be appreciated.
thanks
Man Learns from History that he never learns from History
|
|
|
|
|
I developped a program to communicate on serial port com. It works fine on xp/W2000.
Then I wanted to include this into a bigger project, so I decided to change it into a dll. It works fine on W2000, but the same application using the same dll sometimes doesn't work on WXP.
When I say it doesn't work I mean that the thing that reiceives the data transferred on the serial link acts as if the flow (115200 bauds) was interrupted sometimes.
The priority level of the emission thread is equal to the reception one: THREAD_PRIORITY_HIGHEST. So it should not be interrupted I think. Unless the fact that it is a dll's thread changes the situation?
Does anybody have an idea?
Thanks
|
|
|
|
|
Hello..
Does any one know how to use a managed dll in normal c++. I have written a managed dll with c++.net and i want to use it in my normal c++ project (ide c++.net 2003) Could any one tell me if its possible... or how??
Thank you in advance for taking the time to read this message
|
|
|
|
|
Hi guys
I've reduced the size of a CCombobox and the original font size now is bigger than the edit box part of the combo.
What's the fastest way to change the font size of the combobox?
There is a way without have to derive a new class?
Best Regards
Doc
|
|
|
|
|
Add a CFont member variable (e.g., m_font ) to the dialog's class declaration. In the OnInitDialog() method, add:
m_font.CreateStockObject(ANSI_FIXED_FONT);
m_combobox.SetFont(&m_font);
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
I am able to get the MAC address of any machine connected in my LAN network .
Now How should I extend this app to obtain the MAC address of a remote machine?
Experts Guide
Regards
Black Tiger 007
|
|
|
|
|
blacktiger007 wrote:
How should I extend this app to obtain the MAC address of a remote machine?
What do you mean by "remote?" Any machine besides the one running the code is remote. Yes?
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
typedef byte SkNetMAC[6];
bool FkNetGetMacA( CkStr SA, SkNetMAC &MAC )
{
if( SA.IsEmpty() ) return(false);
#if 1 // get local or remote MAC given an IP using ARP (Win2K+)
ulong rc = 0,
ml = sizeof(MAC);
IPAddr ip = inet_addr( SA.PtrSafe(0) );
rc = ::SendARP(ip, 0, (ulong*)&MAC, &ml);
#else // get local MAC associated with IP by querying adapter info (Win*)
ulong rc = 0,
al = 0;
IP_ADAPTER_INFO *ai = NULL,
*ac = NULL;
IP_ADDR_STRING *ip = NULL;
rc = ::GetAdaptersInfo(ai, &al);
if( rc != ERROR_BUFFER_OVERFLOW ) return(false);
ai = (IP_ADAPTER_INFO*)ckMemTemp.Calloc(al);
if( !ai ) return(false);
rc = ::GetAdaptersInfo(ai, &al);
if( rc != ERROR_SUCCESS ) goto e_FkNetGetMacA;
for( ac = ai; ac; ac = ac->Next ) {
for( ip = &ac->IpAddressList; ip; ip = ip->Next ) {
if( SA == ip->IpAddress.String ) {
FkMemCpy(ac->Address, &MAC, sizeof(MAC));
goto e_FkNetGetMacA;
}
}
}
e_FkNetGetMacA:
ckMemTemp.Free(ai);
#endif
return(true);
}
...cmk
Save the whales - collect the whole set
|
|
|
|
|
Am looking for PHP code to get the Mac address of a machine and I think you got the answer.
|
|
|
|
|
hi there,
I am using WaitForMultipleObjects api function . always it works fine. but some times the function could not return. even after the timeout periord elapsed. i think it will be a problem of dead lock . how can i avoid the same.
advance thaks for your help.
thanks and regards
S. Mohamed Hasan.
|
|
|
|
|
hi there,
I am using WaitForMultipleObjects api function . always it works fine. but some times the function could not return. even after the timeout periord elapsed. i think it will be a problem of dead lock . how can i avoid the same.
advance thaks for you help.
thanks and regards
S. Mohamed Hasan.
|
|
|
|
|
Hi,
If you create a thread using ::CreateThread(...) it returns a handle to the thread. Once the thread has completed its job the thread has two options depending on other factors whether it will call ::ExitThread(...) or just return.
The question is, do you have to call ::CloseHandle(...) on each of the handles passed back by ::CreateThread(...)?
cheers,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning." -- Rich Cook
|
|
|
|
|
Yes you *DO* need to use CloseHandle for each thread you have created.
Ant.
I'm hard, yet soft. I'm coloured, yet clear. I'm fuity and sweet. I'm jelly, what am I? - David Williams (Little Britain)
|
|
|
|
|
Yes, you must close all handles that you're given. Failing to do this causes the kernel's internal thread object to leak (it's reference counted). The only exceptions are the pseudo-handles you get from GetCurrentThread or GetCurrentProcess . The OS will clean up any outstanding handles when your process ends, but you shouldn't rely on this.
Typically if I don't actually need a handle I'll close it straight away.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Dear Friends,
I wish to operate a Dialog Based application(Say Server) depending upon the command send by the Client.
Please help me by giving me a simple example to do so.
Thanking you in advance.
Regards,
Billar
|
|
|
|
|
|
Hi,
I am developing Addins for office application n i want to load the Addin when the application launches. Anybody please tell how do i start with.....
Thank You
Vishal More
|
|
|
|
|
I have been having a problem deploying a Visual Studio application. It is quite a simple standalone application, but when deployed nothing happens when it is run.
I did a Viaual Basic 6.0 simple application and using the VB deployment facilities it runs OK.
Another Visual Studio application, much larger than the one that does nothing when run, works OK.
Does anyone know if this is a known Windows problem and if they are a work around.
I did use another project groups InstallShield to deploy the application, but that also did nothing when run.
|
|
|
|
|
You will want to test your app with depends.exe, which you will probably find on your harddisk. You will probably have to install the MFC dll as a part of the deployment, for example.
You will also want to make sure what all the dependencies are, as some are not redistributable and some are standard on all Windows installations. Search for the DLL-name on MSDN.
You will also want to version check DLL:s you install, unless you enjoy creating havoc and being all-round impopular. Your installset creator (which seems to be InstallShield) will have support for this.
If you have never deployed applications before, be very, very careful when doing this.
|
|
|
|