dcsimg
Results 1 to 2 of 2

Thread: [RESOLVED] C++ DLL into VB.net

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    89

    Resolved [RESOLVED] C++ DLL into VB.net

    guys,
    I need to add the DLL which is developed in C++. I have the source though, but not in a mood of working on that whole bunch of DLL codes... rather planning to use it as required...

    Now, I can add the DLL in different ways.. lat few days spent time doing googling to figure out the way as I failed to add the DLL via reference. Then I found the hint in here:

    https://stackoverflow.com/questions/...essible-and-th and

    http://www.vbforums.com/showthread.p...-(Return-Data)

    Based on this, I started to work on... till now it seems to be a promising option... but i need to convert the thing into VB.net... The DLL ref manual is given in attachmentAttachment 156425

    Now my vb.net code is:

    Code:
    Imports System.Runtime.InteropServices
    
    Public Class Form1
    
        <DllImport("CRT_288_K001.dll")> Public Shared Function CRT288CROpenWithBaut(ByRef Port As Char, ByVal Baudrate As UInteger) As IntPtr
        End Function
    
        <DllImport("CRT_288_K001.dll")> Public Shared Function RS232_ExeCommand(ByVal ComHandle As IntPtr, ByVal TxCmCode As Byte, ByVal TxPmCode As Byte,
    ByVal TxDataLen As Integer, ByVal TxData As Byte, ByRef RxReplyType As Byte, ByRef RxStCode1 As Byte, ByRef RxStCode0 As Byte,
    ByRef RxDataLen As Integer, ByVal RxData As Byte) As Integer
        End Function
    please tell me if i am wrong

  2. #2

    Thread Starter
    Lively Member
    Join Date
    May 2017
    Posts
    89

    Re: C++ DLL into VB.net

    OK, so after compiling, it is showing me this:

    System.EntryPointNotFoundException: 'Unable to find an entry point named 'CRT288CROpenWithBaut' in DLL 'CRT_288_K001.dll'.'


    So what exactly i need to do??

    im using VS 2017 with vb.net

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width