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

mixing managed code with native code

I have an Assembly using IJW that uses a third party native library.
There are quite a few function calls that uses callbacks and pointers.

One of those takes a delegate: bool enumXXX(char * someData, unsigned
long lparam);

Inside the passed delegate I need to cast from unsigned long to
List<String^^. How Can I do this ?

Thanks,

Felipe Garcia

Jan 15 '07 #1
1 1451

"rhossi" <fe*******@gmail.comwrote in message
news:11**********************@11g2000cwr.googlegro ups.com...
>I have an Assembly using IJW that uses a third party native library.
There are quite a few function calls that uses callbacks and pointers.

One of those takes a delegate: bool enumXXX(char * someData, unsigned
long lparam);

Inside the passed delegate I need to cast from unsigned long to
List<String^^. How Can I do this ?
You can't pass a tracking handle/reference through a native API, because the
GC could move it meanwhile. Use a pinned pointer instead.

Note that your code won't be 64-bit clean if it uses an unsigned long
variable to hold a pointer.
>
Thanks,

Felipe Garcia

Jan 16 '07 #2

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

Similar topics

4
by: William F. Kinsley | last post by:
My understanding is that when I re-compile a existing MFC application with the /clr switch, that the code generated is managed(with some exceptions) but that the data isn't, i.e. not garbage...
9
by: Herby | last post by:
Is possible to have a managed method within a Native(un-managed) class within a \clr project? E.g. class myClass { public: #pragma managed void myMethod(void);
3
by: Lonewolf | last post by:
Hi all, I'm having difficulties passing data back to managed class from my native class when the data is generated from within a native thread in the native class itself. I will give the following...
2
by: quat | last post by:
I am getting the error: error C4368: cannot define 'd3dPP' as a member of managed 'FormEx::Form1': mixed types are not supported I am trying to mixed managed and unmanaged code (d3dPP is...
1
by: Paul.Lee.1971 | last post by:
If I had two C++ classes, identical in just about every way, except that one was managed and the other wasn't, what speed benefits, or pitfalls would occur if they called native unmanaged C++ code?...
1
by: AlwaysPerplexed | last post by:
Hi, I'm somewhat stuck and could really appreciate some help. I'm writing a little program using the OpenCV libraries, I started this as a Win32 Console Application and everything worked fine. I...
0
by: HeroOfSpielburg | last post by:
Hello, I'm new to the realm of .NET application creation, so please forgive my ignorance. I have been tasked with debugging a problem that arises with using a DLL that contains managed and...
2
by: jraul | last post by:
Hi, This is probably a noobie question but: I just created a new C++/CLI project in VS 2005. It created an empty class: public ref class Class1 { // TODO: Add your methods for this class...
2
by: Jon Slaughter | last post by:
How difficult is it for one to integrate unmanaged C++ into C#? I know for functions one can use DLLimport but how does one go about doing it for classes? Do I have to completely reimplement the...
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...
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
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
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
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.