Witam, pisze prosty program do obsługi portu lpt za pomoca bibioteki inpout32. Sprawa wygląda tak program kompilował się poprawnie ale w trakcie pracy wyskakiwał bład dotyczący obługi ESP. Poszukłam troche i okazało się, że problemem jest brak __stdcall przy deklaracji zmiennych do obsługi bibioteki. Kiedy dodałem __stdcall pojawił się nowy błąd
Error 1 error C2059: syntax error : '('
Wydaje mi się że dobrze używam tej komendy. Z góry dzięki za pomoca. Używam VC++ 2008.
#include "stdafx.h"
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <iostream>
#include "moje.h"
using namespace std;
typedef USHORT __stdcall (*InPortType) (USHORT BasePort);
typedef void __stdcall (*OutPortType)(USHORT BasePort, USHORT value);
InPortType InPort;
OutPortType OutPort;
HMODULE hModule;
int main()
{
hModule = LoadLibrary (L"inpout32.dll");
if (hModule == NULL) return 0;
if (hModule)
{
InPort = (InPortType) GetProcAddress(hModule, "Inp32");
OutPort = (OutPortType) GetProcAddress(hModule, "Out32");
}
else{ cout<<"nie udalo się"; }
OutPort(0xFFF0, 0x00);
system("pause");
return 0;
}