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

char** to IntPtr() ?

I have to call a function. This is from the SDK:
INT is_GetActSeqBuf (HIDS hf, INT* pnNum, char** ppcMem, char** ppcMemLast);

I have demo C# code that works. Here is the prototype:
[DllImport(DRIVER_DLL_NAME ,EntryPoint="is_GetActSeqBuf")]
private static extern int is_GetActSeqBuf (int hCam, ref int pnNum, ref IntPtr ppcMem, ref IntPtr ppcMemLast);

And this is the way it is used in the C# code.
IntPtr pMem = new IntPtr();
IntPtr pLast = new IntPtr();
is_GetActSeqBuf(hCam, pNum, pMem, pLast)

The C# code works. I used it to attempt a conversion to VB.NET by using the
http://authors.aspalliance.com/aldot...translate.aspx translation tool
and this is what it looks like:
Declare Function is_GetActSeqBuf Lib "ueye_api.dll" Alias "is_GetActSeqBuf" (ByVal hCam As Integer, ByRef pnNum As Integer, ByRef ppcMem As IntPtr, ByRef ppcMemLast As IntPtr) As Integer

Dim pMem As New IntPtr()
Dim pLast As New IntPtr()
is_GetActSeqBuf(hCam, pNum, pMem, pLast)

It doesn't throw an exception, it just doesn't give a pointer back for pMem and pLast. VB.NET takes the IntPtr() as acceptable but indicates it doesn't support it for API's that return unsafe types.

I've been able to get other calls to the driver to work up to this point. Any suggestions?

Thanks.
Sep 15 '07 #1
1 4182
debasisdas
8,127 Expert 4TB
Question moved to .NET forum .
Nov 3 '07 #2

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

Similar topics

15
by: Yifan | last post by:
Hi Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks Yifan
7
by: brian_harris | last post by:
I have a string object that I need to convert into an unmanged char * to be used by several unmnaged 3rd party functions. I have tried to use: (Marshal::StringToHGlobalAuto (Profname)) This would...
5
by: Stephen Cawood | last post by:
I'm trying to use a C++ .lib from C# (I tried the Interop group will no results). I have a working wrapper DLL (I can get back simple things like int), but I'm having issues dealing with an array...
3
by: DG is a god.... | last post by:
Dear All , This is my first post - please go easy...! I have a DLL written in C++ that has the following function exported from it -: char** ListHandles(int *processID); The processID...
0
by: adityav | last post by:
Hi I have unmanaged code with following struct struct DirList { char **elements /* */ ; int32 *attributes /* */ ; int64 *mtime /* */ ; int64 *fsize /* */ ;
2
by: runner | last post by:
I'm trying to call some functions from OpenSSL library but I'm a bit confused when I have to use pinvoke. first function should create key from some input data, it's declared : void...
3
by: Elikhom | last post by:
Hi, I'm trying to call a C++ function that has a char** as a parameter from C# code using DllImport. After googling around and finding some threads I haven't been able to solve my problem. This is...
5
by: =?Utf-8?B?QXlrdXQgRXJnaW4=?= | last post by:
Hi Willy, Thank you very much for your work. C++ code doesnot make any serialization. So at runtime C# code gives an serialization error at "msg_file_s sa = (msg_file_s) bf.Deserialize(ms);"...
20
by: =?Utf-8?B?ZW1pdG9qbGV5ZXM=?= | last post by:
Hi everyone: i read from the documentation of a dll that there is a struct that uses char for storing an IP address. How can it be? and how come i can get to representate the same value in a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...

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.