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

Struct layout problem

PLS
I'm trying to write the definition of a struct that must exactly match
the binary layout of a struct created by a native c++ program.

The C++ struct contains several wchar_t[] and char[] fields containing
text. So...

a. How should I represent these field in the C# struct?
b. How do I convert that representation into C# strings?

Thanks for any help
++PLS
Nov 2 '07 #1
1 4552
Google has tons of articles on this exact topic.

This one looks pretty good:
http://www.vsj.co.uk/articles/display.asp?id=501

--
Chris Mullins

"PLS" <no****@nowhere.comwrote in message
news:MP************************@msnews.microsoft.c om...
I'm trying to write the definition of a struct that must exactly match
the binary layout of a struct created by a native c++ program.

The C++ struct contains several wchar_t[] and char[] fields containing
text. So...

a. How should I represent these field in the C# struct?
b. How do I convert that representation into C# strings?

Thanks for any help
++PLS

Nov 2 '07 #2

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

Similar topics

18
by: ineedyourluvin1 | last post by:
Hi, I would appreciate if someone could tell me what I'm doing wrong ? #include<iostream> using namepace std ; struct person{ char *firstname ; int age ;
5
by: Kobu | last post by:
In embedded systems (programmed in C), often times structure declarations are used to group together several status/control/data registers of external hardware (or even internal registers). The...
8
by: Mike | last post by:
The following struct, DataStruct, is only part of a larger one that contains additional fields and arrays. I need the explicit layout because this struct is really a union, where some of the...
28
by: Tamir Khason | last post by:
Follwing the struct: public struct TpSomeMsgRep { public uint SomeId;
3
by: cody | last post by:
I got a warning from fxcop from the declararation of a struct. the warning: "Structures with explicit layout containing misaligned fields cause crashes on 64 bit platforms" the struct:
4
by: Michael Brennan | last post by:
I have a menu_item structure containing an union. func is used if the menu item should use a callback, and submenu if a popupmen should be shown. struct menu_item { enum { function, popup }...
4
by: hobbes992 | last post by:
Howdy folks, I've been working on a c project, compiling using gcc, and I've reached a problem. The assignment requires creation of a two-level directory file system. No files have to be added or...
3
by: angshuman.agarwal | last post by:
Structure in C DLL ---------------------------- typedef struct IrData { unsigned short uiFormat; unsigned short uiLength; unsigned char* pchData; } tagIrData; Function in C DLL
5
by: guy.gorodish | last post by:
hi, i have a c# interop that pass struct into c dll. for some reason the data transfered into the c function is with incorrect order (meaning - members of the struct get other struct values and...
12
by: Milux | last post by:
Hi All, This question has to do with interface design. Suppose I have an translation tool. It can translates structs from type "general" to other types and then does some processing. Example:...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.