When I use this code :
Code:
#include <windows.h>
#include <iostream>
#define Data 0x378
using namespace std;
int main(int argc, char *argv[])
{
HINSTANCE oz;
oz=LoadLibrary("inpout32.dll");
typedef int (_stdcall function)(char *a,int b);
function *func;
func=GetProcAddress(oz,"Out32");
func(Data,254);
system("PAUSE");
return EXIT_SUCCESS;
}
I get this error :
C:\Dev-Cpp\main.cpp In function `int main(int, char**)':
C:\Dev-Cpp\main.cpp In function `int main(int, char**)':
C:\Dev-Cpp\main.cpp In function `int main(int, char**)':
C:\Dev-Cpp\main.cpp In function `int main(int, char**)':
Now I have done this and I dont get any errors. Although I cant try coz this is a laptop .
Code:
#include <windows.h>
#include <iostream>
#define Data 0x378
using namespace std;
int main(int argc, char *argv[])
{
HINSTANCE oz;
oz=LoadLibrary("inpout32.dll");
typedef int (_stdcall function)();
function *func;
func=GetProcAddress(oz,"Out32");
system("PAUSE");
return EXIT_SUCCESS;
}
However the code I want to apply is this :
Code:
#include <windows.h>
#include <iostream>
#define Data 0x378
using namespace std;
int main(int argc, char *argv[])
{
HINSTANCE oz;
oz=LoadLibrary("inpout32.dll");
typedef int (_stdcall function)();
function *func;
func=GetProcAddress(oz,"Out32");
func(Data,254);
system("PAUSE");
return EXIT_SUCCESS;
}
Because I only want pin 2 to go high in parallel port. However I get this error :
C:\Dev-Cpp\main.cpp In function `int main(int, char**)':
C:\Dev-Cpp\main.cpp In function `int main(int, char**)':
C:\Dev-Cpp\main.cpp In function `int main(int, char**)':
I feel like my first code makes sense as Out32(PORTvariable,value) is like this. Giving the value to the port adress which is 0x378, basically a char pointer ?