Click here to Skip to main content
16,016,263 members
Home / Discussions / C#
   

C#

 
AnswerRe: can we hide focus from grid cell Pin
Vasudevan Deepak Kumar18-Dec-07 3:00
Vasudevan Deepak Kumar18-Dec-07 3:00 
Questionredirecting Pin
liatma17-Dec-07 23:57
liatma17-Dec-07 23:57 
GeneralRe: redirecting Pin
Paul Conrad22-Dec-07 9:21
professionalPaul Conrad22-Dec-07 9:21 
Questionhow to deactivate grid cell Pin
amit_8317-Dec-07 23:51
amit_8317-Dec-07 23:51 
QuestionWhat this code is doing Pin
Hum Dum17-Dec-07 23:38
Hum Dum17-Dec-07 23:38 
AnswerRe: What this code is doing Pin
AlwiNus17-Dec-07 23:49
AlwiNus17-Dec-07 23:49 
GeneralRe: What this code is doing Pin
Hum Dum18-Dec-07 1:19
Hum Dum18-Dec-07 1:19 
GeneralRe: What this code is doing Pin
Anthony Mushrow18-Dec-07 1:48
professionalAnthony Mushrow18-Dec-07 1:48 
humdumof wrote:
Not a refrence to the class itself?
By this what u mean?


When you use a class you create an instance of it. Kinda like if i want a bowl of cereal, i have to get myself a bowl and some cereal, and probably some milk. Then my bowl of cereal that i can eat, would be an instance of a bowl of cereal... if you follow me.

When you pass the instance of your class to the constructor your passing a reference (pointer) to it.


humdumof wrote:
also CMS=cMP;
Does it mean we can access all the methods of cMessageProcessing thru CMS?
& what is use of doing all this in constructor?


Yes, you can access all the methods of the class through CMS.
The use of this, is that you can make use of the same instance of a class, in as many different classes as you like. So you can make 1 instance of your class, and pass it to 2 other classes for example. Then both classes will work on the same instance.

EDIT: As for why you should actually do this in the constructor: If the new class depends on having an instance of cMessageProcessing (ie it uses it) and it does not get passed a reference or create its own instance, then it will probably crash. By passing it to the constructor, you can guarantee that the new class will always have an instance of cMessageProcessing, it would be impossible to instatiate the class (ie myClass = new MyClass()) without passing the correct parameters.
My current favourite word is: Bauble!
-SK Genius


AnswerRe: What this code is doing Pin
ag4667717-Dec-07 23:50
ag4667717-Dec-07 23:50 
QuestionQuestions about using System.Timers.Timer with clipboard Pin
surfingcode17-Dec-07 22:28
surfingcode17-Dec-07 22:28 
GeneralRe: And the question is ... Pin
Mircea Puiu17-Dec-07 22:37
Mircea Puiu17-Dec-07 22:37 
GeneralRe: And the question is ... Pin
surfingcode17-Dec-07 22:48
surfingcode17-Dec-07 22:48 
GeneralRe: And the question is ... Pin
AlwiNus17-Dec-07 23:04
AlwiNus17-Dec-07 23:04 
GeneralRe: And the question is ... Pin
Mircea Puiu18-Dec-07 0:43
Mircea Puiu18-Dec-07 0:43 
GeneralRe: And the question is ... Pin
surfingcode18-Dec-07 2:39
surfingcode18-Dec-07 2:39 
GeneralPlease help on regular expression Pin
lordbearsg17-Dec-07 21:11
lordbearsg17-Dec-07 21:11 
GeneralRe: Please help on regular expression Pin
m@u17-Dec-07 21:24
m@u17-Dec-07 21:24 
GeneralRe: Please help on regular expression Pin
lordbearsg17-Dec-07 21:29
lordbearsg17-Dec-07 21:29 
GeneralRe: Please help on regular expression Pin
m@u17-Dec-07 21:46
m@u17-Dec-07 21:46 
GeneralRe: Please help on regular expression Pin
lordbearsg17-Dec-07 22:14
lordbearsg17-Dec-07 22:14 
GeneralRe: Please help on regular expression Pin
m@u17-Dec-07 22:31
m@u17-Dec-07 22:31 
AnswerRe: Please help on regular expression [modified] Pin
Sandilian17-Dec-07 21:58
Sandilian17-Dec-07 21:58 
GeneralRe: Please help on regular expression Pin
leppie18-Dec-07 0:50
leppie18-Dec-07 0:50 
GeneralRe: Please help on regular expression Pin
lordbearsg18-Dec-07 20:45
lordbearsg18-Dec-07 20:45 
GeneralUsing resource strings Pin
ruanr17-Dec-07 20:59
ruanr17-Dec-07 20:59 

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.