|
I am creating my first control.
I am exposing a collection which I can edit perfectly via the property grid (We'll call this names).
Into this collection I can add Forename, Surname, Address etc.
I wish however to have another property exposed where, when the names collection has at least one member, I am able to select a default address from a drop-down populated with the contents of the 'names' collection.
I have seen examples of using GetStandardValues to return a static list of values from inside the type converter, but I cannot figure out how to reference my 'parent' object in order to iterate through the names collection and return values from that.
Many thanks in advance.
|
|
|
|
|
Hi All,
I have written a Windows application in C# running on Windows XP/2000 for .NET version 1.1 . When i execute the code, and load one of the modules for the first time, it takes around 3 sec.
After unloading, when the same module is reloaded with all the same parameters, it takes only about 1 sec. All the conditions to reload the module are the same, all the SP's called are the same, which i cross verified by the ANTS performance profiler!!! But still there is considerable time difference!!!
I thought that this difference was because of the JIT compilation which CLR does for the first time and for the successive times, JIT doesnt come into the picture, hence the time difference.
But I tried generating the Native images (pre-compile the code) of the complete code using "ngen", and after observation, concluded that the behavior still pertained.
I am now unable to locate the problem as in why the time difference exists?
1. Is it that im using "ngen" wrongly?
2. Is there some other reason for the strange behavior?
I would be extremely thankful on receiving valuable inputs from the forum,
Rajesh
|
|
|
|
|
RajeshGuptha wrote: 2. Is there some other reason for the strange behavior?
The hardware and OS caching of the files that are loaded into memory? You should see the same sort of difference with a native EXE.
led mike
|
|
|
|
|
Hi Led Mike,
Sorry i could not understand the comparison you are trying to mention here...If you dont mind could you please elaborate on that??
Regads,
Rajesh
|
|
|
|
|
|
Hi Led Mike,
Thanks for the guidance,
Ill read the article, and get back if needed.
Cheers,
Rajesh
|
|
|
|
|
For one thing, there is the file system's cache; whatever file is read, it ends up in this
cache (its size could be something like 25% of your total memory, which can well be bigger
than your application's exe file) so later executions of that exe (or its dlls) may be
faster.
Second, there are the security checks (of which I dont know any details); they may
execute a lot faster second time around, probably also due to some caching.
Third, Visual seems to require a few seconds when your application throws its very first
exception (I dont know why this is), so be careful about any debugging/observation tool
that is active during your tests.
Further concerns:
- is your exe very big ?
- are there many many other files required (dlls, ....) ?
- do they all reside on local disks ?
- is any networking involved (which typically contains rather big timeouts) ?
Finally, I would not suspect the JIT, I never had to really wait for it.
Hope this helps.
Luc Pattyn
|
|
|
|
|
Hi Luc Pattyn,
Thanks for your valuable inputs..
While testing, none of the debugging tools were active.. i had ran the .exe of my application.
My exe is not that big, though it requires around 20 dlls (20 projects in Visual Studio), one among them is really huge around 20MB, as it contains hundreds of images required by the application, and 4 COM components registered locally... Do you think this is a large number? And yes all these DLLs reside on local disks. If this is a large number, then should i think of redistributing code and reduce the number of DLLs??
I connect to DB on network, do you think this might create problems only for the first time?
And for the remaining probabilities you said, is there a work around for those problems?? Have you come across situations like these???
I would be very thankful in getting further inputs from you,
Regards,
Rajesh
|
|
|
|
|
Hi Rajesh,
well I never did a 20 DLL project, so I cant tell you that is the culprit. And I sure
would hope it is not, since DLLs are needed for component based development...
But I suspect one of these two:
- connecting to the DB could be the culprit; you might modify some code
and try a run without DB (i.e. fake some data locally and watch the start-up speed).
- Assuming you are starting your app (including loading images, and connecting to the DB)
all sequentially, you could try to do (large parts of) the initialization asynchronously
and in parallel, using a few separate threads.
If this does not help, I would start looking to the DLLs.
A possible experiment there is replace the big images DLL by something much smaller.
For all of the above:
- either keep the code as is, but include some logging
a couple of lines such as
Console.WriteLine(DateTime.Now.ToString("HH:mm:ss.fff")+" Starting/ending operation 3");
could reveal the bottleneck(s)
- or change the functionality of the code, but dont spend the time to modify everything
thoroughly (until you know for sure it needs the change), change just enough to be able
to judge start-up speed differences.
Regards,
Luc Pattyn
|
|
|
|
|
Hi Luc Pattyn,
Thanks a lot for your guidance.
Ill try all the possibilities, and read the articles which you have suggested. Hope to get some positive results..
Will get back to you!
Thanks and Regards,
Rajesh
|
|
|
|
|
FYI I just rediscovered an MSDN article that might interest you:
Improving Application Startup Time[^]
but be warned most of its suggestions fall in the category: "if you like some feature
because it is fancy, useful, powerful, you may not like its performance consequences."
Luc Pattyn
|
|
|
|
|
All,
Apologies if posting in the wrong forum, I wasn't really sure where to put this.
I want to create an application which can do the following:
Display a map (I'm not yet sure the format the map will be in)
Be able to pan and perhaps zoom around the map
Overlay geographic features onto the map (places of interest for example - pubs/hotels etc)
Be able to detect clicks on said features
I have tried to find a free GIS library to enable me to do some of these thnigs, but have thus far had no joy, only being able to find expensive libraries.
Thanks for your time
Jim
|
|
|
|
|
You could search codeplex for "GIS". I'm sure I saw some open source GIS libraries for .NET there.
|
|
|
|
|
|
That's great, thank you both. I had actually already come across SharpMap but thought that the LGPL license would too far restrict my use, as I am looking to have a GIS component in my application and then sell it to a client. According to the FAQ ( http://www.codeplex.com/SharpMap/Wiki/View.aspx?title=Is%20SharpMap%20free%20with%20no%20strings%20attached ) this doesn't seem possible, but perhaps I have misread?
Can anybody shed any light on this for me? If I have an application which uses the library am I able to sell this for a fee?
Thanks again
Jim
|
|
|
|
|
Hi All,
I'm currently working with Visual Studio 6.0 VB and C++, now I want to migrate to .NET platform, witch language should I choose ?
Any ideas, thanks
Carlos Mariano
|
|
|
|
|
Use C++/CLI and/or VB.NET 2005 =)
ROFLOLMFAO
|
|
|
|
|
Well C++ is still viable and as Scene states there is C++/CLI for doing Managed or even Mixed Mode development. If at all possible I recommend dropping VB altogether and moving to C#.
led mike
|
|
|
|
|
You want to keep as much as possible what you already have and know ? Stick to your familiar
language, inside .NET
You want to move forward ? Go for C#.
It may look a bit strange and complex at first (events, delegates, generics,...),
but you soon will appreciate its expressive power.
Luc Pattyn
|
|
|
|
|
If you're either more comfortable with C++ than VB or equally comfortable, then go for C#.
Kevin
|
|
|
|
|
C# goes more deeply than VB.NET ??
I really don't get the picture about what are the big diferences between both languages.
Thanks for the answers.
Carlos Mariano
|
|
|
|
|
First some similarites:
:: They both use the .NET framework. That means that there is very little difference in what you can do with the languages.
:: They both compile to IL code, using a JIT compiler to produce the final executable. Well written code in each language results in very similar IL code, so they perform about the same.
:: They both are fully object oriented (as opposed to VB 6, which is not).
Then some differences:
:: C# is a relatively new language, based on the better parts of Java, C++ and Pascal (Delphi), while VB.NET suffers a bit from being based on VB 6, and also suffers from being based on BASIC, a language that is over 40 years old...
:: C# uses strict data typing, while VB.NET uses implicit conversions. You have to specify most data type conversions in C#, while VB.NET will automatically perform conversions in the background. The automatic conversions makes some things easier, but it's quite easy to use expensive conversion by mistake if you don't know what you are doing.
:: The syntax of VB.NET is very similar to VB 6, which makes it compelling for old VB 6 programmers. The syntax of C# is similar to C++, which makes it compelling for C++ programmers.
It's a good idea to get some knowledge in both C# and VB.NET, as that makes it a lot easier if you find example code that you need to convert. It also gives a deeper knowledge in how .NET works.
---
Year happy = new Year(2007);
|
|
|
|
|
Guffa wrote: :: C# uses strict data typing, while VB.NET uses implicit conversions. You have to specify most data type conversions in C#, while VB.NET will automatically perform conversions in the background. The automatic conversions makes some things easier, but it's quite easy to use expensive conversion by mistake if you don't know what you are doing.
You can override this behaviour in VB.NET by setting OPTION STRICT on it.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Now I have more ideas about both languages.
Ok, thank you all for the replies.
Carlos Mariano
|
|
|
|
|
I don't know if i'm looking in the wrong places or if MS are trying to keep things as murky as possible but i'm very confused by all the info coming out of redmond about Vista .Net 3 and DirectX. I'll write down what seems to be the case and if anyone knows better can they chip in?
1 .Net 3.0 ships with vista but is available for XP. It can be developed using VS 2005 which is not supported on vista but will be Post-SP1. I'm not clear whether post-SP1 means that it will work once you've installed SP1 or whether they'll release a compatibility fix Post SP1.
2. DirectX update Nov 2006 contains DirectX 10 which gets the best out of the interface provided by Vista. This update does not work on Pre-ME releases of windows. I couldn't find whether DX10 was available for 2k3 server or XP or whether something different installs on those platforms.
This makes me think. Say I want to create a DX10 .Net app for vista, how would I go about developing it?
If anyone has any more authoratative links on these subjects i'd love to see them. If i find any better info on my hunt i'll post back here.
Thanks in advanced
Russell
|
|
|
|
|