Click here to Skip to main content
15,926,035 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralProblem with Threads dialog box Pin
LasVegasGuy7-Jun-04 5:29
LasVegasGuy7-Jun-04 5:29 
Generalserial com port transmission Pin
jetournier7-Jun-04 5:27
jetournier7-Jun-04 5:27 
Generallinking managed dll to standard c++ Pin
Emiliano7-Jun-04 5:24
Emiliano7-Jun-04 5:24 
GeneralChange the font size in a CComboBox Pin
Anonymous7-Jun-04 4:12
Anonymous7-Jun-04 4:12 
GeneralRe: Change the font size in a CComboBox Pin
David Crow7-Jun-04 5:44
David Crow7-Jun-04 5:44 
GeneralExperts Guide regarding MAC Address of a remote machine. Pin
Member 11501767-Jun-04 3:59
Member 11501767-Jun-04 3:59 
GeneralRe: Experts Guide regarding MAC Address of a remote machine. Pin
David Crow7-Jun-04 5:09
David Crow7-Jun-04 5:09 
GeneralRe: Experts Guide regarding MAC Address of a remote machine. Pin
cmk7-Jun-04 22:40
cmk7-Jun-04 22:40 
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;
 
	// there can be a many to one relationship between
	// ip's and addapters - search adapters for matching IP
	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
GeneralRe: Experts Guide regarding MAC Address of a remote machine. Pin
simpocoder15-Jun-10 21:19
simpocoder15-Jun-10 21:19 
GeneralWaitForMultipleObject problem Pin
hasansheik7-Jun-04 3:55
hasansheik7-Jun-04 3:55 
GeneralWaitForMultipleObject problem Pin
hasansheik7-Jun-04 3:55
hasansheik7-Jun-04 3:55 
GeneralHandles of Threads Pin
RichardS7-Jun-04 3:50
RichardS7-Jun-04 3:50 
GeneralRe: Handles of Threads Pin
Antony M Kancidrowski7-Jun-04 4:11
Antony M Kancidrowski7-Jun-04 4:11 
GeneralRe: Handles of Threads Pin
Mike Dimmick7-Jun-04 4:16
Mike Dimmick7-Jun-04 4:16 
GeneralServer-Client Pin
Billar7-Jun-04 3:46
Billar7-Jun-04 3:46 
GeneralRe: Server-Client Pin
jmkhael7-Jun-04 4:57
jmkhael7-Jun-04 4:57 
GeneralLoading Addin Pin
vishalmore7-Jun-04 3:45
vishalmore7-Jun-04 3:45 
GeneralDeployment (Ms Issue ??) Pin
sweep1237-Jun-04 3:34
sweep1237-Jun-04 3:34 
GeneralRe: Deployment (Ms Issue ??) Pin
Johan Rosengren7-Jun-04 5:27
Johan Rosengren7-Jun-04 5:27 
QuestionHow to Share a Resource with 2 Timers Pin
jerry1211a7-Jun-04 3:23
jerry1211a7-Jun-04 3:23 
AnswerRe: How to Share a Resource with 2 Timers Pin
Cedric Moonen7-Jun-04 3:47
Cedric Moonen7-Jun-04 3:47 
AnswerRe: How to Share a Resource with 2 Timers Pin
erkanina7-Jun-04 3:59
erkanina7-Jun-04 3:59 
GeneralRegisterhotkey problems Pin
Abhi Lahare7-Jun-04 3:14
Abhi Lahare7-Jun-04 3:14 
Generalres: protocol Pin
Cristian Amarie7-Jun-04 3:02
Cristian Amarie7-Jun-04 3:02 
GeneralDeclaring a pointer to a class in VC++ Pin
Anonymous7-Jun-04 2:52
Anonymous7-Jun-04 2:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.