|
Can these be used to build a well behaved timer, or would I have to use the same CPU hogging while (true) approach as I did when looking at DateTime.Now?
|
|
|
|
|
I recognize those. That's the raw Win32 API for the "High Resolution Timer". It's been around for years and is the baseline timer for programs like Windows Media Player and midi players that need to keep pace or the playback of video and audio is goofy.
It's fairly straightforward (at least it used to be, who knows under the modern .NET managed world of today). Give it a try. The only thing you have to do is check to verify that a High Performance counter is available by verifying the return value of QueryPerformancecounter does not return 0. I've actually never seen a system return 0, but there always a first time.
I'm surprised and not surprised that multimedia timers only work under XP. Especially since I've been using them in Visual C++ dating back to version 5.0 and windows 95.
Just one more example of a mediocre/partial port of basic functions under Csharp and .NET. Oops, sorry for the rant, umm...Csharp is gr8 .NET is awesome...there, that's better.
|
|
|
|
|
Hi..
I wanted to make a windows application setup project..for that reason i have downloaded the Visual studio BootStrapper plug-in but when i install my application setup (using a CD) on another computer the setup asks the user to install the .NetFramework even that the same folder on the CD has the .NetFramework redistributable file..I dont want the setup to ask the user for anything.
How could i solve this problem?.. please help
|
|
|
|
|
The goal of the bootstrapper is to see if the requirments of your application exists on the client PC or not, if yes it starts the setup of your application, otherwise it starts the setup of those requirments (.NET in your case), And the .NET framework can't be installed without the user agreement, ofcourse.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Thank you for your respond...
But i want it to use the .NetFramework redistributable file instead of telling the user to install the .NetFramework from the internet.Could you tell me how to do this?
|
|
|
|
|
You must configure the bootstrapper from the build menu in your projects, so that it starts the setup from the same directory.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
Thank you I will try it.
|
|
|
|
|
I have an arraylist full of strings, some of which will hopefully be identical (ie every entry will not be unique). How can I go about finding the most common string, the string that occurs most often? Does .NET give me any nice methods for doing such or will I have to do it myself?
I can think of one method; by making a 2D array, one dimension for storing the string, one dimension for storing the number of times it appears. However I dont think you can make a dynamically self sizing 2D array (like an arraylist) can you? If this is true I would need the array to be large to take care of the unknown number of items in the array list, and would end up being very slow.
Any help is much appreciated.
|
|
|
|
|
You could create a Hashtable where the keys are strings and the values are ints (the number of occurences of the string). Loop over the ArrayList of strings and either add each string to the table with a counter of 1, or increment the counter if the string is already in the table. When you're done, loop over the Values of the table and look for the highest counter.
Josh
|
|
|
|
|
Subterranean wrote: However I dont think you can make a dynamically self sizing 2D array (like an arraylist) can you?
You could make an arraylist populated with arraylists! That gives you something similar to a 2-D dynamic, jagged array.
However, if you're just storing the number of times a string appears you don't need a 2-D array at all. You just need to store an int with the frequency for each string.
You could create a class that wraps your string (as a member) and includes a member for the number of times it exists and store that in an ArrayList.
|
|
|
|
|
How to display data of datagrid into crystal report.
|
|
|
|
|
hi i think you need to generate a report for the dataset witch is supplying data to grid.
first you have to place the crystal report viewer on your form then you have to add crystal report page your project.then you have to connect the data base and particular table with that report page and allign the page.
now come to the form,
1.create the object for that crystal report page file,assume that name is crys1.rpt
then crys1 cry=new crys1();
2. set the logon password and uname for sql server
cry.SetDatabaseLogon(uname,password);3. set the report datasource
cry.DataSource=dataset;4.set the report source to crstalreport viewer
crystalReportviewer1.ReportSource=cry;
5.Bind the data source
crystalReportViewer.DataBind()
|
|
|
|
|
i'm creating a software that paint and draw on a picturebox, but it is very slow.
How can i accelerate it?
|
|
|
|
|
You may better draw on a panel not a picturebox.
------------------------------ "The Soapbox has been so ..."
|
|
|
|
|
|
Are you using the paint event to draw on top of the picturebox, or are you drawing on the image in the picturebox?
---
b { font-weight: normal; }
|
|
|
|
|
the second one calling invoke()
|
|
|
|
|
I don't know how are you doing the painting, but in my experience using double-buffer painting (by calling SetStyle(...)) has great effect on painting. Trying to do "ngen" will show you a very fast code execution resulting a good paint also.
AISAC - An Intelligent Sense of A Computer
http://aisac.wordpress.com
|
|
|
|
|
what is ngen? And where i have to do it?
|
|
|
|
|
NGen is the tool that ships with .net framework. IF you've installed Visual Studio or .net framework sdk, go to sdk or vs commnad prompt (to have the path to ngen.exe) and try to run ngen.exe, it's a command line tool.
AISAC - An Intelligent Sense of A Computer
http://aisac.wordpress.com
|
|
|
|
|
hi all
i am created one windows application with opendialog box and stream reader. it is running fine in my mechine. then i copied that in to my server. when i try to the project in server, i am getting the fallowing exception
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
i had searched in the net with the above keyword and find that .net won't give permission to run projects in shared/network drives. is there any other solution for this
coolsweety
|
|
|
|
|
Hi all,
We have a functionality that opens a word document on a button click . The user can enter any thing in the word document and it gets saved with a different name.The original document is closed.
The problem is , every time the application is run, it opens a WINWORD.EXE in the processes tab of the task manager, which , after repeated executions of the project, add up to a large number.I cannot figure out why tjis is happening even as the word document is being closed after saving.
So is there any way to close the process as soon as the document is saved with a differenty name?
Thanks in anticipation
|
|
|
|
|
I have the same problem sometimes with Word 2003 when using outlook.
If you use automation you'ld probably be able to use some function from the object model or something.
If all else fails, look into the Process class.
eg.:
Process process = Process.GetCurrentProcess();
process.Kill();
hope this helps.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|
|
hi,
Process proc =Process.GetCurrentProcess()
Proc.Kill()
is killing my application but not the winword..
Is there a way to identify the winword process uniquely and kill it?
Thanks...
|
|
|
|
|
You didn't read correctly .
Look up the Process class on MSDN.
This was just an example:
Process proc =Process.GetCurrentProcess();
Proc.Kill()
You can find the process by name or by id.
Coulda, woulda, shoulda doesn't matter if you don't.
<marquee>
|
|
|
|