|
Hello again everyone,
I am posting this after a long night of research. Hopefully when I wake up I can begin to take whatever helpful information replied to this message and continue onwards.
My goal is to be able to read information from devices, and in this example my Network Interface Card.
I want to learn how to do this in C++ which is why I posted here instead of the Hardware and Devices section.
So what am I asking for? A good reference on where to start with reading information from hardware devices.
Once again thank you all in advance for pointing me in the right direction. This web site has been nothing but helpful to me and I learn something new every time I browse around.
V/R
Rob
|
|
|
|
|
You could find the MAC address by calling GetAdaptersInfo()[^]
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
rbwest86 wrote: ...reading information from hardware devices.
This is a bit vague. What exactly are you looking for?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Thanks for all to who responded. To answer your question, I am looking to retrieve any and all information if possible from any hardware device. This is a way for me to learn how to tap into the fingerprint of hardware devices such as (NIC)'s.
All for learning experience. I am taking a Networking class and want to make a simple program which can retrieve information from the (NIC) or entire network.
|
|
|
|
|
It's a broad subject. Some examples are here and here.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Depending on what kind of information about hardware you're looking for, you could always use WMI[^]
Judy
Be wary of strong drink. It can make you shoot at tax collectors - and miss.
Lazarus Long, "Time Enough For Love" by Robert A. Heinlein
|
|
|
|
|
Hi all,
i m using Beep and MessageBeep function to play a sound.
but both are not working in case of window server 2008.
here they not play any sound.
please help me for this.
explain me what can i do for this.
if any other function or method is possible please explain me.
thanks
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Le@rner wrote: not working
And what does that mean? The function doesn't succeed? In which case, have you tried checking the last error code by calling GetLastError() as the documentation states?
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
//for beep function
for(int i=750; i>100; i-=200)
Beep(i,50+i/5);
Beep( 150, 100 );
HRESULT lCode=GetLastError();
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
lCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR) &lpMsgBuf,0,NULL );
MessageBox((LPCTSTR)lpMsgBuf, _T("Error"), MB_OK | MB_ICONINFORMATION );
LocalFree( lpMsgBuf );
for MessageBeep function
MessageBeep(MB_ICONASTERISK);
HRESULT lCode=GetLastError();
LPVOID lpMsgBuf;
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL,
lCode, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPWSTR) &lpMsgBuf,0,NULL );
MessageBox((LPCTSTR)lpMsgBuf, _T("Error"), MB_OK | MB_ICONINFORMATION );
LocalFree( lpMsgBuf );
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Yeah, so the error states why the function failed.
I'll favour the other poster here. Like he asked: is it the same computer or a different one? If it's a different one, is there an audio device and the board has a speaker? (Do you see the volume control icon on the tray area?)
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
Errr.... I'm really NOT trying to be a wiseass... but does the server have a speaker?
L u n a t i c F r i n g e
|
|
|
|
|
I thought it were the same box which ran XP and the Server OS. I'll be shocked if they were different and one doesn't have a speaker.
But how funnier can this it were the latter case.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
It just sounded like something I'd do. I have a machine here that doesn't have external speakers, and the motherboard doesnt have one either, so it can't give the happy little beep when it boots. (Or any other time.)
L u n a t i c F r i n g e
|
|
|
|
|
i test my sound card and attach new speakers ,now its working fine.
thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Cool!
L u n a t i c F r i n g e
|
|
|
|
|
Hi,
I want to place the cursor by default in a edit box while launching a dialog. I am using m_ctrlEd.SetFocus() function.But its not wrking.Anyone please help me?
Thanks,
|
|
|
|
|
Karthika85 wrote: I am using m_ctrlEd.SetFocus()
from where are you calling that ?
|
|
|
|
|
Set the focus at the end of your WM_INITDIALOG handler, then return FALSE to prevent the system from setting focus to the default control.
L u n a t i c F r i n g e
|
|
|
|
|
In Dialog resource,
Tab numbers will be appear when you press Ctrl+D,
then you can set 1 to edit control. after run the application
automatically cursor will be appear on edit control.
Regards,
Srinivas
|
|
|
|
|
In addition to the comments about the OnInitDialog function, use the CDialog::GotoDlgCtrl[^] function to actually set the focus. See here[^] on why SetFocus should not generally be used in dialogs.
Steve
|
|
|
|
|
hi everybody, the C++ fstream's write operation is Sync or aSync?
|
|
|
|
|
it's buffered, so you might not see the data in the file until the buffer flushes.
|
|
|
|
|
so the fstream's write operation will not be blocked?
|
|
|
|
|
I currently program in C# and decided to make a move to C++. I am finding it a little more difficult than I thought. I mean I am having trouble even reading a file. I am using XCode on Mac OS X Snow:
#include <cstdio>
#include <fstream>
#include <istream>
#include <ostream>
#include <iostream>
int main () {
using namespace std;
ifstream in("/Users/Dixon/MyFile.rtf");
if (not in)
perror("/Users/Dixon/MyFile.rtf");
else {
int x(0);
while (in >> x)
{
cout << x << '\n';
}
cout << "Ending....";
in.close();
}
}
Output:
[Switching to process 16406]
Running…
Ending....
Debugger stopped.
Program exited with status value:0.
Ok, now I understand I am not getting any errors when opening this file. The problem is it isn't reading anything from it. I have put 5 lines in there (just one word on each line). Now according to my book (Exploring C++ by Apress), this hsould work. This code is pretty much exactly from their book. Except in their book they used a list1302.in file as I used a RTF file. Maybe that is the problem? I really don't know what an IN file is exactly (coming from Windows world)
|
|
|
|
|
Ok im back tracking on my reading.. so the point is to read integers from a file. So I changed the words in my rtf file to just numbers and I still get nothing?
|
|
|
|