Thread: what's wrong with this

  1. #1
    Registered User
    Join Date
    Oct 2003
    Posts
    38

    what's wrong with this

    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.

  2. #2

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 03:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 10:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 12:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 01:04 PM