|
I'm not sure but I thought I saw this somewhere on the web. Thanks.
-- modified at 18:21 Monday 20th November, 2006
M.E. Guzman
|
|
|
|
|
mitchellguzman wrote: I thought I saw this somewhere on the web
I assure you it was not in the Lounge.
|
|
|
|
|
*grin* you just beat me.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The only way to call .NET with COM is if the .NET component is also a COM component, or if the COM component is written in a .NET language.
Christian Graus - C++ MVP
|
|
|
|
|
Hello,
This is my first message here, so my Hello to you all again!!
This question is not quite related to coding, not directly atleast. I am just curious to know how DataReader class in .Net works??
Scenario is:
We do not call the constructor of DataReader class, this means that its constructor is marked "Private". Rather we use a Method, "ExecuteReader" of another Class "Command" while creating DataReader's object.
I am trying to mimic this thing. I can do this easily if ExecuteReader method belongs to the same class i.e. DataReader, but I have no idea how to implement the same technique using 2 seperate classes.
Command.ExecuteReader method returns a DataReader object, but does it also calls its constructor?
Inheriting DataReader Class is not possible because it is also marked "Sealed", so how can I implement the same thing??
Thank you.
Hope I have put the question well!!
---
HARSH GUPTA
|
|
|
|
|
You can make the constructor internal , that means that any class in the same assembly can use it.
---
b { font-weight: normal; }
|
|
|
|
|
If I make it internal , then I could even call it's constructor from Main method(in C#) or New Sub (in VB), which I am trying to avoid!!
|
|
|
|
|
Hi,
it all depends on how you dstribute your classes onto your assemblies. If your main method is within the same assembly than it could surel create an instance. You should think if it would be better to separate your main method from other classes.
Fact is that the different IDataReader implementations in the .Net framework all have internal constructors. Thus any class in the System.Data assembly could instantiate them.
Robert
|
|
|
|
|
Thank you Robert and Guffa. So Assembly is the key in this scenario.
Got it working.
---
Harsh Gupta
|
|
|
|
|
hgupta1983 wrote: If I make it internal, then I could even call it's constructor from Main method(in C#) or New Sub (in VB), which I am trying to avoid!!
Then don't put it in the same assembly as the main program.
---
b { font-weight: normal; }
|
|
|
|
|
I am sorry to ask this question here I need simple answer yes or no
|
|
|
|
|
I suspect your question will be reflected to the proper forum.
|
|
|
|
|
Private variables do not exist. They're just an on-going joke started by some OO wackos.
|
|
|
|
|
But when we watch those variables in VS.NET, we do see those variables. For example check m_roles in GenericPrincipal object.
|
|
|
|
|
This is a joke reply, about all you will get to a programming question asked in the lounge.
Christian Graus - C++ MVP
|
|
|
|
|
Great ..U R Master Of OO
|
|
|
|
|
|
Okies... please move this
|
|
|
|
|
Well, while I move this to the .NET forum, you could write some code and see for yourself...
Christian Graus - C++ MVP
|
|
|
|
|
Well, I first try .. then ask the question!
|
|
|
|
|
My reply to you is stored in a private variable. Maybe you can use reflection to discover (or maybe not ).
Jesus is Love! Tell to someone!
|
|
|
|
|
|
Hello!
I have a panel with 2 buttons and it has to be possible for user, resize the buttons. (Prog. language: C#)
Do you have some tipps for me?
|
|
|
|
|
Does the 1.1 framework run on NT4 server? The MS support documetns don't seem to differentiate between the server and workstation versions of NT4, while they do for newer OSes. My app has been tested using NT4 workstation, but I don't have access to an NT4 Server install to test against.
--
Rules of thumb should not be taken for the whole hand.
|
|
|
|
|
I seem to recall that NT4 WS and server used exactly the same code base, just different "tuning". Supposedly if one knew all the registry keys involved, one could even convert one to the other. That may explain why Microsoft doesn't differentiate compatiblility in this case...
|
|
|
|