isey78 Posted March 16, 2007 Posted March 16, 2007 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 Quote
Administrators PlausiblyDamp Posted March 16, 2007 Administrators Posted March 16, 2007 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. Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
isey78 Posted March 16, 2007 Author Posted March 16, 2007 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 ); Quote
amir100 Posted March 20, 2007 Posted March 20, 2007 :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 Quote Amir Syafrudin
Administrators PlausiblyDamp Posted March 20, 2007 Administrators Posted March 20, 2007 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? Quote Posting Guidelines FAQ Post Formatting Intellectuals solve problems; geniuses prevent them. -- Albert Einstein
Recommended Posts