473,406 Members | 2,220 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,406 software developers and data experts.

Is there a mean to pass Pinny Pointer to native code?

As the title of the question show I want to pass a pinny pointer (C++/CLI) pointer to a native function

When Compiling there's no error

but the pointer do not contain any value

I explain more the problem:

typedef value struct //defined in managed code
{

}Type_Name;

The same Type is defined in a native DLL but without the keyword value
typedef struc {.........} Type_Name;
In the native dll there's a function func1(Type_Name* tn);
Now from the managed code I call the native function from the DLL (using dllimport) but I pass a pinny pointer as a parameter: func1(Type_Name^ tn)

The compilation succeeds but the pointer is not initialized.

Is there any way to do this, cuz I want that my managed code use these new pinny pointer.

Please help, or give me any idea.
Apr 10 '08 #1
1 1300
well I have a good idea but I don't think is the best:


//in managed code

func1(Type^ tn);

but in the dllimport I put this function

extern void func1(cli::interiorptr<Type> tn);

this code works but I want a best solution, so please help
Apr 10 '08 #2

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

Similar topics

48
by: yezi | last post by:
Hi, all: I want to record some memory pointer returned from malloc, is possible the code like below? int memo_index; int i,j; char *tmp; for (i=0;i<10;i++){
12
by: glutz7878 | last post by:
I have no trouble passing __delegate ptrs to native C functions in DLLs, however when attempting to pass the __delegate ptr to a native C++ function in a DLL I get the following runtime exception:...
5
by: | last post by:
Hi, In our system we get image buffers through a native dll as void*. We want to manage several of this blocks by C# objects an pass them wen needed to a native image processing library. What...
16
by: Abhishek | last post by:
why do I see that in most C programs, pointers in functions are accepted as: int func(int i,(void *)p) where p is a pointer or an address which is passed from the place where it is called. what...
3
by: Boni | last post by:
Dear all, I have written a C++ com object: STDMETHOD(myfunc)(INT* array) Now I need to pass an array from c# to com. I generated a COM interop and it the signature of the function is ...
1
by: Scott McFadden | last post by:
What is the proper way to pass pointers by reference from managed c++ calls to native c++ calls? In managed C++, I have a pointer to an array of structures, that I pass to a native c++ method by...
4
by: Notre Poubelle | last post by:
Hello, I have a scenario where my CPP project is not compiled with CLR support, but some of the CPP files have the /clr option set. In file1.cpp, the /clr switch is not set. In file2.cpp, the...
7
by: Russell Mangel | last post by:
/* Hi, I am trying to hold a reference to un-managed pointer IStorage. The client/callers will make many accesses to IStorage, but only in-directly. For performance reasons IStorage needs to...
1
by: natarajchakraborty | last post by:
Hi All, I have a serious problem here which is bugging me for past few days. I have a native DLL(Win32), and it exposes only on function called GetFunctionList Now this function...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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
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
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
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.