473,396 Members | 1,724 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.

WINAPI CALL

I have a API function which declared in VC++ like this:

DLLimport BOOL WINAPI bl_HERA16_SetPlayBuffer(int iChannel,BYTE
**bpBuffer);

How could I declare and call this function in C#. I have problem on
second parameter.

Thks
Nov 15 '05 #1
1 2098
Qindong Zhang,

The declaration should be as follows:

[DllImport("mydll.dll")]
public static extern bool bl_HERA16_SetPlayBuffer(
int iChannel,
IntPtr bpBuffer);

You are going to have to marshal the reference to the byte pointer
yourself, depending on what is being passed in. Is it a two-dimensional
array? Or is it a pointer to an array? Or is it a double pointer to a
single byte?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Qindong Zhang" <qi***********@hotmail.com> wrote in message
news:7a**************************@posting.google.c om...
I have a API function which declared in VC++ like this:

DLLimport BOOL WINAPI bl_HERA16_SetPlayBuffer(int iChannel,BYTE
**bpBuffer);

How could I declare and call this function in C#. I have problem on
second parameter.

Thks

Nov 15 '05 #2

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

Similar topics

1
by: John Hann | last post by:
I'm trying to extend the version of IAS server included in Windows Server 2003 with a custom DLL. IAS, unfortunately, insists on loading Extension DLLs with the Win32 LoadLibrary() function, which...
1
by: MuZZy | last post by:
HI, I would really appreciate some hwlp with this: Here is the WinAPI struct used in call to winapi function wavInGetDevCaps: typedef struct { WORD wMid; WORD wPid; MMVERSION...
2
by: Patrick Blackman | last post by:
Need example of using WinAPI "CreateWindowEx" in c# any help would be appreciated.
6
by: Minfu Lu | last post by:
I got problems with the WinAPI call OleCreatePictureIndirect() in C#. Has anybody ever used this function call in C#? Thanks, Minfu
1
by: Qindong Zhang | last post by:
I have a API function which declared in VC++ like this: DLLimport BOOL WINAPI bl_HERA16_SetPlayBuffer(int iChannel,BYTE **bpBuffer); How could I declare and call this function in VB.NET. I...
7
by: jg | last post by:
or would I have to use C# or C++?
1
by: Norman Chong | last post by:
Hi group, I want to get some information about the Windows version and ServicePack. I used the WinAPI but got the following problem: When I try to pass my OSVERSIONINFOEX structure ByRef to the...
3
by: Sin Jeong-hun | last post by:
Often, I need to call Windows APIs in C#. Signatures and macro constants can be easily found at MSDN but the constants values are not shown. I have to search the .h file for those constants values....
6
by: ppuniversal | last post by:
I am facing a problem: I have say 3 files : ABC.h ----- this file has the function prototypes ABC.cpp ------ the definitions of the functions ABC_Test.cpp ------- the file with main()...
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
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.