473,413 Members | 1,794 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,413 software developers and data experts.

C Dll pointers arguments

I have to interface with a C Dll (not mine, 3rd party) that I have no
vb.net declares for, so I'm having to create them. I'm having a little
trouble translating some of the types.

The C Dll call:

int LS1 (HWND hwnd, HANDLE hInst, SHORT s1, SHORT *s2);

I am having trouble translating the pointer to s2. I get an error on
the call (something about an object not instantiated), so I'm not sure
its related to my declare or not, but its in the call.

my declare:

Declare Function LS1 Lib "lsx.dll" (ByVal hWnd As IntPtr, ByVal hInst
As IntPtr, ByVal s1 As Int16, ByVal hConnect As IntPtr) As Int16

I'm not sure how to handle the SHORT *s2 pointer. Is what I have the
correct way to do it ? Does it have to be initialized or something
first ?

Any ideas would be appreciated.

TIA,
Mark

Nov 21 '05 #1
1 1078
On 2005-02-23, ma*****@yahoo.com <ma*****@yahoo.com> wrote:
I have to interface with a C Dll (not mine, 3rd party) that I have no
vb.net declares for, so I'm having to create them. I'm having a little
trouble translating some of the types.

The C Dll call:

int LS1 (HWND hwnd, HANDLE hInst, SHORT s1, SHORT *s2);

I am having trouble translating the pointer to s2. I get an error on
the call (something about an object not instantiated), so I'm not sure
its related to my declare or not, but its in the call.

my declare:

Declare Function LS1 Lib "lsx.dll" (ByVal hWnd As IntPtr, ByVal hInst
As IntPtr, ByVal s1 As Int16, ByVal hConnect As IntPtr) As Int16


Declare Function LS1 Lib "lsx.dll" _
(ByVal hWnd As IntPtr, _
ByVal hInst As IntPtr, _
ByVal s1 As Int16, _
ByRef s2 As Int16) As Int32
--
Tom Shelton [MVP]
Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

53
by: Alf P. Steinbach | last post by:
So, I got the itch to write something more... I apologize for not doing more on the attempted "Correct C++ Tutorial" earlier, but there were reasons. This is an UNFINISHED and RAW document,...
9
by: Mikhail Teterin | last post by:
Hello! I'd like to have a variable of a pointer-to-function type. The two possible values are of type (*)(FILE *) and (*)(void *). For example: getter = straight ? fgetc : gzgetc; nextchar...
7
by: Alfonso Morra | last post by:
How can this work ? I have the following declarations in a header: Header ========= typedef void (*VFPTR)(void) ; void FOO_Callback(void*, char*, char*, int, unsigned long, void*,void*);...
14
by: Alf P. Steinbach | last post by:
Not yet perfect, but: http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01.pdf http://home.no.net/dubjai/win32cpptut/special/pointers/ch_01_examples.zip To access the table of...
7
by: Eli Luong | last post by:
Hi, Sorry if I accidentally posted a blank post before. But, I was wondering, I'm practicing with pointers right now, and wanted to know if I am using it correctly in the following code. By...
9
by: Sidhu | last post by:
Hai, I like 2 know more abot pointers. Can you please tell me the fields in which pointers are widely used. Yours Sidhu
6
by: ivan.leben | last post by:
I want to write a Mesh class using half-edges. This class uses three other classes: Vertex, HalfEdge and Face. These classes should be linked properly in the process of building up the mesh by...
54
by: Boris | last post by:
I had a 3 hours meeting today with some fellow programmers that are partly not convinced about using smart pointers in C++. Their main concern is a possible performance impact. I've been explaining...
19
by: MQ | last post by:
Can someone tell me where I should use pointers and where I should use references? In his book, Stroustrup says that you should use pointers for passing arguments that are to be modified, not...
33
by: pateldm15 | last post by:
How do I sort an string array using pointers
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?
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.