|
But then why Microsoft not sue Sun for the StarOffice ? It seems to
copycat from MS and compete with it.
|
|
|
|
|
Microsoft didn't invent word processing. Word is a copycat of WordPerfect.
If Sun ever infringe one of MS's patent, make sure they will get sued.
|
|
|
|
|
Hello,
Are there any standards for designing form or form builder. I need
to write a form designer so that user can design and custom their own
form in the application ? It is fine to write it in c#, but I want to know
if I need to conform to some standards in the market, so to make my application more universal and better compatitibility ?
Many thanks
|
|
|
|
|
|
Hi,
I am writing dll in c#.Net. The dll size is quite large and I wonder
whether it is good to break it into smaller dll. My question is that
will the OS load the whole dll into memory or just load the necessary
objects that is in use to the memory within the dll when the dll is running
? So if it just load the necessary requested objects into memory, I don't need to break it into smaller dll.
Thank in advance
|
|
|
|
|
You make a reference to the whole dll, not parts of a dll, so the whole dll is loaded.
---
b { font-weight: normal; }
|
|
|
|
|
So does it mean that I need to break the large dll into smaller one
so that it consumpt less memory ?
|
|
|
|
|
Not necessarily. When ever the .DLL(s) is/are loaded into memory, they don't get dropped until the process that loaded them quits. Say you break this into 2 .DLL's, then your app calls a single function in each .DLL. They're both going to be loaded until your app quits. So where's the savings? There isn't any.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
But will it unload the unnecessary dll when it finish using it?
Say dllA call dllB, and when dllA finish calling dllB, will dllB unloaded ?
|
|
|
|
|
Not until the app quits. Once it's loaded, it stays loaded in case there's another call to it.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I got a really strange problem with one of my applications. The application is a single dialog screen (basic form) which have a Tab control on it.
However, for some reason, every time that I start it up - the form appears behind any window that is on the screen... basically I would assume that it's Z order told him that. Putting 'BringToTop' on the constructor, Load or Activate events didn't worked.
It is the first time that I saw something like that, and there is probably a simple stupid solution that I am missing...
Any clues what might be happening? Any ideas for solutions (at this point I am using TopMost=true/false to handle it - works in an ugly way).
Here is the 'auto generated' code for the form. Nothing here that I noticed...
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(626, 440);
this.Controls.Add(this.tabMain);
this.Controls.Add(this.label1);
this.Controls.Add(this.btConnect);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimumSize = new System.Drawing.Size(632, 472);
this.Name = "MainForm";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "My App";
this.TopMost = true;
this.Resize += new System.EventHandler(this.MainForm_Resize);
this.Load += new System.EventHandler(this.MainForm_Load);
this.Activated += new System.EventHandler(this.MainForm_Activated);
this.ResumeLayout(false);
Thanks,
HS.
|
|
|
|
|
1.What is meant by the term "stack trace"?
2.If it doesn't mean simply looking at what's loaded on and off the stack when I step-through the debugger, then when and why would I want to do this?
Many thanks in advance.
|
|
|
|
|
SkunkedWorks wrote:
1.What is meant by the term "stack trace"?
It's a trace of all the functions that were not yet completed because they called another function, ending with the function that has a break point.
SkunkedWorks wrote:
then when and why would I want to do this?
When debugging, you may for example have a crash in a common helper function, such as a library to handle stored procedure calls, and the stack trace will tell you what the real cause of hte problem is, because it will show you which method called the helper method incorrectly, or at least ( in this case ) what stored proc is being called.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Ok, I know this might sound simple, but it's not. I want to Implement the IList interface but I want certain members of it hidden (for example IndexOf and the default public object this[int Index] ) because I am creating a strongly-typed collection.
In VB.NET I could easily do this because each method knew that it was Implemented by a simple: Private Function IndexOf(Value As Object) As Integer Implements IList.IndexOf .
The Implementation was fine in VB like this because one could still cast the object to an IList type and access the methods on it even thought they were private within the Collection class.
Does anyone know how to do this?
|
|
|
|
|
VB lets you change the visibility of objects from an interface ? What a hack !!!
Have you thought of using C# 2.0 ? It's collections are strongly typed. Otherwise, your class will need to contain an IList, not be one.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Umm, no, VB does not let you change the visibility of objects from an interface. If you remember, Interfaces are SUPPOSED to be only methods WITHOUT accessors (i.e. Public, Private, etc.). So that means that any Class implementing that Interface can change the visibility to whatever they want, just as long as every method is Implemented. So, it's not a Hack, it is by design.
However, I did find out how to do this in C# if anyone is interested. It's called Explicit Interface Member Implementation[^] !!!
|
|
|
|
|
By the way, public and private are not accessors, they are "access specifiers" or "access modifiers."
Matt Gerrans
|
|
|
|
|
It doesn't make any sense to implement an interface and then try to hide some parts of it. The whole point of the interface is to communicate what methods and properties (or more generally, behavior) your objects support.
Sounds like what you should do is define your own interface that may be similar to IList , but is not, in fact IList .
I know I would be more than annoyed if I was presented with an object that seemed (and claimed) to implement some interface, but then failed to correctly support all the things that the interface implied.
Why would you want to do this?
Matt Gerrans
|
|
|
|
|
You see, it's very simple. For someone who writes object models for a living, I've seen a lot that just don't make any sense (ex. Adobe, Maximizer, etc.). I hate when someone gives a method like "Remove" when I am working with a collection of Files (Remove what?). Instead, I like to rename the Method to "Delete" and implement the "Remove" method privately. The private method will simply call the Public method on the collection class.
Don't get me wrong, I implement as much as the interface as I "can". There are some methods though that I DO like, however, the fact that you have to pass an object instead of my custom (strongly-typed) collection object (i.e. a custom File object for example). For example, if you Implement the IDictionary Interface, it uses this: IndexOf(object Key) . What? Since the Keys SHOULD all be strings in my collection, why do I want to allow a programmer to pass a Guid, Int, or whatever else they can think of? If they want a guid, pass a Guid.ToString() .
If you look at a lot of the pre-defined Collection classes Microsoft created, they also "hide" a lot of interface methods because they just don't make sense for the particular object, but you can still cast them to an Interface that they implement and use the Properties / Methods that way.
Now, as to why I am implementing an IList? Well, It's nice to have a custom collection class that can be databound to a DataGrid or other controls.
|
|
|
|
|
actually you can do this in C#, I wont implement all of IList but ill show you how to make Count available publically, but IndexOf only available when typed as IList
public class MyList : IList
{
public int Count
{
get{return this.count; }
}
IList.IndexOf(object obj)
{
return ...
}
}
|
|
|
|
|
Greetings,
I am curious if someone has a funtion implemented in C# similar Array REDIM in VB?
Sincerely,
Max Pastchenko
|
|
|
|
|
Use an arraylist if you want a resizable array.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Here's a simple one:
string[] Temp = new string[20];
Array.Copy(MyItems, 0, Temp, 0, MyItems.Length);
MyItems = new string[20] {};
Array.Copy(Temp, 0, MyItems, 0, Temp.Length);
Array.Clear(Temp, 0, Temp.Length);
Temp = null;
|
|
|
|
|
This is also something I found, not sure if it'll work but it looks good:
public static System.Array ResizeArray (System.Array oldArray, int newSize) {
int oldSize = oldArray.Length;
System.Type elementType = oldArray.GetType().GetElementType();
System.Array newArray = System.Array.CreateInstance(elementType,newSize);
int preserveLength = System.Math.Min(oldSize,newSize);
if (preserveLength > 0)
System.Array.Copy (oldArray,newArray,preserveLength);
return newArray;
}
|
|
|
|
|
That method looks very good.
Our Instant C# VB to C# converter converts VB redim preserve statements to C# in-line equivalents, via something like the following example:
VB:
Dim YourArray() As Integer
...
ReDim Preserve YourArray(i)
C#:
int[] YourArray;
...
int[] temp = new int[i + 1];
if (YourArray != null)
Array.Copy(YourArray, temp, Math.Min(YourArray.Length, temp.Length));
YourArray = temp;
(we have to add 1 since VB arrays sizes are specified in terms of their upper bound, not the number of elements)
David Anton
www.tangiblesoftwaresolutions.com
Home of:
Clear VB: Cleans up outdated VB.NET code
Instant C#: Converts from VB.NET to C#
Instant VB: Converts from C# to VB.NET
Instant J#: Converts from VB.NET to J#
|
|
|
|