Dear All,
I have a program like:
Code:
void CProjDlg::OnCalculte()
{
typedef UINT (CALLBACK* LPFNDLLFUNC1)(INT,INT);
typedef UINT (CALLBACK* LPFNDLLFUNC2)(INT);
HINSTANCE hDLL; // Handle to DLL
LPFNDLLFUNC1 Output; // Function pointer
LPFNDLLFUNC2 Input; // Function pointer
INT Addr;
INT AddrIn;
INT Value;
hDLL = LoadLibrary("Inpout32");
if (hDLL != NULL)
{
Output = (LPFNDLLFUNC1)GetProcAddress(hDLL,"Out32");
Input = (LPFNDLLFUNC2)GetProcAddress(hDLL,"Inp32");
if (!Output || !Input)
{
// handle the error FreeLibrary(hDLL);
}
}
Addr = 0x378;
AddrIn = 0x379;
Value = 0;
Output(Addr, Value);
int somenum = Input(Addr);
m_value=somenum;
UpdateData(0);
}
but it cannot get the data from parallel port running in windows NT, what is the wrong? Thank u.