|
system can not execute the projct
|
|
|
|
|
system information hardware.software by abbas riaz;have 32 errors hw can i used it ??????????????????
error list is
ysInfoDefs.cpp(695) : error C2065: 'DRIVE_LAYOUT_INFORMATION_EX' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(695) : error C2146: syntax error : missing ';' before identifier 'dli'
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(695) : error C2065: 'dli' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(709) : error C2065: 'IOCTL_DISK_GET_DRIVE_LAYOUT_EX' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(718) : error C2228: left of '.PartitionCount' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(721) : error C2228: left of '.PartitionCount' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(726) : error C2228: left of '.PartitionStyle' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(728) : error C2065: 'PARTITION_STYLE_MBR' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(728) : error C2051: case expression not constant
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(732) : error C2228: left of '.Mbr' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(732) : error C2228: left of '.Signature' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(736) : error C2065: 'PARTITION_STYLE_GPT' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(736) : error C2051: case expression not constant
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(740) : error C2228: left of '.Gpt' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(740) : error C2228: left of '.DiskId' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(743) : error C2228: left of '.Gpt' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(743) : error C2228: left of '.StartingUsableOffset' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(745) : error C2228: left of '.Gpt' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(745) : error C2228: left of '.UsableLength' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(747) : error C2228: left of '.Gpt' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(747) : error C2228: left of '.MaxPartitionCount' must have class/struct/union type
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(751) : error C2065: 'PARTITION_STYLE_RAW' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(751) : error C2051: case expression not constant
C:\Documents and Settings\amna\Desktop\sys\SysInfoDefs.cpp(761) : warning C4065: switch statement contains 'default' but no 'case' labels
SysInfoDlg.cpp
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(305) : error C2065: 'CSIDL_WINDOWS' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(311) : error C2065: 'CSIDL_SYSTEM' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(359) : error C2065: 'CSIDL_LOCAL_APPDATA' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(365) : error C2065: 'CSIDL_MYDOCUMENTS' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(371) : error C2065: 'CSIDL_PROGRAM_FILES' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(401) : error C2065: 'CSIDL_ADMINTOOLS' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(425) : error C2065: 'CSIDL_PROFILE' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(461) : error C2065: 'CSIDL_COMMON_ADMINTOOLS' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(467) : error C2065: 'CSIDL_COMMON_APPDATA' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(473) : error C2065: 'CSIDL_COMMON_DOCUMENTS' : undeclared identifier
C:\Documents and Settings\amna\Desktop\sys\SysInfoDlg.cpp(479) : error C2065: 'CSIDL_COMMON_TEMPLATES' : undeclared identifier
Generating Code...
Error executing cl.exe.
SysInfo.exe - 34 error(s), 1 warning(s)
|
|
|
|
|
i know it,please install the Platform sdk that visual studio 6.0 can use version(2003 february)
modified on Friday, May 21, 2010 3:42 AM
|
|
|
|
|
Hi Razi,
Your source for retrieving system informations is very good and very clear!
It helped me a lot with a small project (getting status and notifications of a server, when something is not working properly). The other acrticles of yours are also very good, especially the one about GPS. I just want to say thank you for your good help.
**We are an example of helping each other**
|
|
|
|
|
Hi,
Thanks for your comment.
Best regards,
A. Riazi
|
|
|
|
|
Mr. A.Razi,
I hope you can answer on this question, if you're able to make some time free in your valueble free spare time. How can I distinguish between a USB memory stick and a Harddisk drive? Because when I connect a usb stick into the pc, I get the USB memory size and etc...
Suddenly in my mind comes up to check the filesystem type ( HDD = NTFS, USB = FAT32 ), something like that. What do you think about that?
**We are an example of helping each other**
|
|
|
|
|
Yep, really great job!
Keep up the good work.
Regards
|
|
|
|
|
Can you give me any tips to create a new partition in Hard Disk?
|
|
|
|
|
I have some questions about HD Physical information. Can you help me in this regard.
Questions:
1)Where the Physical information( say Cylinder, Head, Sector)reside?
2) How can I get these information?
|
|
|
|
|
Dear All,
When I try to download the source,
A pop-up window displayed asking for username and password.
I have provided my code project username and password and clicked ok - still I am unable to download the source.. help me..
|
|
|
|
|
Hi, great program.
Any code or thoughts on how to detect S.M.A.R.T. info for SCSI drives?
Thanks,
Will
|
|
|
|
|
I tried to retrive the CPU serial number of the AMD 64 but it doesn't work . What must I do to get the 64 bit procesor serial number.
Thanks
|
|
|
|
|
If I remembered correctly, the code only works with Intel CPUs. Try google or AMD site to find some code for retrieving CPU serial number.
Best regards,
A. Riazi
|
|
|
|
|
Hi Abbas
I compiled and executed your sample, I recieved a error in the edit box when I chose Partitions from the combo. So I took a look a your source code.
Heres what I discovered:
In QueryPartitions funtion, the call to DeviceIoControl will sometimes fail with the error code ERROR_INSUFFICIENT_BUFFER. This is because the struct DRIVE_LAYOUT_INFORMATION_EX that needs to be passed to DeviceIoControl is variable length, the size of the data returned depends on the number of drives, and partitions.
In addition, some driver implementations will return a partial buffer, they will simply write whatever data they can fit into the buffer. DeviceIoControl will fail with error code ERROR_MORE_DATA in this case.
These conditions can be handled by doing the following:
First change variable dli declaration to:
DRIVE_LAYOUT_INFORMATION_EX* dli = NULL;
Here is the code to insert:
DWORD dwbytes=0;<br />
DWORD dwlastErr = 0;<br />
int i=0;<br />
<br />
do<br />
{<br />
if(NULL != dli)<br />
{<br />
delete[] (char*)dli;<br />
dli = NULL;<br />
}<br />
<br />
DWORD datasize = sizeof(DRIVE_LAYOUT_INFORMATION_EX) + i * sizeof(PARTITION_INFORMATION_EX);<br />
dli = (DRIVE_LAYOUT_INFORMATION_EX*)new char[datasize];<br />
if(dli)<br />
{<br />
bResult=DeviceIoControl(hDevice,IOCTL_DISK_GET_DRIVE_LAYOUT_EX,NULL,0,dli, datasize,&dwbytes,(LPOVERLAPPED) NULL);<br />
dwlastErr = GetLastError();<br />
i++;<br />
}<br />
}<br />
while((dwbytes == 0 && dwlastErr == ERROR_INSUFFICIENT_BUFFER) || dwlastErr == ERROR_MORE_DATA);
The code needs to be modified here:
while (hDevice!=INVALID_HANDLE_VALUE)<br />
{<br />
***DELETE OLD CODE HERE***<br />
***INSERT NEW CODE HERE***<br />
<br />
if (bResult)<br />
{<br />
Then at the bottom of the QueryPartitions function add:
if(NULL != dli)<br />
{<br />
delete[] (char*)dli;<br />
dli = NULL;<br />
}
I believe something similar is required for each function where you are calling DeviceIoControl. Additional error handling is required.
Thanks for your articles, I look forward to your future contributions!
-Randor (Dave Delaune)
|
|
|
|
|
Hi A.Riazi, can I call you like that.I'm a student from Viet Nam and I'm doing a project to get system information but it's hard to find document about this topic.I have seen your code but I don't know how it's work .Can you give or introduce me some document about getting system information.
-- modified at 6:34 Tuesday 11th April, 2006
|
|
|
|
|
Hi,
You have two options for getting system informations:
1- WMI
2- Win32 API (like the one that I did).
I suggest you to read Win32 API documentations.
Best regards,
A. Riazi
|
|
|
|
|
I see that you have use assembly code in your source .What does it do?
-- modified at 4:15 Wednesday 12th April, 2006
|
|
|
|
|
The assembly code was written by someone else for getting CPU info.
A. Riazi
|
|
|
|
|
hi mr a. riazi
i need your help
in a smal project can u contact me plz
quraischi@msn.com
hello world
|
|
|
|
|
Can you please include a function to retrieve hard Drive serial number (atleast first drive). It would be very helpful.
Thanks
nomi
knowmi@gmail.com
|
|
|
|
|
i am getting compilation error
CSIDL_WINDOWS etc.
as undeclared identifier.
i read the solution for it posted.but i couldn'g understand that.
can u just explain how and what i have to add breifly.
|
|
|
|
|
At line 286 in SysInfoDefs.cpp you wrote:
ceil(memoryStatus.dwTotalPhys/1024/1024)
It should be:
ceil(memoryStatus.dwTotalPhys/1024.0/1024.0)
if you want the ceil function to have an effect.
The best would be:
ceil(memoryStatus.dwTotalPhys/1048576.0)
One division less
Crayon
|
|
|
|
|
Thanks for your comment.
Best regards,
A. Riazi
|
|
|
|
|
is it possible for a certain drive name (for example "C:\") on which IDE Hard drive. For computers that have more than one harddrive.
Thanks Ugur Basak
|
|
|
|
|
I've modified QueryHDDSmartCommand, i use a variable strDriveName="\\\\.\\c:"
and changed
if ((hSMARTIOCTL = CreateFile(strDriveName, 0,0,0,
CREATE_NEW, 0, 0)) == INVALID_HANDLE_VALUE)
and
if ((hSMARTIOCTL = CreateFile(strDriveName,GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ|FILE_SHARE_WRITE,NULL,
OPEN_EXISTING,0,NULL)) == INVALID_HANDLE_VALUE)
its working. Thanks anyway, your article is really excellent.
|
|
|
|