Click here to Skip to main content
15,891,248 members
Home / Discussions / C#
   

C#

 
GeneralRe: Help for a beginner Pin
Nish Nishant19-May-02 23:41
sitebuilderNish Nishant19-May-02 23:41 
GeneralRe: Help for a beginner Pin
Giladi19-May-02 23:44
Giladi19-May-02 23:44 
GeneralForm Inheritance Pin
SimmoTech19-May-02 22:07
SimmoTech19-May-02 22:07 
GeneralRe: Form Inheritance Pin
Nish Nishant19-May-02 23:43
sitebuilderNish Nishant19-May-02 23:43 
GeneralMoving PictureBox Around Pin
Nick Parker19-May-02 13:52
protectorNick Parker19-May-02 13:52 
GeneralRe: Moving PictureBox Around Pin
SHaroz20-May-02 7:58
SHaroz20-May-02 7:58 
Questionhelp! how can I rewrite struct with union in C#? Pin
Li-kai Liu (Angus)18-May-02 18:20
Li-kai Liu (Angus)18-May-02 18:20 
AnswerRe: help! how can I rewrite struct with union in C#? Pin
Rama Krishna Vavilala18-May-02 18:27
Rama Krishna Vavilala18-May-02 18:27 
ykliu wrote:
In C or C++,some structures are defined with union. How can
we rewrite these structure in C# so that we can use them as
parameters and pass them into API functions?


e.g.

union U
{
int x;
int y;
}

can be written in C# as

[StructLayout(LayoutKind.Explicit)]
class U
{
[FieldOffset(0)]
int x;
[FieldOffset(0)]
int y;
}

ykliu wrote:
And, What's the correspondent type in C# to PVOID type in C?

There are two equivalents of PVOID in C#

1. void* this is when you are using C# pointers. Something which you should never do.

2. IntPtr this is used to encapsultae unmanaged pointers. Use this in conjunction with Marshal.StructureToPtr, Marshal.AllocCoTaskMem etc. functions. Look up all the functions in Marshal class it would be very helpful.

GeneralRe: help! how can I rewrite struct with union in C#? Pin
Li-kai Liu (Angus)18-May-02 19:29
Li-kai Liu (Angus)18-May-02 19:29 
Questionabout Rama's screensaver? Pin
zhoujun18-May-02 17:15
zhoujun18-May-02 17:15 
AnswerRe: about Rama's screensaver? Pin
Christian Graus18-May-02 17:31
protectorChristian Graus18-May-02 17:31 
GeneralRe: about Rama's screensaver? Pin
Nish Nishant18-May-02 18:24
sitebuilderNish Nishant18-May-02 18:24 
GeneralRe: about Rama's screensaver? Pin
zhoujun18-May-02 21:37
zhoujun18-May-02 21:37 
GeneralRe: about Rama's screensaver? Pin
Nish Nishant18-May-02 22:04
sitebuilderNish Nishant18-May-02 22:04 
GeneralRe: about Rama's screensaver? Pin
zhoujun18-May-02 22:46
zhoujun18-May-02 22:46 
GeneralRe: about Rama's screensaver? Pin
Nish Nishant18-May-02 23:01
sitebuilderNish Nishant18-May-02 23:01 
GeneralRe: about Rama's screensaver? Pin
zhoujun18-May-02 21:43
zhoujun18-May-02 21:43 
GeneralRe: about Rama's screensaver? Pin
Nish Nishant18-May-02 22:05
sitebuilderNish Nishant18-May-02 22:05 
GeneralRe: about Rama's screensaver? Pin
zhoujun18-May-02 22:49
zhoujun18-May-02 22:49 
GeneralRe: about Rama's screensaver? Pin
Nish Nishant18-May-02 23:08
sitebuilderNish Nishant18-May-02 23:08 
GeneralRe: about Rama's screensaver? Pin
Christian Graus18-May-02 23:36
protectorChristian Graus18-May-02 23:36 
AnswerRe: about Rama's screensaver? Pin
Rama Krishna Vavilala18-May-02 18:19
Rama Krishna Vavilala18-May-02 18:19 
GeneralRe: about Rama's screensaver? Pin
zhoujun18-May-02 21:56
zhoujun18-May-02 21:56 
Generalplease give me some guide to find such resources! Pin
zhoujun18-May-02 16:54
zhoujun18-May-02 16:54 
GeneralRe: please give me some guide to find such resources! Pin
Rama Krishna Vavilala18-May-02 18:42
Rama Krishna Vavilala18-May-02 18:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.