Click here to Skip to main content
15,899,679 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionproject wizard in vs2010 not work properly, and the project can't be created. Pin
followait11-Nov-10 21:44
followait11-Nov-10 21:44 
AnswerRe: project wizard in vs2010 not work properly, and the project can't be created. Pin
Richard MacCutchan11-Nov-10 22:13
mveRichard MacCutchan11-Nov-10 22:13 
GeneralRe: project wizard in vs2010 not work properly, and the project can't be created. Pin
followait12-Nov-10 2:13
followait12-Nov-10 2:13 
GeneralRe: project wizard in vs2010 not work properly, and the project can't be created. Pin
Richard MacCutchan12-Nov-10 2:49
mveRichard MacCutchan12-Nov-10 2:49 
QuestionHow to hide System menu in MDI application without removing the close, minimize/maximize buttons Pin
Prasann Mayekar11-Nov-10 19:35
Prasann Mayekar11-Nov-10 19:35 
QuestionOnNCHitTest Pin
satkan11-Nov-10 18:09
satkan11-Nov-10 18:09 
AnswerRe: OnNCHitTest Pin
Kelly Herald11-Nov-10 18:35
Kelly Herald11-Nov-10 18:35 
QuestionEvery time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
Aseem Sharma11-Nov-10 11:48
Aseem Sharma11-Nov-10 11:48 
Hello friends,

I am using MAC address to implement licensing in my application. As far as I know, MAC address of every system is unique and is very commonly used for licensing purpose.

For giving license of my application, I generate a unique key based on MAC address of a particular system and send that key to the customer. But the problem is that every time I format my system, I get a different MAC address. Doing this is problematic as every time customer format his system, he will need a new key (as his MAC address will also change on formatting his system).

Another problem is that if someone have two OS say XP and VISTA on his machine, he'll need two different keys to activate the license on both of the OS.

What I want, I get same MAC address even though customer keep on formatting his system (so that he can use same key every time). Also I get same MAC address on all the Operating Systems on a single machine (so that he can use same key on all the Operating Systems on his machine). Is it possible to do so? If yes then how? If not then why not? Please help me.

Right now I am using below code to get MAC address of a system:

std::string strMACAddress;
try
{
	PIP_ADAPTER_INFO pAdapterInfo = NULL;
	ULONG ulOutBufLen = sizeof (IP_ADAPTER_INFO);
	pAdapterInfo = new IP_ADAPTER_INFO();
	if (pAdapterInfo == NULL)
	{
		return;
	}

	// Make an initial call to GetAdaptersInfo to get
	// the necessary size into the ulOutBufLen variable
	int iResult = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen);
	if ( iResult == ERROR_BUFFER_OVERFLOW )
	{
		delete pAdapterInfo;
		pAdapterInfo = new IP_ADAPTER_INFO[ulOutBufLen];
		if (pAdapterInfo == NULL)
		{
			return;
		}
	}

	if ( iResult != ERROR_SUCCESS )
	{
		iResult = GetAdaptersInfo(pAdapterInfo, &ulOutBufLen);
		if ( iResult != ERROR_SUCCESS )
		{
			delete pAdapterInfo;
			pAdapterInfo = NULL;
			return;
		}	
	}

	strMACAddress = pAdapterInfo->AdapterName;
	delete pAdapterInfo;
	pAdapterInfo = NULL;
}
catch (...)
{
}


Thanks in advance,
Best Regards
Aseem
AnswerRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
enhzflep11-Nov-10 15:34
enhzflep11-Nov-10 15:34 
GeneralRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
Aseem Sharma11-Nov-10 19:27
Aseem Sharma11-Nov-10 19:27 
AnswerRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
cp987611-Nov-10 19:52
cp987611-Nov-10 19:52 
GeneralRe: Every time I format my system, I get a different MAC address (Windows XP, VISTA and Windows7). Why I am not getting same MAC every time? Pin
Aseem Sharma12-Nov-10 5:58
Aseem Sharma12-Nov-10 5:58 
QuestionAdvice on resolving access violation exception. Pin
Chris Meech11-Nov-10 8:21
Chris Meech11-Nov-10 8:21 
AnswerRe: Advice on resolving access violation exception. Pin
Maximilien11-Nov-10 8:59
Maximilien11-Nov-10 8:59 
GeneralRe: Advice on resolving access violation exception. Pin
Chris Meech11-Nov-10 9:13
Chris Meech11-Nov-10 9:13 
Questionhelp translate the problem of network projects Pin
linhluu11-Nov-10 6:48
linhluu11-Nov-10 6:48 
AnswerRe: help translate the problem of network projects Pin
Richard MacCutchan11-Nov-10 22:19
mveRichard MacCutchan11-Nov-10 22:19 
QuestionCreating Library Modules in VS ...?? Pin
AmbiguousName11-Nov-10 1:40
AmbiguousName11-Nov-10 1:40 
AnswerRe: Creating Library Modules in VS ...?? Pin
Richard MacCutchan11-Nov-10 2:20
mveRichard MacCutchan11-Nov-10 2:20 
AnswerRe: Creating Library Modules in VS ...?? Pin
«_Superman_»11-Nov-10 6:23
professional«_Superman_»11-Nov-10 6:23 
QuestionHow to make it effective to ::SetSysColors(COLOR_SCROLLBAR...)? Pin
dancingfish11-Nov-10 0:29
dancingfish11-Nov-10 0:29 
AnswerRe: How to make it effective to ::SetSysColors(COLOR_SCROLLBAR...)? Pin
«_Superman_»11-Nov-10 6:28
professional«_Superman_»11-Nov-10 6:28 
QuestionAudio Detect from Microphone problem Pin
cougar1010-Nov-10 21:05
cougar1010-Nov-10 21:05 
QuestionHow to add Image as Object on Image? Pin
002comp10-Nov-10 16:36
002comp10-Nov-10 16:36 
AnswerRe: How to add Image as Object on Image? Pin
«_Superman_»11-Nov-10 6:35
professional«_Superman_»11-Nov-10 6:35 

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.