S
ssndk123
Hi,
I'm trying to include some C functions from IOPort.h/cpp to my C++
program.. i placed the IOPort.h into stdafx, but when I try to
compile i get the errors like: ioport.h(8) : error C2065: 'UINT' :
undeclared identifier. So, the Visual Studio 2005 compiler doesn't
know what UNIT is?
Am I doing something wrong? I attached my code below.
I'd appreciate any help..
Thanks,
Soren
-------------------------------------------------
stdafx.h:
-------------------------------------------------
#pragma once
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP
or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to
target other versions of Windows.
#endif
#include <stdio.h>
#include <tchar.h>
#include "IOPort.h"
-----------------------------------------------
IOPort.h:
------------------------------------------------
#ifndef IOPORTH
#define IOPORTH
#ifdef __cplusplus
extern "C" {
#endif
void outport(UINT portid, UINT value);
void outportb(UINT portid, BYTE value);
BYTE inportb(UINT portid);
UINT inport(UINT portid);
BOOL StartUpIoPorts(UINT PortToAccess, BOOL bShowMessageBox, HWND
hParentWnd);
#ifdef __cplusplus
}
#endif
#endif
---------------------------------------------------
testmain:
----------------------------------------------------
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
char i;
cout << "Hello World!!";
cin >> i;
return 0;
}
I'm trying to include some C functions from IOPort.h/cpp to my C++
program.. i placed the IOPort.h into stdafx, but when I try to
compile i get the errors like: ioport.h(8) : error C2065: 'UINT' :
undeclared identifier. So, the Visual Studio 2005 compiler doesn't
know what UNIT is?
Am I doing something wrong? I attached my code below.
I'd appreciate any help..
Thanks,
Soren
-------------------------------------------------
stdafx.h:
-------------------------------------------------
#pragma once
#ifndef _WIN32_WINNT // Allow use of features specific to Windows XP
or later.
#define _WIN32_WINNT 0x0501 // Change this to the appropriate value to
target other versions of Windows.
#endif
#include <stdio.h>
#include <tchar.h>
#include "IOPort.h"
-----------------------------------------------
IOPort.h:
------------------------------------------------
#ifndef IOPORTH
#define IOPORTH
#ifdef __cplusplus
extern "C" {
#endif
void outport(UINT portid, UINT value);
void outportb(UINT portid, BYTE value);
BYTE inportb(UINT portid);
UINT inport(UINT portid);
BOOL StartUpIoPorts(UINT PortToAccess, BOOL bShowMessageBox, HWND
hParentWnd);
#ifdef __cplusplus
}
#endif
#endif
---------------------------------------------------
testmain:
----------------------------------------------------
#include "stdafx.h"
#include <iostream>
using namespace std;
int main()
{
char i;
cout << "Hello World!!";
cin >> i;
return 0;
}