|
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?
|
|
|
|
|
An rtf file includes formatting - so there is more in the file than just what you typed. Try using a plain text file with several integers typed into it.
|
|
|
|
|
I still can't seem to get it to work. I saved that RTF file as TXT and I also coded this to try to get it to work:
ofstream out("/Users/Dixon/test1.txt");
if (not out)
perror("/Users/Dixon/test1.txt");
else {
out << "1" << "2" << "3" << "4" << "5" << "6";
out.close();
ifstream in("/Users/Dixon/test1.txt");
if (not in)
perror("/Users/Dixon/test1.txt");
else {
int x(0);
while (in >> x)
{
cout << x << '\n';
}
in.close();
}
}
So I made it create a file with the words 123456 in it, close it then open it to read.. but it doesn't read!
|
|
|
|
|
I have also tried this: (from: http://www.cplusplus.com/doc/tutorial/files/[^])
#include <iostream>
#include <fstream>
#include <string>
int main () {
using namespace std;
string line;
ifstream myfile("/Users/Dixon/test1.txt");
if (myfile.is_open())
{
while (! myfile.eof())
{
getline(myfile,line);
cout << line << endl;
}
myfile.close();
}
else {
cout << "Unable to open file";
}
return 0;
}
But I seem to get:
[Switching to process 17059]
Running…
Exploration 13(17059) malloc: *** error for object 0x10000a700: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Program received signal: “SIGABRT”.
sharedlibrary apply-load-rules all
(gdb)
If I change this:
while (! myfile.eof())
to:
while (myfile.eof() != false)
it runs but still does not read anything
|
|
|
|