Results 1 to 6 of 6

Thread: hardware interface dll invalid

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    11

    hardware interface dll invalid

    I am attempting to write some interface code for a piece of hardware. Because the hardware requires use of 12 control lines, I believe the parallel port is the easiest connection method. After some research, I have discovered that inpout32.dll is the most efficient solution with only two commands to worry about (inp32() and out32()). I have downloaded the dll and attempted to place it in my code using both dim and declare statements. The file resides in the root level of the project folder as well as another copy in the windows directory. No matter how I try to call the dll it gives me errors stating that libraries were expected and that the dll does not exist.

    Any ideas?
    Thanks in advance

  2. #2
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: hardware interface dll invalid

    Hey.
    Next time post the functions definitions, i had to go search for them.
    Anyhow you need API and you must do this:

    Code:
    Imports System.Runtime.InteropServices
    Public class '......etc
    
        <DllImport("inpout32.dll", EntryPoint:="Out32")> _
         Public Shared sub Out _
              (ByVal address As Integer, ByVal value As Integer)
        End Function
    
     <DllImport("inpout32.dll", EntryPoint:="Inp32")> _
         Public Shared Function [In] _
              (ByVal address As Integer) as Integer
        End Function
    Now i don't know if this will work but it will see the dll.Note you have to copy the dll in windows\system32 folder and another note that if you are using 64bit system it will fail and you probably have to search for a 64bit version of the dll.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  3. #3

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    11

    Re: hardware interface dll invalid

    I am confused as to what exactly what you wanted me to provide in the original post...

    I think I can follow what you posted but I am confused as to what I am calling after the functions are defined in this manner. Am I calling the function [out]_? If this is correct, where do I put the data to be handled by the function.

  4. #4
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: hardware interface dll invalid

    Err.Yes well didn't you have a dll function structure? Even if it was C language?
    This dll is quite popular as i see but if it was another dll where was i suppose to find out the declarations so i can convert them to vb?
    Anyhow, yes you will use p.e. Out(800,55) or dim i as integer = [in](555).You can change the out and [in] with another name if you want.If they are confusing you.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

  5. #5

    Thread Starter
    New Member
    Join Date
    Aug 2010
    Posts
    11

    Re: hardware interface dll invalid

    thanks for the speedy reply, I will give this a try ASAP. I have a question though: because the machine I am working on does not have a parallel port, when I compile the program will it also include all dependencies i.e. inpout32.dll? Or will I manually have to copy this file?

  6. #6
    King of sapila
    Join Date
    Oct 2006
    Location
    Greece
    Posts
    6,763

    Re: hardware interface dll invalid

    If you mean creating a setup then you will have to include the dll.
    Else, yes you must provide the dll also.
    ἄνδρα μοι ἔννεπε, μοῦσα, πολύτροπον, ὃς μάλα πολλὰ
    πλάγχθη, ἐπεὶ Τροίης ἱερὸν πτολίεθρον ἔπερσεν·

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width