what's wrong with this

This is a discussion on what's wrong with this within the Windows Programming forums, part of the Platform Specific Boards category; Dear All, I have a program like: Code: void CProjDlg::OnCalculte() { typedef UINT (CALLBACK* LPFNDLLFUNC1)(INT,INT); typedef UINT (CALLBACK* LPFNDLLFUNC2)(INT); HINSTANCE ...

  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
    Registered User Codeplug's Avatar
    Join Date
    Mar 2003
    Posts
    4,691

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 04: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, 01: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, 02:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21