|
Hi,
first of all: I don't have a direct answer to your question but:
What you see as memory consumption in the task manager shouldn't be too important for you. You are just seeing how much 'real' memory is currently consumed by your application. When minimizing windows normally just swaps memory away because it 'thinks' it won't be used anytime soon again. If your application keeps it memory on startup it doesn't make any difference because windows will do it the next time it needs physical memory. The performance difference shouldn't be noticable.
Also have a look at Task Manager/View/Select Columns and check Virtual Memory ( ihave a german windows thus the words might differ). You will see that this one doesn't change while minimzing/restoring.
|
|
|
|
|
Thank you both for your answers. They were really helpful, and I've learned yet again something new.
Although I completely undertand that trimming the working set leaves the virtual memory usage intact, I still think that forcing a trim is beneficial.
1. The application would run minimized nearly all the time so probably its working set is quite small compared to having all UI windows open.
2. Windows would do the same thing, if I minimized the application window manually, so where's the difference?
3. The working set can be increased if it has been trimmed too much, so the worst that can happen is some code would need to be reloaded from the page file. I can cope with that, this isn't a performance critical application.
There's one thing I cannot agree with in the article above: "Windows generally does a good job of memory management". This isn't what I see.
|
|
|
|
|
You're worrying about something that will actually have a negative effect on the performance of your app.
And YES, Windows and the .NET Framework does a great job at memory management.
What you're seeing is the CLR holding onto a chunk of memory so that future object allocations will be able to be serviced faster than if the CLR had to first go to Windows to get a block of memory, add it to the CLR's heap, then allocate for your object. Reducing the size of this managed pool will only make your app run a bit slower!
But, since according to you, performance is not an issue, why are you even worrying about this?? The CLR and Windows will make sure memory is available to whatever needs it, when it's needed.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi everyone,
I'm trying to find some information and really just looking for a bit of direction on how to create a PPTP adapter through code, and how to invoke that adapter to connect to my PPTP server. I've found some information on doing this in Windows CE with C on MSDN, however I was more or less hoping to do this with Windows 2000/XP clients through .NET. Any information would be greatly appreciated.
Thanks
xibalba
|
|
|
|
|
Hi All,
I am a total novice in the field of .NET programming. With
.NET framework getting popular day by day and offering loads of new technologies, I want to start learning it.
But the problem is that I am confused regarding where to start from and what all to study to become comfortable in
.NET area.
Requesting you people to please guide me in this regards. Please let me know some good books or links about .NET fundamentals.
Thanks and Regards.
|
|
|
|
|
First of all, Id like to warn that I'm pretty biased in favor of C# over VB.Net. They both do the same things, but VB has always striken me as a way of keeping those with older skills happy if they don't want to move forward to a more modern Object-Oriented language (ie Java or C#). Anywho, religious affiliations aside, back to your question.
Maybe its because I already had a formal education in Java, which is very similar to C#, but I found that the best way to learn was to look at the source code for simple C# programs and try to understand them, modify them, etc. Also, just browsing around the Documentation that gets installed with the SDK helps alot too.
There's also a plethora of very useful links if you know [who to ask].
That said, I can't really recommend any one tutorial since I don't know what your previous programming experience has been. If you're starting from scratch, a pretty good beginners tutorial can be found [Here]. If you're already proficient in an Object-Oriented or other type of language, then [this might be more your speed]. Either way, you'd probably get the most benefit from looking over a couple of tutorials, since they would reinforce each other on the key points and make learning easier.
Also, I highly recommend getting an IDE. The main two free options for Windows are:
[Visual C# Express, one of Microsoft's free IDEs]
and
[SharpDevelop, an Open-Source IDE]
Which one to choose is also a religious debate. I've never used C# Express personally, but I've heard good things. I've used SharpDevelop, and been happy with it. Personally, I aquired a copy of Visual Studio.Net through my favorite P2P app and never looked back. Say what you want about Microsoft and Windows, but the developer tools team has my deepest respects.
Anywho, I wish you good luck on this endeavour. Keep in mind that you never actually learn how to program. What happens is that the amount of stuff you can do from memory increases as you read and write more and more code, and thus you find yourself looking up stuff online less and less. $Deity knows I still find myself looking up beginner tutorials every once in a while
|
|
|
|
|
Hi,
Thankyou for giving me pointers. I'll start with the resources you have pointed out. As far as my programming experience goes, I have a pretty good experience in C++ programming with bit of templates and STL and also quite comfortable with core java.
So I think learning C# should not be a problem. Just one more question
Where does managed C++ fits into DotNET environment. And like you I am also bit more biased towards C#
Regards.
|
|
|
|
|
well, [This] [Set of] [Articles] seem like a pretty good resource.
I actually don't have much personal experience with managed C++, but from what I've heard you basically just take C++ code and compile it with the .Net compiler. To me it mainly seems to be for performance critial stuff.
Personally I don't see much need for it since you could just import c++ dll's into .Net apps anyway.
However, using managed c++ does mean that your entire app would be in CIL (Common Intermediate Language, it's what .Net apps get compiled into), and thus it would be runnable in any .Net runtime (ie [Mono] on a macintosh).
|
|
|
|
|
This is a useful summary for C++ developers.
http://msdn.microsoft.com/msdnmag/issues/01/07/ctocsharp/[^]
Also Jesse Liberty's Programming C# book (now in 4th edition for C# 2.0) is excellent for quickly getting up to speed with the language and touching a bit on all the technologies. (He has a separate book specialising on ASP.NET.)
psychedelic_fur wrote: I have a pretty good experience in C++ programming with bit of templates and STL
You'll like .NET 2.0 generics and the STL-like PowerCollections library then.
psychedelic_fur wrote: Where does managed C++ fits into DotNET environment.
Good question! I've not used it but from what little I've read about it I think MS are positioning it as the "systems" language for .NET, analogously to the way that C/C++ is the systems language for Win 32. There are certain things you can do in MC++ (now C++/CLI) that you can't do in any other .NET language - rather like there are things you can do in C++ that you can't do in anything else. Whenever you have such scenarios I guess that's when you'll turn to C++/CLI
Kevin
|
|
|
|
|
|
hi,
i'm starting to learn .net framework to develop pocket pc based softwares...my ultimate goal is to code database softwares with sql ce. But i'm confused which program best for sql ce database? ......
shall i start with vb.net or c#.net? ....any idea's?
thanks..
Sunny
|
|
|
|
|
they are both as good.
Or any other .NET language is as good for that matter.
Choose the one you fancy the most...
Q:What does the derived class in C# tell to it's parent?
A:All your base are belong to us!
|
|
|
|
|
Thanks a lot for your reply...well i heard from somewhere c#.net can't connect with sql ce.....not sure abt that...i researched on net and i found most of the tutorials are in vb.net........
Can any of you help me with some c#.net database tutorials? any links?
|
|
|
|
|
sunny747 wrote: well i heard from somewhere c#.net can't connect with sql ce
That's most definitely not true.
C# and VB.NET are almost interchangable. All you need to do is run whatever code sample you find through a VB.NET to C# translator to get a pretty good conversion of the code. You can use those few examples as a Rosetta Stone to figure out the language. You'll smack yourself when you see how easy it really is to convert between the two.
You can find a few online conversion utilities here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
thanks for the replies......one more question...
is microsoft windows mobile version 5 is refers as windows ce? ..i have seen many tutorials on windows CE so wondering whether it would work on my pocket pc or not....coz OS of my pocket pc is microsoft windows mobile version 5
thanks..
|
|
|
|
|
Windows Mobile is just Windows CE with .NET Compact Framework 1.0 SP2 and some office progams and stuff.
Wikipedia: Windows Mobile[^]
---
b { font-weight: normal; }
|
|
|
|
|
hi, i have a date and time picker in my smart device application. i can select a date and store that date but when i edit the date and time picker should be selected on that particular date rather than the present date..ive tried everything and i dnt know what i am doin wrong..has any1 got any suggestions please??
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
m_picker = New DateTimePicker
m_picker.Location = labelPlaceHolder.Location
m_picker.Size = labelPlaceHolder.Size
labelPlaceHolder.Parent.Controls.Add(m_picker)
labelPlaceHolder.Parent.Controls.Remove(labelPlaceHolder)
m_picker.Format = DateTimePickerFormat.Short
'Add any initialization after the InitializeComponent() call
End Sub
the above shows the code where the date and time picker is loaded and when i select a certain date, the value is stored in
labelPlaceHolder.Text = m_picker.Value.ToShortDateString
once i click on the edit button my form i want the date and time picker to show the value stored on the above line.
plz help me
thanks
|
|
|
|
|
I want in my RichTextBox this action to do: Backspace key takes the same action like left arrow key. Speaking generally I don`t want to delete characters by backspace key inside the textBox field unless it is the last character.
This code works in TextBox (do the action which I want) but unfortunatelly doesn`t work in RichTextBox.
private void textBox1_KeyPress(object sender, System.Windows.Forms.KeyPressEventArgs e)<br />
{<br />
<br />
char c = e.KeyChar;<br />
int start = textBox1.SelectionStart;<br />
int lenght = textBox1.Text.Length;<br />
<br />
if(c == (short)Keys.Back && start!=lenght)<br />
{ <br />
e.Handled = true;<br />
SendKeys.Send("{LEFT}");<br />
return;<br />
}<br />
}
Can anyone help me? Sorry for my english
|
|
|
|
|
This is a re-post of an article I put in the COM section. It refers to .NET, COM and RPC so it's kind of hard to get coverage by people with appropriate skillsets.
Here is the problem:
As soon as I installed XPSP2 the startup code in a COM object instantiated by a .NET Service hangs. This in turn cause the service to hang.
Observations:
The COM object is instantiating an RPC Listener when it hangs. It specifically hangs on an endpoint registration, though raaaarely it continues through after getting an error code. The function in question is RpcServerUseProtseqEp and it returns 1740 (duplicate endpoint) or hangs. I am very sure the endpoint is NOT already registered.
If I manually start my service it will work.
If I delay the service start by 5 minutes (in code) it will start.
If I add almost every service dependency I can it will still hang.
If I have another service start the COM object (query a web page in background) it starts fine!!
This all seems to work fine under 2000 SP4 and under the previous XP. I may just require a service environment (if it works under 2003), but I would really like to fix this behavior. This requires .NET, COM & RPC familiarity so I may have to move this to another forum.
Assert(this);
-- modified at 11:21 Monday 3rd April, 2006
Ok, found the fix for this. The RPC listener code was initiated in the DllMain section of the COM object. The DllMain section is a bad section to put any init code in due to lots of system locks etc... being set when that is called. Evidently XPSP2 has added some that were not there before and a previously working app. can now lock up.
|
|
|
|
|
VB.net
I am trying to learn how to write a document and saw this code
below: How do they figure out the number of characters?
Number of characters with spaces?
WriteLine("<o:characters>326")
WriteLine("<o:characterswithspaces>382")
|
|
|
|
|
What do you mean?
What kind of document are you writing? Who are "they"? What characters are you talking about?
---
b { font-weight: normal; }
|
|
|
|
|
It is a word document that is being populated. I was just wondering how they figure out how many charactres are in the document. It is a template document
|
|
|
|
|
They count the characters.
As that answer was so terribly obvious, it's probably not what you were looking for. Can you be more specific in your question?
---
b { font-weight: normal; }
|
|
|
|
|
Hello,
I'm trying to parse a string according to a Type that's being passed in:
<br />
Type inputType = Type.GetType("System.Int32");<br />
string inputString = "314"<br />
<br />
TypeDelegator td = new TypeDelegator(inputType);<br />
<br />
return td.InvokeMember("Parse", BindingFlags.Static | BindingFlags.InvokeMethod | BindingFlags.Default, null, null, new object[]{inputString});<br />
However, the code above results in a MissingMethodException: Method "System.Int32.Parse" not found.
Calling System.Int32.Parse(inputString) works fine, so I have no idea what's wrong.
I've played a bit with the BindingFlags, but to no avail.
First person to answer correctly gets a cookie!
Thanks!
Moo
|
|
|
|
|
Parse is a Public Static method, so add BindingFlags.Public
|
|
|
|