Click here to Skip to main content
15,893,508 members
Home / Discussions / C#
   

C#

 
GeneralRe: Reflection: Can base class know about derived class? Pin
PJules4-Aug-04 8:51
PJules4-Aug-04 8:51 
GeneralRe: Reflection: Can base class know about derived class? Pin
leppie4-Aug-04 20:45
leppie4-Aug-04 20:45 
GeneralHailing those adept at DirectSound using C# .NET Pin
NietzscheDisciple3-Aug-04 20:45
NietzscheDisciple3-Aug-04 20:45 
GeneralRe: Hailing those adept at DirectSound using C# .NET Pin
4-Aug-04 2:17
suss4-Aug-04 2:17 
GeneralRe: Hailing those adept at DirectSound using C# .NET Pin
NietzscheDisciple4-Aug-04 6:19
NietzscheDisciple4-Aug-04 6:19 
QuestionHow to get image name of a process exactly ? Pin
zuken213-Aug-04 20:26
zuken213-Aug-04 20:26 
Generallocal VCS in .net IDE Pin
samithas3-Aug-04 20:04
samithas3-Aug-04 20:04 
Generalstruct and pointer question in c# Pin
Rulala3-Aug-04 19:54
Rulala3-Aug-04 19:54 
Hi all ,Forgive my bad english,please.
I'm new user in c#.I have one problem about struct and pointer.
I want to create c# API that call DLL file in c++ .

//DLL sample as below(c++):
struct TESTA
{
DWORD A;
WORD B;
WORD C;
BYTE D[16];
};
typedef TESTA* LPTESTA;

BOOL CBook::InitialButton(LPTESTA pInfo)
{
//statement
return true;
}

//C# code as below:
unsafe public class callDLL
{
[StructLayout(LayoutKind.Sequential)]
public struct TESTA
{
public int A;
public ushort B;
public ushort C;
[MarshalAs(UnmanagedType.ByValArray, SizeConst= 16)]
public byte[] D;
}
[DllImport("dllname.dll")]
unsafe public static extern bool InitialButton(void* pInfo);
}

public class Initialize_sequence
{
unsafe static void Main(string[] args)
{
callDLL.TESTA pInfo=new callDLL.TESTA();
Console.WriteLine(Marshal.SizeOf(pInfo));
callDLL.InitialButton(&pInfo); //error happen Frown | :(
}
}

error message show "Can't get position and size of Mananged type"
Any one can provide idea for me ? Thanks.


hello ALL..^^
GeneralRe: struct and pointer question in c# Pin
Bret Mulvey9-Aug-04 17:03
Bret Mulvey9-Aug-04 17:03 
GeneralRe: struct and pointer question in c# Pin
Rulala9-Aug-04 17:44
Rulala9-Aug-04 17:44 
GeneralMultithreading in Windows UI Pin
naths3-Aug-04 19:28
naths3-Aug-04 19:28 
GeneralRe: Multithreading in Windows UI Pin
Stefan Troschuetz4-Aug-04 9:04
Stefan Troschuetz4-Aug-04 9:04 
GeneralEnable System.Diagnostics.Trace.WriteLine Pin
Amir Zicherman3-Aug-04 19:13
Amir Zicherman3-Aug-04 19:13 
GeneralRe: Enable System.Diagnostics.Trace.WriteLine Pin
KevinMac3-Aug-04 19:35
KevinMac3-Aug-04 19:35 
GeneralRe: Enable System.Diagnostics.Trace.WriteLine Pin
Amir Zicherman3-Aug-04 20:37
Amir Zicherman3-Aug-04 20:37 
GeneralStaticlly Link Assemblys Pin
MKlucher3-Aug-04 19:11
MKlucher3-Aug-04 19:11 
GeneralRe: Staticlly Link Assemblys Pin
Colin Angus Mackay3-Aug-04 20:05
Colin Angus Mackay3-Aug-04 20:05 
GeneralRe: Staticlly Link Assemblys Pin
Nick Parker4-Aug-04 5:02
protectorNick Parker4-Aug-04 5:02 
GeneralPassng TextBox Object.... Pin
Anonymous3-Aug-04 18:22
Anonymous3-Aug-04 18:22 
GeneralRe: Passng TextBox Object.... Pin
Jay Shankar3-Aug-04 18:44
Jay Shankar3-Aug-04 18:44 
GeneralRe: Passng TextBox Object.... Pin
Korjiro3-Aug-04 19:41
Korjiro3-Aug-04 19:41 
GeneralRe: Passng TextBox Object.... Pin
Jay Shankar3-Aug-04 19:52
Jay Shankar3-Aug-04 19:52 
GeneralRe: Passng TextBox Object.... Pin
exhaulted3-Aug-04 22:51
exhaulted3-Aug-04 22:51 
GeneralVS 2003 Designer bug? -- Duplicate declaration error Pin
ddelapasse3-Aug-04 16:04
ddelapasse3-Aug-04 16:04 
General"sizeof" in C# Pin
crushinghellhammer3-Aug-04 12:55
crushinghellhammer3-Aug-04 12:55 

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.