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

Callbacks of unmanaged code

I've to invoke a unmanaged dll fucntion in C# which uses
a callback fucntion.The unmanaged dll fucntion returns a
pointer to a structure to its callback fucntion.The user
should collect those structure fields in a buffer.

In my managed code(i.e. in C# program), I've used a
delegate for invoking callback function and I've declared
the structure too. The dll fucntion is executing finely
without any errors but I'm not getting any values into the
structure of my callback fucntion. Is there any problem
with the garbage collection.

I've gone through all the MSDN examples for PInvoke.
But they weren't of much use to me.

Please suggest me a solution of using callbacks of
Unmanaged code which take in a pointer to a struture.

Please send few code snippets which involve callbacks with
structure variables.

I need the information at the earliest.
Please send the information to my mail pe****@yahoo.com

Thanking you
vijaya


Nov 15 '05 #1
1 1651
vijaya,

If you can give the structure that is being passed in, as well as the
callback definition (both in C), then it would help.

Also, it is most likely that the structure is being passed by way of a
pointer. In that case, as a last resort, you can always set that parameter
to be of type IntPtr, and then marshal the structure manually.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"vijaya" <an*******@discussions.microsoft.com> wrote in message
news:0b****************************@phx.gbl...
I've to invoke a unmanaged dll fucntion in C# which uses
a callback fucntion.The unmanaged dll fucntion returns a
pointer to a structure to its callback fucntion.The user
should collect those structure fields in a buffer.

In my managed code(i.e. in C# program), I've used a
delegate for invoking callback function and I've declared
the structure too. The dll fucntion is executing finely
without any errors but I'm not getting any values into the
structure of my callback fucntion. Is there any problem
with the garbage collection.

I've gone through all the MSDN examples for PInvoke.
But they weren't of much use to me.

Please suggest me a solution of using callbacks of
Unmanaged code which take in a pointer to a struture.

Please send few code snippets which involve callbacks with
structure variables.

I need the information at the earliest.
Please send the information to my mail pe****@yahoo.com

Thanking you
vijaya

Nov 15 '05 #2

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

Similar topics

1
by: vijaya | last post by:
I've to invoke a unmanaged dll fucntion in C# which uses a callback fucntion.The unmanaged dll fucntion returns a pointer to a structure to its callback fucntion.The user should collect those...
0
by: Vijaya | last post by:
I've to invoke a unmanaged dll fucntion in C# which uses a callback fucntion.The unmanaged dll fucntion is as follows **************************************** The Original Fucntion in the dll...
23
by: Brian | last post by:
I am very new to C# programming and have run into a problem. I apologize for the repost of this article. For some reason, my news reader attached it to an existing thread. First off, I have...
4
by: R. MacDonald | last post by:
Hello, all, I have a .NET application (VB) that passes the address of a delegate to unmanaged code in a DLL. The unmanaged code then uses the delegate as a call-back. This seems to work...
2
by: cada0310 | last post by:
Hi there, I'm new to C# (but not to C++), and I'm trying to create a web service that calls some of our older software, located in a DLL. I'm getting most the calls to work ok, but one of them...
6
by: per9000 | last post by:
An interesting/annoying problem. I created a small example to provoke an exception I keep getting. Basically I have a C-struct (Container) with a function-pointer in it. I perform repeated calls...
3
by: kelvin.koogan | last post by:
I have an unmanaged DLL which calls my managed C++ app using a callback (standard C++ function pointer). I can receive the callbacks OK using a static function with global scope, but I can't find a...
8
by: DavidT | last post by:
Hello, at first, exuse if the following question is simple to solve, but i normaly coding with C# and now have to use C++/CLI for one project. My Problem is that i have to use a native c++ sdk...
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
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
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
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...
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,...

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.