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

How to translate C++ typedefs into C# ?

How to translate the following C++ typedefs into C# ?

typedef struct {
BYTE *data;
size_t length;
} VizBlob;

typedef struct VizUserInfoActions {
HANDLE (IMPORTED *createFullInfo) (
HANDLE logger,
const VizBlob *blob
);
const VizBlob *(IMPORTED *fullInfoBlob) (
HANDLE logger,
HANDLE fi,
int version);
} VizUserInfoActions;
--
Best regards,

Oleg Subachev
Nov 17 '05 #1
1 1581
you can transform these structs into structs or classes in C#

public class VizBlob
{
public byte[] data;
}

public class VizUserInfoActions
{
public delegate IntPtr createFullInfo(IntPtr Logger, VizBlob blob);
public delegate VizBlob fullInfoBlob( IntPtr logger,
IntPtr fi, int version)
}

However those IntPtrs can also be substituted by appropriate class
definitions. IntPtr is used for the interop with the Win32 world...

I recommend you to see the docs about structs, classes and delegates ( they
are like function pointers in C++ )

--
Vadym Stetsyak aka Vadmyst

"Oleg Subachev" <ol**@urvb.ru> wrote in message
news:eU**************@TK2MSFTNGP09.phx.gbl...
How to translate the following C++ typedefs into C# ?

typedef struct {
BYTE *data;
size_t length;
} VizBlob;

typedef struct VizUserInfoActions {
HANDLE (IMPORTED *createFullInfo) (
HANDLE logger,
const VizBlob *blob
);
const VizBlob *(IMPORTED *fullInfoBlob) (
HANDLE logger,
HANDLE fi,
int version);
} VizUserInfoActions;
--
Best regards,

Oleg Subachev

Nov 17 '05 #2

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

Similar topics

2
by: Levent | last post by:
Please consider the following Parent and Child template classes: template <class T> class Parent { public: typedef T type; typedef T& ref; /* pack of typedefs */ };
0
by: Steven T. Hatton | last post by:
I copied what I believe is a complete representation of <iosfwd> from ISO/IEC 14882:2003(E). My understanding of the rules covering typedefs, templates and forward declarations is not very solid. ...
6
by: Erica | last post by:
Hi, I am currently working on a Pascal-to-C translation, and I am getting an error that I can't seem to debug. I have a globals.h file, and here is a snippet from it: -- typedef char...
9
by: bubbakittee | last post by:
I am designing a package of functions to be used by people with very little programming experience (if any) and very little patience. I don't want to scare them with programmerish words like...
1
by: Michal Wróbel | last post by:
Hello, I've got few questions concerning typedefs inside class definition. Firstly, I'll give an example code: template< class T > class Function { public: typedef boost::shared_ptr<...
30
by: junky_fellow | last post by:
I was looking at the source code of linux or open BSD. What I found that lots of typedefs were used. For example, consider the offset in a file. It was declared as off_t offset; and off_t is...
7
by: Noah Roberts | last post by:
I have something like the following: template<ENUM X, int I = 0> class Generic { .... }; typedef Generic<Val1> v1_type; typedef Generic<Val2> v2_type;
9
bvdet
by: bvdet | last post by:
I have done some more work on a simple class I wrote to calculate a global coordinate in 3D given a local coordinate: ## Basis3D.py Version 1.02 (module macrolib.Basis3D) ## Copyright (c) 2006...
1
by: pauldepstein | last post by:
While reading some source code, I saw a variable called "end" of type "time". So I investigated what the type "time" meant and saw that time was a typedef for "Real". So what does "Real" mean? ...
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?
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
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
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.