|
Under what conditions does the UI freeze? Is it a complete freeze, or does the UI respond after some period of time? I noticed in your UpdateList() method that you do not call Patients.EndUpdate() if your update is interrupted; you should probably put that in a finally statement so that it is always called.
-Phil
|
|
|
|
|
Thanks to your help I managed to reduce the time to 17 seconds. My UI freezes these 17 seconds when it adds the nodes between the BeginUpdate() and EndUpdate() calls. I discovered that adding the nodes to the TreeView can not be done except on the main thread, so I called a DoEvents() in the loop and the freeze is gone.
I can't have gone this far without your help. I really appreciate it.
Thanks again.
Regards
|
|
|
|
|
Hi all,
To develop a game USING C#, i got the option to use XNA....
Would it work with :-
Visual Studia 2005 Proffesional edition
I guess to use XNA i have to install VS2005 express edition and now to install that i need to uninstall my proffesional version....
Is that true or would that work..
And what about the video card version ?
I guess by going to BIOS i can get the video card info as it supports only Direct3d 9.0 video card..
What do you suggest, should i use Direct X 0 version or should go with XNA by overcoming all the complexities as i dont want to uninstall VS proffeional version .
Or if there is hardly much difference in both prof and express then i might do that aswell...
overall which is better to use XNA Or DirectX or OpenGL(i dont know if it supports C#.net)
Please suggest....
Thanks
|
|
|
|
|
There are many options to develop games in C#. This includes using OpenGL libraries, managed/unmanaged DirectX libraries, or XNA.
Using unmanaged libraries like OpenGL, would require using something called P/Invoke. This is quite tedious, but possible. Also it won't be as fast as C++, but still quite satisfactory.
On the other hand, Microsoft has already provided managed DirectX library that you can use directly from your C# code. Again it's not as fast as the unmanaged code, but it should be in the future. I also think that DirectX 10 is managed, and the entire Windows Vista development will be built on C#, though C++ would still be an option, but it no longer would be number one in a few years. Still to early to say, but things are moving to DotNet.
XNA is an early immature games developing framework. You can also try it directlt from your C# code. It's quite like DirectX I think, but a little easier. From the Download page I quoted this line:
"However, other members of the Visual Studio 2005 line of products, for example Visual Studio 2005 Professional, can co-exist with XNA Game Studio Express on the same computer. "
I didn't try it, but I think if you installed it on your proffessional edition, it should work fine. Otherwise you can install the express edition without uninstalling the proffesional edition.
Regards
|
|
|
|
|
Thanks for your reply..
As you said OpenGL would be tedious, so i guess i would rather go with DirectX or XNA.
i guess direct x 9 and above supports C# but i really dont know which option would be best for beginner...XNA or directX.
Or should i try both and decide it....
Confusion...
But overall i guess there is no much difference in creating games using C# or C++.
C# is bit new for this but i guess its not bad at all for creating game...
What do you say ?
Thanks
|
|
|
|
|
Software_Specialist wrote: which option would be best for beginner...XNA or directX.
I haven't worked with XNA, but I believe you should give it a try first before you would take a look at DirectX.
Software_Specialist wrote: Or should i try both and decide it....
Well, atlest have an idea about how both work, and grasp the basics of each. Sure it would be better than holding on to one only.
Software_Specialist wrote: But overall i guess there is no much difference in creating games using C# or C++
Sure there is. Pointer for one is a major difference.
Software_Specialist wrote: C# is bit new for this but i guess its not bad at all for creating game...
No body said that. All am talking aout is that it's getting better. Some people would say that its performance is unsatisfactory. Others say its fine. if you are a beginner, then C# would wuit your needs.
Regards
|
|
|
|
|
Software_Specialist wrote: I guess to use XNA i have to install VS2005 express edition and now to install that i need to uninstall my proffesional version....
Then you guessed wrong. I have both professional and Express editions installed side by side and it causes no problems.
Software_Specialist wrote: should go with XNA by overcoming all the complexities as i dont want to uninstall VS proffeional version .
You don't have to uninstall VS professional edition. Where did you hear that anyway?
|
|
|
|
|
Oh yeh i was wrong it was for the beta version....
Not for prof...I guess i should give it a try with XNA..
Ill download this express version now..
Thanks..
|
|
|
|
|
Dear all,
I want read Excel file and create another new Excel file with the data inside a first file. how can select a Column in a Excel file than compare this Column to another and so on, than colect this columns and create a new file from that colected columns.
-- modified at 17:49 Saturday 13th January, 2007
|
|
|
|
|
Office applications expose a COM-based object model. If using .NET, they also include PIAs (Primary Interop Assemblies) that wrap the object model in a slightly more .NET-friendly manner. You could use this model to open, extract from, and write to Excel files.
See: Excel Object Model[^]
-Phil
Disclaimer: I work for Microsoft as a developer on the Visual Studio Tools for Office product team.
|
|
|
|
|
|
hi
i want to manage device(s) (for example send/recieve date) from usb device. does anybody can help me (tutorial,article,sample or ...) ?
thanks
|
|
|
|
|
|
Say some of our program resource is on CD, but we don't know which one (and want to use any available), what is best way to check available drives, and then check if disk we want is one of them?
|
|
|
|
|
If using .NET 2.0 there is System.IO.DriveInfo which gives you:
- all the drive letters
- so scan them one by one, and for each drive
- check drive type (check for DriveType.CDRom)
- check volume label (check for your CD's label).
If using .NET 1.1 you can follow the same scheme, but you would need PInvoke to
Win32 functions such as GetVolumeInformation (And that's exactly what I did today !)
Luc Pattyn
|
|
|
|
|
Visual C# 2005 EE so it's 2.0, I'll try that now...
|
|
|
|
|
OK got it thanks...
link for good example on that:
http://msdn2.microsoft.com/en-us/library/system.io.driveinfo.getdrives.aspx
|
|
|
|
|
hi all
i install vs2005 and msdn 2005,but msdn does not exist in my visual studio IDE,how to confugure it correctly ?
thanks.
|
|
|
|
|
As far as I know it involves a re-install.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
I am not at my vs2005 IDE right now but in vs2003 you can access help information in Tools->Options->Environment->Help.
If that doesn't work I would suggest a reinstall or possibly you could find the main help application that should have been installed with the MSDN library.
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Hi everybody
I'm doing a project were I need to do some advanced calculations on complex numbers. So I'm wondering if I should use a struct/class to represent the Complex data or should I use two arrays of primitive types to handle the real and complex part seperately. Is it more memory effecient to use primitive types than self-defined types?. I have read somewhere that primitive types in C# are objects themself, so I was wondering, if I define e.g a ComplexNumber class, would it be the same as using e.g float which is inheritet from System.Object?...
Thanks in advance
T
|
|
|
|
|
Take a look at the following MSDN resource to learn something about the Class and struct differences[^]. To come to your concrete problem: I would define a ComplexNumber structure because the primitive types like int or double are structures too and this way the general handling of a ComplexNumber would be similar to dealing with another primitive type.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook www.troschuetz.de
|
|
|
|
|
Hi,
A ComplexNumber class would use 16 bytes to store two 4B numbers (real+imag parts) plus 8B of
administrative stuff. So it effectively doubles the memory requirements, which
is only really significant if you are going to need more than 1M of those numbers.
I am not sure whether a struct has the same memory overhead or not.
But this is simple to find out: just create a small program than creates 1M complex numbers
(as 2 floats, as a struct, as a class) and in each case compare its memory footprint
before and after creation (make sure the objects are still alive when you measure (e.g.
by including code to sum them up, then print the sum).
The calculation cost will be different too. With a class, the natural way would be
to write methods that return a new object (say c=a+b), which involves calling the method,
doing very simple arithmetic, creating a new object, and returning it. (And this is
what you would have to do if you want to overload the + - * operators)
A cheaper approach would be to provide methods that do not return results, but modify
their parameters, something like:
static void AddTo(ComplexNumber a, ComplexNumber b); // performs a=a+b
of course, if ComplexNumber is a struct, you would use ref everywhere (obviously for
in/out values, but I recommend it for input-only parameters too).
The cheapest, but hardest way, would be to forget about a complex class/struct and
write everything in real numbers, with explicit add/multiply code all over the place.
Completely unstructured, very error prone and the fastest (at run-time that is).
If your application needs a lot of complex functions (hence a lot of code), I would
go for a class with overloaded operators, so you can really write c=a+b with abc all complex.
If the number of formulas is limited, I would suggest you start with a ComplexNumber struct
and use explicit method calls for each operation; but avoid creating objects all the time,
and certainly do not rely on methods that return a struct: instead have them modify an
already existing struct.
If in the end you are still convinced it needs to be faster and/or smaller, you could
then revisit the initial choice. But dont start it in the hard way from day 1.
But I do not expect you to really need this, unless you are chasing the next Mersenne prime
or so...
Hope this is helpful.
Luc Pattyn
|
|
|
|
|
Thanks for your answers guys
It really cleared some things up for me. The thing is that I'm doing some complex numbers math on sound data, so memory space is important. I'm using about 2^16=131072 samples data and if I do the Fourier transformation this will double up, because of the complex representation. This will end up something like 2^16*2*16=4194304 bytes ~4.2M which is a lot. So I'm thinking maybe I should do it the hard way...
If you you have something to add I'm open to suggestions...
Best wishes
T
|
|
|
|
|