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

Marshaling struct containing pointer to array of arrays of struct

Hi guys

Mattias, thanx for answering my last question

Well, I'm struggling with marshaling a struct that has **ptr to an array of arrays of struct. Why? I'm stuck with it

1. I need to know how to get to the contents of "dumberstruct" contained within "dumbstruct" (i.e. dumbstruct.dstruct)
2. How to get to dumbstruct.tag_field_value and dumbstruct.field_value

Code follows

Thanx in advanc

Jef

-----------------------------------------------------------------------

/
typedef struct
unsigned char id[8]
void *sumthing;
} dumberstruct
*
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)
public class dumberstruct
[MarshalAs(UnmanagedType.U2, SizeConst=8)
public byte id
public IntPtr sumthing
} // dumberstruc

/
typedef struct
...
void **tag_field_value; // pointer to array of arrays of value
void **field_value; // pointer to array of constant values
dumberstruct **dstruct; // pointer to array of arrays of dumberstruc
...
} dumbstruct
*
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Ansi)
public class dumbstruct
...
public IntPtr tag_field_value; // pointer to array of arrays of value
public IntPtr field_value; // pointer to array of constant values
public IntPtr dstruct; // pointer to array of arrays of dumberstruc
...
} // dumbstruc

Nov 16 '05 #1
0 1447

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

Similar topics

3
by: Nikolay Petrov | last post by:
Guys, please help. I am trying to make this work from at least 4 months. I am new to programming and some things are difficult to me, but I really need to make my project work. I can't find...
20
by: fix | last post by:
Hi all, I feel unclear about what my code is doing, although it works but I am not sure if there is any possible bug, please help me to verify it. This is a trie node (just similar to tree nodes)...
2
by: beetle | last post by:
Hello, I'm storing data in several different binary tree's. The root node is located in a struct containing general data about the tree. struct lnode { char *fname; int nentry;
6
by: JS | last post by:
I have this struct: struct pcb { void *(*start_routine) (void *); void *arg; jmp_buf state; int stak; }; These pointers:
3
by: Rudy Velthuis | last post by:
Hello, Does anyone know how to create a struct that will marshal to the following C++ struct A, containing an array of the user defined String10 type: struct String10 { char SLen; char S;
2
by: Thomas Kent | last post by:
I have a dll that is expecting a 3x3 array which I'm am using DllImport to access. In addition, this array is located in a struct that is getting passed. I'm having problems that I think are...
1
by: Jeff | last post by:
I am struggling with the following How do I marshal/access a pointer to an array of strings within a structure Than Jef ----------------------------------------------------------------
2
by: Laurent | last post by:
Hi again, I created a thread some days ago, while I was trying to access a C++ DLL using my C# program. First of all, I want to thanks all the guys who helped me. But I still have a...
4
by: Bjarne Nielsen | last post by:
Hi all From a C# program, I need to call an unmanaged (C++) dll. The dll fills an array with variables and returns that to the C# program. When I have a fixed sized array, this works fine by...
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...
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
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...

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.