Expiring Today—Celebrate National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Problems including winioctl.h....

Posted on 2003-10-22
2
Medium Priority
?
770 Views
Last Modified: 2013-11-20
Hi,

my problem is this:
I use the function DeviceIoControl() with some parameters, and I have included winioctl.h, but the compiler can't find those parameters declared in that file. Here's the code:

#include "stdafx.h"
#include "windows.h"
#include "iostream.h"
#include "winioctl.h"

int main(int argc, char* argv[])
{
      HANDLE hFind;
      DWORD outputBufferSize;
      FILE_OBJECTID_BUFFER outputBuffer;

      ---
                some code here...(getting the handle etc.)
                ---

      DeviceIoControl(hFind,
                   FSCTL_GET_OBJECT_ID,
                   NULL,
                   0,
                   outputBuffer,
                   sizeof(outputBuffer),
                   outputBufferSize,
                   NULL);


      return 0;
}

and I get these error-messages:

error C2065: 'FILE_OBJECTID_BUFFER' : undeclared identifier
error C2146: syntax error : missing ';' before identifier 'outputBuffer'
error C2065: 'outputBuffer' : undeclared identifier
error C2065: 'FSCTL_GET_OBJECT_ID' : undeclared identifier

What can be the problem?? I have included winioctl.h, and I have the SDK include library as the top path in options/directories...(it finds windows.h without any problems)
Any help would be appreciated.

/Nick
0
Comment
Question by:Nick_72
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 300 total points
ID: 9597982
FILE_OBJECTID_BUFFER

Windows NT/2000 or later: Requires Windows 2000 or later.
Windows 95/98/Me: Unsupported.
Header: Declared in Winioctl.h.


This means you need to add the following line:

#include "stdafx.h"
#define _WIN32_WINNT 0x0500          // add this
#include "windows.h"
#include "iostream.h"
#include "winioctl.h"


See MSDN topic "Using the SDK Headers".




0
 
LVL 9

Author Comment

by:Nick_72
ID: 9598097
Oh....thanks alot.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.

718 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question