|
|
I've done a C# project with USB, using QuckUsb from Bitwise systems. I've even document some (still working on it) of the unmanaged APIs on PInvoke.net.
/\ |_ E X E GG
|
|
|
|
|
Hi all,
I want to run tlbimp programatically. I want to provide AddReference dialog as .NET IDE is providing.
User will provide the path of UnManaged dll and i will run tlbimp on it and generate assembly programatically.
can anyone tell how should i do it.
Thanks,
Tushar.
|
|
|
|
|
Hi,
I have one button in Winform. I want to call Windows Dial up Thr Win API after pressing the Button.
waiting for the code
Thanks & Regards
sanjeev
|
|
|
|
|
I have a treeview,there are many treenodes in the treeview.
I just want to change one treenode's height(not all the treenodes' height).
Can someone tell me how to do it?
|
|
|
|
|
I forgot it that the treeview was in windows form.
|
|
|
|
|
You can't do this with the TreeView from the FCL.
If you have to get this behaviour you'll have to write your own TreeView or take a look on the ones available here on CP.
Regards,
mav
|
|
|
|
|
Hey Everybody!
I am looking for a way to know how many objects has been serialized in my file (using the FileMode.Append).
I thought that the SerializationInfo.MemberCount property should give me that kind of information, but I was completly misunderstood it.
so, is there a way to know how many objects has been serialized into a file???
Thanks ! ! !
|
|
|
|
|
From MSDN:
The result of a unary + operation on a numeric type is simply the value of the operand.
Why have it when it does nothing?
There could be some use with it if it could do the same as Math.Abs...
The PROgrammer Niklas Ulvinge aka IDK
|
|
|
|
|
Why? Because you can overload it. However, I don't know any example when it can be usefull, but still...
On the same page:
"User-defined types can overload the unary + and binary + operators"
David
Never forget: "Stay kul and happy" (I.A.)
David's thoughts / dnhsoftware.org / MyHTMLTidy
|
|
|
|
|
Yes but why define it on int?
You could still overload it
at another point.
The PROgrammer Niklas Ulvinge aka IDK
|
|
|
|
|
Because mathematically, +3 == 3 and you'd want that to hold in your programs.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Does someone know why C# doesn't have covariant return types?
All I want to do is this
class GeneralItem
{
public abstract object GetContents();
}
class StringItem : GeneralItem
{
public override string GetContents()
{...}
}
I get a compiler error saying it doesn't like return types of overridden methods to be different. It's legal in C++, so why is it not available in C#?
The workaround suggested is to provide an explicit interface implementation, but I don't have one defined already. Defining a new interface just doesn't seem right.
It isn't available in C# 2.0 either. Any idea why?
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Why don't you just have the return type object and then return a string inside the func?
The PROgrammer Niklas Ulvinge aka IDK
|
|
|
|
|
Because users of StringItem would have to cast to a string . They already know they have a StringItem instance, so why should they have to cast the return value of GetContents to string again?
In my code, the user would first have to cast from GeneralItem to StringItem anyway. So he/she actually ends up casting twice.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I think you have to live with that...
The PROgrammer Niklas Ulvinge aka IDK
|
|
|
|
|
I want to know why there are no covariant return types, I do understand that I've to live with it, (atleast until the next version of C# rolls out, whenever that is.)
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Becouse if you use that func and think you got the parent, but got the child and it return a string when you wanted an object.
PS. They could do it with only child's to the return type is able to be a return type (and for object, that's everything...)
The PROgrammer Niklas Ulvinge aka IDK
|
|
|
|
|
It shouldn't be a problem, after all, a string "is-a" object, so the code that calls GetContents() on GeneralItem should be able to handle any type whose base class is object.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
Probably because Microsoft thought it would be confusing. Why would you want to do this ? If the overridden classes differ by return type, how will you know what you're getting back anyhow ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I'm anyway going to get a string if I call GetContents, whether it is on GeneralItem (with runtime type = StringItem) or StringItem directly. For StringItem, I already know I'll get a string, so why do I have to cast again? For example
private void ProcessItem(GeneralItem item)
{
Console.WriteLine(item.GetContents());
}
private void ProcessItem(StringItem item)
{
string s = (string)item.GetContents();
}
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
You are thinking only in terms of string is a typeof object kind of way what, if the return types did not come from the same hierarchy at all eg. base class returns point your override returns string, this is a very difficult thing to keep track of especially if you want the compiler to throw errors in these kind of situations ...
|
|
|
|
|
The compiler doesn't allow that. If the overridding method's return type is different, it must be a derived class of the base class method's return type. So your case, (base class method returning Point, derived class method returning string) will not compile.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
|
Thanks. Yes, I did read that but it doesn't seem to answer why covariant return types are not available in C#.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|