|
Stephane,
Start/Stop is not of interest to me.
I'm trying to figure out if it's possible to change MaxThreads in .NET ThreadPool class, which is static through safe .NET facilities.
However, the only solution I've found so far is through COM Interop:
http://www.csharphelp.com/archives3/archive487.html
I don't get it: why SetMaxThreads is not exposed?: What a pain...
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
importing the COM signature seems to be the only way to go since :
- it's native code in the end
- SetMinThreads(wt,ct); doesn't seem to help much
Rotor's source code (sscli/clr/src/vm/win32threadpool.cpp) seems in debug mode to lookup the CLR config file for a "MaxThreadpoolThreads" keyword in it, and replaces the default "25 * nbCPUs" value with it, if any. I don't know at this point if the commercial CLR does it too.
RSS feed
|
|
|
|
|
I have some custom drawing code that I'm doing in my application. I made sure to use the using statement or explicity call dispose on all the brushes and pens that I'm using to make sure that I don't have any memory leaks.
My problem is that if I start the application and move the mouse around to cause the drawing to occur then I see in the task manager that I slowly eat up more and more memory, 20-60k at a time. If I don't change a single line of code but put in a GC.Collect() at the end of my drawing then I see that no extra memory is consumed.
I've left the application running for a while and I don't see the memory being released w/o the GC.Collect().
Am I supposed to just trust that everything is going ok under the covers and that at some point Garbage collection will get it? If I do this and I give someone here my application won't they assume I have a memory leak?
Thanks,
Michael
|
|
|
|
|
Am I supposed to just trust that everything is going ok under the covers and that at some point Garbage collection will get it?
Yes, I suppose you do have to trust -- unless otherwise....
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
Consider a separate GDI profiler, like this one[^].
The fact that GC.Collect() affects the amount of used handles is quite normal. Would you be surprised if you sent yourself a WM_CLOSE message that your application got finished?
RSS feed
|
|
|
|
|
I am developing an application where I am seeking the look and feel of Microsoft Outlook. I have created some forms for my different objects (contracts, suppliers etc.). I have created ContractListForm, ContractForm, SupplierListForm and SupplierForm among others.
Now, in my main form, I have a toolbar to the left and when the user clicks one of the buttons, I want to open up the correct *ListForm to the right (not in a new window).
Is this possible? If not, how should I design this?
I would like to be able to do just like in Outlook, where the user can chose to open the Inbox for instance either to the right, or in a new window.
/Ricky
|
|
|
|
|
What I did one time when I was trying to do the same thing was put a panel control where you want the form to go. The panel control, if I remember correctly, is able to "host" a form so you just create an instance of the form and add it to the panels controls.
|
|
|
|
|
I have already tried that but when i Run:
myPanel.Controls.Add(myForm);
...I get an error message something like this:
"You can not add a top-level control to a control".
(I should have written that in my first post.)
So, do you know if it still is possible any other way?
/Ricky
|
|
|
|
|
What I did was this, and it works for me:
In the constructor code for the form add:
this.TopLevel = false;
In your main form use this:
frmAddNew add = new frmAddNew( );
add.Parent = panelWorkArea;
panelWorkArea.Controls.Add( add );
add.Visible = true;
Let me know if that works for you.
|
|
|
|
|
Thank you!
That works just fine. Next, I will try to get rid of the form border. I quickly found the ways to remove the system, minimize, maximize and close buttons. I docked the form to the panel so when the panel (inside it's form) resizes, the subform follows. Perfect... but, the user still sees the window border and caption and can manually resize the form. I suppose it's very easily removed but I simply have not found the command yet. My knowledge in Windows Forms seems quite rudamentary yet.
/Ricky
|
|
|
|
|
No problem, glad it helped.
For the border, just set the border style to none and the title and resize-ability will go away.
Michael
|
|
|
|
|
You can somehow set ID numbers to the buttons on your toolbar and then catch every event from this button or something like this
private void button1_click (la la la ..)
{
ContractListForm frm1 = new ContractListForm();
this.Hide();
frm1.Show();
}
"I have not failed.
I've just found 10,000 ways that won't work."
- Thomas Alva Edison (1847-1931)
|
|
|
|
|
One other approach would be to derive all your *ListForms from UserControl instead of Form. You can still use the forms designer with a UserControl. I don't think you will lose much, if any, functionality that you need, but you may have more flexibility for reusing the *ListForms and for hosting them in any type of control or form.
I've also been wondering about the best approach for something like this, so I would like to pose a general question to the group. To create the type of "Outlook" UI Ricky asks about, is it better to use Forms or Controls (such as UserControl)?
Which has more flexibility?
Which is easier for RAD UI development?
Which has more support and is more widely used?
Which is easier for integrating menus, toolbars, etc.?
In my case, I have two choices. I could use either a tabbed MDI host (like in VS.NET) with multiple forms, or I could use various host controls (including tab controls, etc.) to display my own UserControl-derived objects.
Any comments are appreciated.
Dave
|
|
|
|
|
Hi ,
I had created a toolbar and need to deploy it over the internet . I created a cab file with an ini file in it . This cab file was referenced from a html page through the OBJECT tag . The cab file was aldo digitally signed with a certificate created with the help of the tools available in .net . But when that page is referenced the installation does not take place .
Please help . Where could i have gone wrong . The OSD file everything has been written with the help of instructions from the MSDN documentation .
And how do i run a dos command from an ini file . I tried usig the run statement but it didnt work . Please tell me how to do it . If run is the command then please send the syntax for the run statement .
Srikar Y
NITK Surathkal
|
|
|
|
|
Hi All,
I develop plugins for graphic apps. So far I used Visual Studio 6.0 also because it was the tool of choice for the SDKs of such graphic apps.
Now some vendors have moved their SDKs to .NET
So far I only heard bad rumors about the "opennes" of the code that the .NET IDE produces and on top of that I don't care to be net-ready or anything of the kind, I only need to process pixels. At risk of sounding naive and ignorant my questions are:
Is there an independent and reliable source where I can read more about pros and cons of using .NET? When is really necessary to use it and when is only trendy or redundant?
Is there a way (or secret recipe) to turn .NET into Visual Studio 6.0 or something close to it?
Thank you.
|
|
|
|
|
Yeah, by unistalling .NET and installing visual studio 6.
Seriously though, .net is neither trendy or redundant. Depending on the language you are coming from you'll be amazed at how much more you can accomplish in .net compared to your previous language. Things that used to be difficult or require 3rd party tools are now easy and built-in to the language.
.net 2003 comes with an obfuscator(?) or you can get a tool for .net 2002 that will do it for you.
|
|
|
|
|
Does anyone know how I can get (and eventually set) the properties of a file.
I have some pictures take with a digital camera. In all the pictures properties (attributes?) are set for lot o things. E.g. Widht, Height, Bit Depth, Flash Mode, Focal Length, etc...
I guess that the attributes are dynamic. But how can I read them using the Framework?
I have not been able to find the attributes using a FileInfo-object.
I have seen someone doing this on the net using a COM-object with prog-id "DSOLEFILE.PropertyReader".
Do I have to use this in stead? And in that case where can I find it?
Thanks in advance,
Mattias
|
|
|
|
|
Here is a class I have used before:
Imports System.IO<br />
Public Class ProjectFile<br />
Private _path As String<br />
Private fi As FileInfo<br />
Private _Name As String<br />
Private _DirectoryName As String<br />
Private _Extension As String<br />
Private _Attributes As String<br />
Private _CreationTime As Date<br />
Private _LastAccessTime As Date<br />
Private _LastWriteTime As Date<br />
Private _Length As Long<br />
Private _FullName As String<br />
Public Sub New(ByVal path As String)<br />
_path = path<br />
fi = New FileInfo(_path)<br />
_Name = fi.Name<br />
_DirectoryName = fi.DirectoryName<br />
_Extension = fi.Extension<br />
_Attributes = fi.Attributes.ToString()<br />
_CreationTime = fi.CreationTime<br />
_LastAccessTime = fi.LastAccessTime<br />
_LastWriteTime = fi.LastWriteTime<br />
_Length = fi.Length<br />
_FullName = fi.FullName<br />
End Sub<br />
Public ReadOnly Property FullName() As String<br />
Get<br />
Return _FullName<br />
End Get<br />
End Property<br />
Public ReadOnly Property Length() As Long<br />
Get<br />
Return _Length<br />
End Get<br />
End Property<br />
Public ReadOnly Property Path() As String<br />
Get<br />
Return _path<br />
End Get<br />
End Property<br />
Public ReadOnly Property Name() As String<br />
Get<br />
Return _Name<br />
End Get<br />
End Property<br />
Public ReadOnly Property DirectoryName() As String<br />
Get<br />
Return _DirectoryName<br />
End Get<br />
End Property<br />
Public ReadOnly Property Extension() As String<br />
Get<br />
Return _Extension.ToLower<br />
End Get<br />
End Property<br />
Public ReadOnly Property Attributes() As String<br />
Get<br />
Return _Attributes<br />
End Get<br />
End Property<br />
Public ReadOnly Property CreationTime() As Date<br />
Get<br />
Return _CreationTime<br />
End Get<br />
End Property<br />
Public ReadOnly Property LastAccessTime() As Date<br />
Get<br />
Return _LastAccessTime<br />
End Get<br />
End Property<br />
Public ReadOnly Property LastWriteTime() As Date<br />
Get<br />
Return _LastWriteTime<br />
End Get<br />
End Property<br />
End Class
Also check out this link: LookCool, an image browser application (JPG only) and Photo Properties By Jeffrey S. Gangel
Jim
|
|
|
|
|
Thanks a lot...
That helpt me out completely.
/Mattias
|
|
|
|
|
how can I make a shortcut for button in .net cf (smart device application for windows ce .net)
Ignatov
|
|
|
|
|
Anyone know of a Diff component (like WinDiff, WinMerge, Araxis Merge, et al) which i can use to compare files, which preferably ALSO has support for reading from streams, not just from disk files?
Thanks in advance,
- Eidolon.
|
|
|
|
|
There are at least two different managed diff implementations posted as articles here on codeproject. Do a little searching.
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Hi @ All!
I was wondering if anyone knows about a class in the .net framework to work with shortcut (.lnk) files.
Should be a class to get the path of the exe, the image etc...
I searched the .net help for hours, but i couldn't find anything. Now i might write a class myself, but i thought i'll ask if there already is one first...
thx!
|
|
|
|
|
Hi everybody.
Is there a way to use .NET Remoting with Visual C++ .Net?
In positive case, how to build the interfaces like they're
built in C#?
Thanks,
Moises.
|
|
|
|
|
With VS 2002 we could send a GET request to a web service and it would work. After upgrading to VS 2003 it doesn't work and doesn't seem to be available. Anyone know what happened?
ed
Regulation is the substitution of error for chance.
|
|
|
|