Solved

Problems including winioctl.h....

Posted on 2003-10-22
2
746 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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
haveThree challenge 22 123
canBalance challenge 34 104
JQuery tracking event. 3 84
x-bar in Google Sheets 2 91
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will learn how to dynamically set the form action using jQuery.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

680 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