Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Fri Oct 20, 2017 12:11 am
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Using Managed (.NET2) DLL in RB
PostPosted: Fri Mar 01, 2013 8:51 am 
Offline

Joined: Thu Feb 28, 2013 4:20 pm
Posts: 2
I am trying to interface to a USB IC with the DLL provided by the manufacturer. They gave a VB.NET example to get started, but I am unsure how to set up the entry point of the DLL in RB.
Here is the beginning of their example:

Imports System
'//STEP 1:
'// Add the DLL as a reference to your project through "Project" -> "Add Reference"
'// menu item within Visual Studio
Imports MCP2210 '//<---- Need to include this namespace
Module Module1
Sub Main()
'//Variables
Dim MCP2210_VID As UInt32 = &H4D8 '// VID for Microchip Technology Inc.
Dim MCP2210_PID As UInt32 = &HDE '// PID for MCP2210
Dim isConnected As Boolean = False '// Connection status variable for MCP2210
'//STEP 2:
'// Make an instance of the MCP2210.DevIO class by calling
'// the class constructor with the device VID and PID.
Dim UsbSpi As MCP2210.DevIO = New DevIO(MCP2210_VID, MCP2210_PID)
'//STEP 3:
'// Navigate the DLL classes to find your desired function. In this case,
'// we choose to check the connection status.
isConnected = UsbSpi.Settings.GetConnectionStatus()

I have used declare statements to access the functions, but of course they don't work because I have not set up the entry point (DevIO) properly.
Am I missing something simple?


Top
 Profile  
Reply with quote  
 Post subject: Re: Using Managed (.NET2) DLL in RB
PostPosted: Mon Mar 04, 2013 1:53 pm 
Offline

Joined: Mon May 31, 2010 5:35 am
Posts: 2412
Location: Netherlands
You can't use managed .net dll's.
Only c/c++ win32 dlls.

_________________
SWORT™
- Windows Vista, Windows XP, Windows 7, Linux Mint 11 and Mac OSX Lion
- REAL Studio Enterprise(latest) and WEB Edition(latest)
- Plugins (MBS Complete, ToringoLib, Einhugur, VanHoek + Some open source plugins)
For Dutch User Groups ask me to enter!


Top
 Profile  
Reply with quote  
 Post subject: Re: Using Managed (.NET2) DLL in RB
PostPosted: Mon Mar 04, 2013 9:55 pm 
Offline

Joined: Wed Mar 22, 2006 11:15 am
Posts: 712
Location: Southern California
Some suggestions...

* If you can find a VB6 or non-.NET C/C++ example you can probably use the provided library and code.

* There's an open source C/C++ library here. If you can compile it for your target platform then you can probably make calls to it.
https://github.com/kerrydwong/MCP2210-Library

* I believe it's possible to write a wrapper for a .NET DLL and expose the features you need using Visual Studio. Then you could use the resulting wrapper in Real Studio.

_________________
Daniel L. Taylor
Custom Controls for Real Studio WE!
Visit: http://www.webcustomcontrols.com/


Top
 Profile  
Reply with quote  
 Post subject: Re: Using Managed (.NET2) DLL in RB
PostPosted: Wed Mar 06, 2013 8:54 am 
Offline

Joined: Thu Feb 28, 2013 4:20 pm
Posts: 2
Thanks Daniel, number 3 may be my best bet for now. I wish these dlls could be used directly in RB, it is so much easier to deal with than VS. Also, big thanks for the second suggestion, I did not know that even existed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 5 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group