something like this should work:
Code:
#include <windows.h>
typedef short _stdcall ( * InputProcedure )( short );
typedef short _stdcall ( * OutputProcedure )( short, short );
int
main( void )
{
HMODULE library = LoadLibrary( "inpout32.dll" );
if( library )
{
InputProcedure Inp32 = ( InputProcedure )GetProcAddress( library, "Inp32" );
OutputProcedure Outp32 = ( OutputProcedure )GetProcAddress( library, "Outp32" );
if( Inp32 && Outp32 )
{
Out32( 0x378, 54 );
short PortVal = Inp32( 0x378 );
cout << "recieved from port: " << PortVal << endl;
}
else
{
cerr << "GetProcAddress failed" << endl;
}
FreeLibrary( library );
}
else
{
cerr << "LoadLibrary failed" << endl;
}
return 0;
}