Results 1 to 2 of 2

Thread: Dll import

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Aug 2008

    Dll import

    HI All,
    In my project I'm trying tp interface an external device to my program via provided DLL.
    The code I tried to Import DLL is as follows:

    DllImport("libGEN.dll", CallingConvention:=CallingConvention.Cdecl, CharSet:=CharSet.Ansi)_
    Public Function GEN_Deinit() As _EN_STATUS
    End Function
    But when try to call this DLL call I'm Getting an error saying:

    "Unable to load DLL 'libGEN.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

    Can anybody please tell me what could be wrong?


  2. #2
    Frenzied Member Bulldog's Avatar
    Join Date
    Jun 2005
    South UK

    Re: Dll import

    A DLLImport is of the form;

    <DllImport("connectcodefont.dll")> _
     Public Shared Function Encode_Code128Auto(ByVal instr As String, ByVal outstr As System.Text.StringBuilder, ByVal outstrmax As Integer) As Integer
     End Function
    and you will also need an import as below;
    Imports System.Runtime.InteropServices
    Check that your DLL location is correct and check whether you have any dependencies (such as needing another DLL).

    Edit: There is a dependency checker at

    • If my post helped you, please Rate it
    • If your problem is solved please also mark the thread resolved

    I use VS2015 (unless otherwise stated).
    B.Sc(Hons), AUS.P, C.Eng, MIET, MIEEE, MBCS / MCSE+Sec, MCSA+Sec, MCP, A+, Net+, Sec+, MCIWD, CIWP, CIWA
    I wrote my very first program in 1979, using machine code on a mechanical Olivetti teletype connected to an 8-bit, 78 instruction, 1MHz, Motorola 6800 multi-user system with 2k of memory. Using Windows, I dont think my situation has improved.

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