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
Solved

Problems including winioctl.h....

Posted on 2003-10-22
2
744 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
2 Comments
 
LVL 48

Accepted Solution

by:
AlexFM earned 75 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Problem to event 3 102
Message not shown 5 67
Increment column based of a FK 8 31
I could not set window to top 4 21
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…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
The viewer will learn how to dynamically set the form action using jQuery.
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 …

837 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