Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
AnswerRe: Hash Table Pin
mertkan6512-Sep-07 21:13
mertkan6512-Sep-07 21:13 
QuestionDraw gradient image Pin
greekius11-Sep-07 23:51
greekius11-Sep-07 23:51 
AnswerRe: Draw gradient image Pin
Amar Chaudhary12-Sep-07 0:33
Amar Chaudhary12-Sep-07 0:33 
QuestionProblem: tabControl (TabAlignment.Left) Pin
Soo Star11-Sep-07 23:39
Soo Star11-Sep-07 23:39 
AnswerRe: Problem: tabControl (TabAlignment.Left) Pin
Martin#12-Sep-07 8:35
Martin#12-Sep-07 8:35 
Questionequivalent of DocumentCompleted in WebBrowser while loading with AJAX Pin
scoroop11-Sep-07 23:37
scoroop11-Sep-07 23:37 
AnswerRe: equivalent of DocumentCompleted in WebBrowser while loading with AJAX Pin
scoroop12-Sep-07 3:15
scoroop12-Sep-07 3:15 
QuestionC# [DllImport()] questions. Pin
ioctl5111-Sep-07 23:34
ioctl5111-Sep-07 23:34 
When declaring:

[DllImport("kernel32.dll")]
public static extern int OpenProcess(int dwDesiredAccess, bool bInheritHandle, int dwProcessId);

It dosnt seem to matter what argument datatypes you use, for instance, this works aswell:

[DllImport("kernel32.dll")]
public static extern UInt32 OpenProcess(uint dwDesiredAccess, uint bInheritHandle, Int32 dwProcessId);

Question 1:
What should you think of when declaring imported functions? Should you try to match the c/c++ datatype to its c# datatype couterpart? (For instance, for c++ int, c# Int32). Or does it not matter?

Question 2:
Arguments that are pointers. I dont quite understand how IntPtr etc works since im quite new to c#. But if a function has a parameter that is a pointer (int* return_val for instance. Should you use a IntPtr for that? Or an unsafe c# pointer?

Question 3:
Arguments that are typedef'ed types, for instance handles that are a c++ (void*). Should you use c# unsafe void*? Or is an int just as fine? Are there any rules for this? For instance, HWND is a UInt32 or something like that..

Question 4:
The "out" parameter, should it be used for c++ pointers and references that returns values (non const)?

Thanks.
AnswerRe: C# [DllImport()] questions. Pin
Malcolm Smart12-Sep-07 0:27
Malcolm Smart12-Sep-07 0:27 
AnswerRe: C# [DllImport()] questions. Pin
Luc Pattyn12-Sep-07 2:51
sitebuilderLuc Pattyn12-Sep-07 2:51 
Questiondata grid view Vs databinding Pin
iet200011-Sep-07 22:52
iet200011-Sep-07 22:52 
AnswerRe: data grid view Vs databinding Pin
Waleed Eissa11-Sep-07 23:12
Waleed Eissa11-Sep-07 23:12 
GeneralRe: data grid view Vs databinding Pin
iet200011-Sep-07 23:43
iet200011-Sep-07 23:43 
GeneralRe: data grid view Vs databinding Pin
Waleed Eissa11-Sep-07 23:58
Waleed Eissa11-Sep-07 23:58 
AnswerRe: data grid view Vs databinding Pin
Nouman Bhatti12-Sep-07 0:06
Nouman Bhatti12-Sep-07 0:06 
Questionnew namespaces?? Pin
Tarun.Suneja11-Sep-07 22:21
Tarun.Suneja11-Sep-07 22:21 
AnswerRe: new namespaces?? Pin
Waleed Eissa11-Sep-07 23:13
Waleed Eissa11-Sep-07 23:13 
AnswerRe: new namespaces?? Pin
blackjack215012-Sep-07 0:29
blackjack215012-Sep-07 0:29 
AnswerRe: new namespaces?? Pin
Malcolm Smart12-Sep-07 0:29
Malcolm Smart12-Sep-07 0:29 
QuestionRe: new namespaces?? Pin
User 665812-Sep-07 0:33
User 665812-Sep-07 0:33 
GeneralRe: storing data from textbox into different files Pin
Ermak8611-Sep-07 22:12
Ermak8611-Sep-07 22:12 
Questionno overrideable in c# Pin
Adnan Siddiqi11-Sep-07 22:00
Adnan Siddiqi11-Sep-07 22:00 
AnswerRe: no overrideable in c# Pin
Pete O'Hanlon11-Sep-07 22:14
mvePete O'Hanlon11-Sep-07 22:14 
GeneralRe: no overrideable in c# Pin
Adnan Siddiqi11-Sep-07 22:50
Adnan Siddiqi11-Sep-07 22:50 
GeneralRe: no overrideable in c# Pin
Pete O'Hanlon12-Sep-07 1:32
mvePete O'Hanlon12-Sep-07 1:32 

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.