unmanaged code

isey78

New member
Joined
Mar 12, 2007
Messages
2
Hi all (im newbie to .net)

Ive download a dev kit, and am trying to access the functions from the dll. my question is can u makes calls from .net if the dll is written in c++ ? this is called unmanaged code, right? i try two methods, let me giv an examples cause neither way is working..

Code:
Public Class Form1
    Declare Auto Function MP_GetSwType Lib _
        "C:\Documents and Settings\Computer 31\Desktop\SDK\MultiXtR.DLL" () As String
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Console.Write(MP_GetSwType())
    End Sub
End Class

I get this error:

Unable to find an entry point named MP_GetSwType in DLL C:\Documents and Settings\Computer 31\Desktop\SDK\MultiXtR.DLL.

Thanks any for help

isEy
 
Is MP_GetSwType the actual name of the function exported from the dll? Does the manufacturer of this dll have any accompanying documentation that details what functions it exports?

Also if this is a C++ function being exported there is a chance the name will have been mangled by the compiler.
 
yes, here is the describtion included with the manufacturer documents provided in the dev kit

LPCSTR MP_GetSwType( void )

This function will return the version type of the current software library.

sorry, I wasnt sure which info i could provide to help. also this was included in a "MultiXtR.h" file (just showing a couple examples)

// Functions which affect the entire DLL
MULTIXTR_API void MP_Open( void );
MULTIXTR_API void MP_Close( void );
MULTIXTR_API LPCSTR MP_GetSwType( void );
MULTIXTR_API LPCSTR MP_GetSwVersion( void );
 
:eek:

You can do that to a .dll file?

I always thought using an unmanaged code would be by adding it as a reference and using it as an object in my code.

:p
 
You could try changing the Auto declaration to Ansi and see if that fixes the problem
Code:
Declare Ansi Function MP_GetSwType Lib _
        "C:\Documents and Settings\Computer 31\Desktop\SDK\MultiXtR.DLL" () As String
but other than that Im a bit stumped.

Does the company who makes this software provide ant .Net dlls / sdks?
 
Back
Top