Click here to Skip to main content
15,890,186 members
Home / Discussions / C#
   

C#

 
AnswerRe: Issue with Imultiple result sets Pin
Dave Kreskowiak1-Oct-11 2:48
mveDave Kreskowiak1-Oct-11 2:48 
GeneralRe: Issue with Imultiple result sets Pin
siva4551-Oct-11 18:02
siva4551-Oct-11 18:02 
GeneralRe: Issue with Imultiple result sets Pin
Dave Kreskowiak2-Oct-11 1:56
mveDave Kreskowiak2-Oct-11 1:56 
AnswerRe: Issue with Imultiple result sets Pin
BobJanova2-Oct-11 22:22
BobJanova2-Oct-11 22:22 
QuestionCrystal reports Pin
Neha_Gupta30-Sep-11 20:20
Neha_Gupta30-Sep-11 20:20 
AnswerRe: Crystal reports Pin
Dave Kreskowiak1-Oct-11 2:46
mveDave Kreskowiak1-Oct-11 2:46 
QuestionUsing SystemParametersInfo() P/Invoke Pin
namelkcip30-Sep-11 19:40
namelkcip30-Sep-11 19:40 
AnswerRe: Using SystemParametersInfo() P/Invoke Pin
OriginalGriff30-Sep-11 21:38
mveOriginalGriff30-Sep-11 21:38 
The reason for the StringBuider is so that the called method can modify it - strings are immutable in .NET so when a change is to be made a new string is created. This is not the case with StringBuider. If you pass string to the P/Invoked method, it cannot change it.

pvParam just stands for "pointer to a void" parameter, which is the C++ version of a reference to an object - it is a parameter which can be in effect any type, depending on what function the method is to perform on it.

Why an int value? Because the constant is an integer! C# is strongly typed, so if you didn't specify the type when you declared it, it could cause confusion when you used it later.

Yes, the value does matter! It is the value that is passed through to the P/Invoked method, and which tells it what action it is to perform - not the name of the constant! If the value is wrong, the method will perform the wrong action. You don't need to declare these as constants - you could just use the numbers directly in the method call - but it is a lot, lot more readable and checkable to use the same names and values that the called method does. (We can't use the same definition file, because they are stored in a ".h" file for the C++ and C# cannot understand those. However, what most people do is to read the ".h" file in a text editor, and automaticlly replace
C++
#define SPI_GETPLATFORMTYPE 257
with
C#
private const uint SPI_GETPLATFORMTYPE = 257;
to make sure they are the same throughout! I know I do...Smile | :)
Real men don't use instructions. They are only the manufacturers opinion on how to put the thing together.

Manfred R. Bihy: "Looks as if OP is learning resistant."

GeneralRe: Using SystemParametersInfo() P/Invoke Pin
namelkcip1-Oct-11 16:31
namelkcip1-Oct-11 16:31 
GeneralRe: Using SystemParametersInfo() P/Invoke Pin
OriginalGriff1-Oct-11 21:22
mveOriginalGriff1-Oct-11 21:22 
AnswerRe: Using SystemParametersInfo() P/Invoke Pin
DaveyM691-Oct-11 23:24
professionalDaveyM691-Oct-11 23:24 
GeneralRe: Using SystemParametersInfo() P/Invoke Pin
namelkcip5-Oct-11 16:50
namelkcip5-Oct-11 16:50 
GeneralRe: Using SystemParametersInfo() P/Invoke Pin
DaveyM696-Oct-11 6:44
professionalDaveyM696-Oct-11 6:44 
QuestionHow to Access Methods and Properties of a Private Class Pin
namelkcip30-Sep-11 19:24
namelkcip30-Sep-11 19:24 
AnswerRe: How to Access Methods and Properties of a Private Class Pin
Dave Kreskowiak1-Oct-11 2:43
mveDave Kreskowiak1-Oct-11 2:43 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
SledgeHammer011-Oct-11 8:18
SledgeHammer011-Oct-11 8:18 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Dave Kreskowiak1-Oct-11 8:41
mveDave Kreskowiak1-Oct-11 8:41 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Eddy Vluggen1-Oct-11 8:42
professionalEddy Vluggen1-Oct-11 8:42 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
SledgeHammer011-Oct-11 9:58
SledgeHammer011-Oct-11 9:58 
AnswerRe: How to Access Methods and Properties of a Private Class Pin
Eddy Vluggen1-Oct-11 11:49
professionalEddy Vluggen1-Oct-11 11:49 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Eddy Vluggen1-Oct-11 12:47
professionalEddy Vluggen1-Oct-11 12:47 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
BillWoodruff1-Oct-11 18:30
professionalBillWoodruff1-Oct-11 18:30 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
namelkcip1-Oct-11 16:33
namelkcip1-Oct-11 16:33 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
BillWoodruff1-Oct-11 18:32
professionalBillWoodruff1-Oct-11 18:32 
GeneralRe: How to Access Methods and Properties of a Private Class Pin
Dave Kreskowiak2-Oct-11 1:54
mveDave Kreskowiak2-Oct-11 1:54 

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.