Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

Hi all (i'm newbie to .net)

 

I've 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..

 

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

  • Administrators
Posted

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.

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Posted

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 wasn't 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 );

Posted

: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

Amir Syafrudin
  • Administrators
Posted

You could try changing the Auto declaration to Ansi and see if that fixes the problem

Declare Ansi Function MP_GetSwType Lib _
       "C:\Documents and Settings\Computer 31\Desktop\SDK\MultiXtR.DLL" () As String

but other than that I'm a bit stumped.

 

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

Posting Guidelines FAQ Post Formatting

 

Intellectuals solve problems; geniuses prevent them.

-- Albert Einstein

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...