|
By using GetAdaptersInfo() function, you could get MAC address. Check here[^] for code snippet.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thank you. you're so kind.
|
|
|
|
|
Jusef Marzbany wrote: Thank you. you're so kind. Rose
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Do you mean this: http://en.wikipedia.org/wiki/MAC_address[^]? If you do, a MAC address belongs to the network card in the computer (can also belong to a modem or other network-connected device), so if a computer has no network card it has no MAC address either, also if you change the network card (like, you buy a new one) you get a new MAC address, also these can be spoofed. Don't know if this applies to your case or not or if this is usefull information for you or not, but i thought i mention it, maybe it helps some way to clear up possible misunderstandings. Good luck with whatever you are doing.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Sometimes, I don't know how do I aprociate. You're so kind. thank you.
|
|
|
|
|
Hi
I have a CString variable in my class like bellow i want to initialize it to nothing which way is best
Here i listed two ways. If any way is best why?
class MyClass
{
CString name;
MyClass()
{
name = _T(""); //way 1
name.Empty(); //way 2
}
}
Thanks in advance
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
what about
MyClass() : name(_T(""))
{
}
|
|
|
|
|
As far as i know CString's default constructor initializes it to an empty string anyways, so you don't have to do that explicitly. Or am i wrong?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Code-o-mat wrote: CString's default constructor initializes it to an empty string anyways, so you don't have to do that explicitly.
Indeed!
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi
Can I write a windows service and create a UI thread in it which should be able to identify / receive windows messages and process them? Is a window / dialog needed for a UI thread so that it can handle windows messages?
Thanx
|
|
|
|
|
Well, window messages can only be sent to a window so you will actually need one to receive window messages. But you can run a message queue in a thread that has no windows in it and handle process/thread messages (which aren't directed towards any particular window).
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
You can associate a hidden window with a service.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Hi
Is it possible to associate a hidden window with a service, moreover it is generally advised not to write interactive services (which have windows) and not use MFC support for windows services. So, how do I proceed?
Thanx
|
|
|
|
|
true... interactive services are become less viable in the newer versions of windows.
So, to have some sort of UI that controls your service, you'll could write a 2nd program which interacts with the service and serves as it's UI. You can use FindWindow to get the window to post messages to. There are other ways to communicate with a service that doesn't involve a window -- named pipes, tcp, mailslots, stuff like that.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Hi, I have a application and I would like to command lien pass parameters to it. But in other exe this command line parameter is null.
STARTUPINFO SI;
PROCESS_INFORMATION PI;
SI.cb = sizeof(STARTUPINFOW);
SI.lpReserved = NULL;
SI.lpDesktop = NULL;
SI.lpTitle = NULL;
SI.dwX = CW_USEDEFAULT;
SI.dwY = CW_USEDEFAULT;
SI.dwXSize = CW_USEDEFAULT;
SI.dwYSize = CW_USEDEFAULT;
SI.dwXCountChars = 0;
SI.dwYCountChars = 0;
SI.dwFillAttribute = 0;
SI.dwFlags = STARTF_USESHOWWINDOW;
SI.wShowWindow = SW_SHOWNORMAL;
SI.cbReserved2 = 0;
SI.lpReserved2 = NULL;
SI.hStdInput = 0;
SI.hStdOutput = 0;
SI.hStdError = 0;
CString sCmdLin = " UserID";
BOOL bRet = CreateProcess( m_sProductPath+"\\B.exe",
sCmdLin,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&SI,
&PI);
After changing sCmdLin parameter to sCmdLin = "UserID" OR sCmdLin = " /UserID". But still i m unable to get the command line parameter in process B.exe. Pls suggest.
Thanks
SNI
|
|
|
|
|
Possibly you've to pass "B.exe UserID" as second parameter.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
First, note that the CreateProcess() lpCommandLine parameter is an inout
parameter in the Unicode version, so whatever you pass a pointer to technically
needs to be writable (up to 32,768 characters). If that's not feasible, you should
instead append the commandline to the lpApplicationName parameter string and pass NULL
as the lpCommandLine parameter.
Second, if you're not getting the passed commandline parameter(s) in the spawned app,
try starting the commandline parameter string with whitespace.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
|
|
Read this[^].
It is quite similar to what I always do when developing solutions for serial communication.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
I want to do two to three tasks at the same time at regular interval ,time is important so i m using multimedia timer .
problem is ....timer run the thread only once .code is below
when I click button thread is created and multimedia timer is set.
count is an integer initialized with 0
void CTimerDlg::Onbtnstart()
{
Thread=AfxBeginThread(ThreadDisplay, this, THREAD_PRIORITY_TIME_CRITICAL,0 ,CREATE_SUSPENDED);
handle=Thread->m_hThread;
Thread->m_bAutoDelete=false;
timeSetEvent(100, 0, TimeProcVideo, (DWORD)this, TIME_PERIODIC);
}
//thread analyzing data
UINT ThreadDisplay(LPVOID lParam)
{
CTimerDlg *obj=(CTimerDlg*) lParam;
obj->abc();
return 1;
}
void CTimerDlg::abc()
{
count++;
char a[20];
GetDlgItem(IDC_STATIC)->SetWindowText("");
CString s=itoa(count,a,10);
GetDlgItem(IDC_STATIC)->SetWindowText(s);
SuspendThread(handle);
}
void CALLBACK TimeProcVideo(UINT uID, UINT uMsg, DWORD dwUser, DWORD dw1, DWORD dw2)
{
CTimerDlg* timer=(CTimerDlg*) dwUser;
timer->ControlThreads();
}
void CTimerDlg::ControlThreads()
{
ResumeThread(handle);
}
modified on Friday, November 28, 2008 11:18 PM
|
|
|
|
|
|
i want to show some icons or bitmaps on status bar, how can i do this?
thanks in advance.
|
|
|
|
|
This[^]might help
Some things seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|