473,396 Members | 2,147 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Using dll from VB.Net 2005 based on C++ example

1
Hi All,

I need to use an existing dll in VB for which I have been given example sourcecode in C++. At first I thought it can't be that complicated, but after spending hours and hours trying to get this to work using trial and error (and reading around on the web), I am now at a point where I am out of ideas.

The C-example code for invoking the DLL is

typedef struct _ELS_CARD_SOCKET_HANDLE {
UCHAR uSocket;
UCHAR uFunction;
} ELS_CARD_SOCKET_HANDLE, *PELS_CARD_SOCKET_HANDLE;

extern ULONG ELS_GetCOMPortName(ELS_CARD_SOCKET_HANDLE hCardSock, LPTSTR lpComPortName, ULONG *lpComPortNameLength);

I turned this into

Public Structure ELS_CARD_SOCKET_HANDLE
Public uSocket As Byte
Public uFunction As Byte
End Structure

Public Declare Function ELS_GetCOMPortName Lib "elSerial.dll" (ByRef hCardSock As ELS_CARD_SOCKET_HANDLE, ByVal lpComPortName As String, ByRef lpComPortNameLength As Long) As Long

I have tried all sorts of variants for this without any success. I hope somebody can give me a clue what I am doing wrong. Thanks!
Mar 17 '07 #1
0 827

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: DelphiBlue | last post by:
I have a Nested Datagrid that is using a data relations to tie the parent child datagrids together. All is working well with the display but I am having some issues trying to sort the child...
6
by: Ian Davies | last post by:
Hello all I have the following PHP script to place records from my MySql db into a table. However I now wish users to beable to select the multiple records from the table and on clicking a button...
121
by: typingcat | last post by:
First of all, I'm an Asian and I need to input Japanese, Korean and so on. I've tried many PHP IDEs today, but almost non of them supported Unicode (UTF-8) file. I've found that the only Unicode...
6
by: Jules Winfield | last post by:
I'm loving VS 2005. These are my questions and comments so far: BUG: Autoformatting ================ I've turned off virtually all autoformatting, but there is still one place where it rears...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
5
by: AliR | last post by:
Hi Everyone, I have a Visual C++ MFC program, and I am trying to use a webservice written in C#. When I add the webservice to my project using Add Web Reference the sproxy compiler complains...
0
by: fiona | last post by:
Innovasys Ltd., a leader in help authoring and documentation tools, today announced the inclusion of a tailored version of the Innovasys HelpStudio help authoring product, HelpStudio Lite, in the...
10
by: mg | last post by:
I'm migrating from VB6 and have a question about using 'Using' and the best way to use it. Here is a example of a small bit of code: dbConx("open") Using CN Dim CMD As New OleDbCommand(sSQL,...
1
by: Dave | last post by:
I've been assigned to support a web-based app (code behind page model) written in C# using Visual Studio 2005. I am completely new to web apps, C#, and Visual Studio 2005. This app was developed...
1
by: swethak | last post by:
hi, i have a code to disply the calendar and add events to that. It works fine.But my requirement is to i have to disply a weekly and daily calendar.Any body plz suggest that what modifications i...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.