|
When I try to install my .net application in windows2003 & SBS I get a strange problem.
All the colors set for the forms doesn't appear. All the forms turn out to be ash in color.
I'm using framework v1.1.
With the same configurations it works fine in xp machine.
Could somebody help me pls...
Thanks in advance..
|
|
|
|
|
I've been working on an online judge(for ACM/ICPC) using C#.Programmes
submitted by users can now be compiled,and it's the problem to judge them.I
use the Process class in C#,and my thread is as follows:start a process
using this class with parameters such as input file,output file,etc,and
when the programme is running,i get its running information such as
running time,used memory,etc.I code as follows:
Process p = new Process();
p.StartInfo.FileName = "cmd.exe";
//the following line are parameters,by combining them we get //command like this: cmd.exe /C C:\\aaa.exe < C:\\aaa.in > C:\\aaa.out exit
p.StartInfo.Arguments = "/C "+workPath + _pid.ToString() +
".exe <" + probPath + _pid.ToString() + ".in >" + workPath +
_pid.ToString() + ".out &&exit";
p.StartInfo.CreateNoWindow = true;
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.Start();
//while (!p.WaitForExit(_timelimit))
while(!p.HasExited)
{
p.Refresh();
memory = (int)(p.WorkingSet64 >> 10);
runtime = p.UserProcessorTime.Milliseconds;
Thread.Sleep(15);
}
hopefully to get info of programme,it really does!but the result is
just strange.for instance,i write the following C file:
#include <stdio.h>
int main()
{
int i,j;
for(i=0;i<1000000;i++)
for(j=0;j<100;j++);
return 0;
}
it comes out that this programme uses around 1800KB memory(this may be
normal),but 0ms time----this is almost impossible! I test it alone,it
run at least 400ms!
there's another weird example:
int main()
{
int i,j;
scanf("%d%d",&i,&j);
printf("%d",i+j);
return 0;
}
this simple programme should use as much as 1600KB memory!!!
Is there anyone who can tell me what's the problem with my
programme?I ever heard that using managed codes to get memory and time is not accurate,is it true?Or is there any better way to get used memory and running time of a programme(not necessarily use C#,can use c,c++,etc---but better on Windows platform)? Appriciate your help!
|
|
|
|
|
Hi all,
How do you format the system date according to mysql date format? When I give the data type as date in mysql, there's an error message saying cannot convert data/time to mysql date format. How do I overcome this?
Thanks for any reply.....
|
|
|
|
|
public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
{
if(source==myTimer)
{
frmRun.getDanceModel(); <-- this line gets an error message "denotes a field where a class is expected"
}
}
how do I call any function when timer has elapsed? I don't quite understand why DisplayTimeEvent doesnt allow a function to be called.. Thanks much
|
|
|
|
|
If FrmRun is the name of your class -as I guess-, then for sure you'd get this error. Did you instantiate your class first?
Also the way you compare the source with the desired timer is quite odd. I guess you have multiple timers, and you have one handle for all of them? Otherwise if one timer only fires this event then no need to compare.
A suggested version of the handler would be this
public static void DisplayTimeEvent( object source, ElapsedEventArgs e )
{
Timer test = source as Timer;
if(test != null && test == myTimer)
{
frmRun MyForm = new frmRun();
frmRun.getDanceModel();
}
}
PS.
You did declare your method correctly, didn't you? Did you successfully call it from another method?
Regards
|
|
|
|
|
Thanks, however my problem is, frmRun has already been previously instantiated and what I want to do is call a function in frmRun which increments a value that is in frmRun. However the function doesnt recognize a variable that has been instantiated not in DisplayTimeEvent itself. How do I go about this problem? Thank you very much!
|
|
|
|
|
1. I created a c# class.
2. Ran regasm file.dll /tlb
3. Ran gacutil -i file.dll
Now I'm trying to create an instance of this in VC++ or view it as an object in OLECOMViewer (comes with VS.NET) but I keep getting
"80070002 system cannot find specified file" error when trying to instantiate this object or view its com object in olecomview.
Can anyone help? I just need its funcionality in VC++.
thanks all!
L
|
|
|
|
|
How do you sort arrays?
What is the exact structure?
Basically, I have four numbers that need to be sorted in ascending order, but I haven't the faintest idea where to even begin.
Any help would be much appreciated!
Thanks
|
|
|
|
|
Array.Sort is what you need.
Christian Graus - C++ MVP
|
|
|
|
|
I'm reading an article now but wan't to know if anyone has done this?
M.E. Guzman
|
|
|
|
|
I'm not sure how else you could do it ?
Christian Graus - C++ MVP
|
|
|
|
|
Certain IO methods, particularly FileInfo.LastWriteTime and FileInfo.Size are excruciatingly slow, especially the first time around.
I know the first time around is slow because the files haven't been cached yet. But it's excruciatingly slow; for a folder of about 1000 files, the cmd.exe dir command can do it in a few seconds whereas it takes System.IO.File and System.IO.FileInfo more than 30 seconds.
I noticed PowerShell has this problem too, since the ls/dir cmdlets use FileInfo as well.
Any ideas on a workaround/remedy?
Thanks in advance,
Rei
|
|
|
|
|
Write the code to do it in C++, perhaps using C++/CLI so you can call it from C#.
Christian Graus - C++ MVP
|
|
|
|
|
Hi,
I am trying to create some custom sound effects to use with the directx 9 managed code for c#. There are some effects that are bundled with the directx SDK but I would like to know how to go about creating my own. I need to know how I can route the audio signal from a secondary buffer through my own effects classes. Has anyone managed to do this? - I can't seem to find any info on the web about creating your own effects using c# with directx. If someone could point me in the right direction I would be very pleased!
Thanks.
|
|
|
|
|
Hi;
I want to know if there is a formula to determine if the user is moving the mouse clockwise or counter clockwise.
If there is could you explain to me?
Thanks
Hadi
|
|
|
|
|
Maybe this[^] will help
led mike
|
|
|
|
|
Calculate the angle for a vector from the center point to the mouse pointer, and watch how the angle changes.
---
b { font-weight: normal; }
|
|
|
|
|
Hi,
Get the x position of the mouse location. If the X attribute of the first position is less than the second, the mouse will bi moving clockwise, vica versa.
Good luck
jamil abou khalil
|
|
|
|
|
Take three different sample points A, B, C visited by your mouse.
Compute the vectors AB = v1 (v1x, v1y) , AC = v2 (v2x, v2y).
Sign of v2x* v1y - v1x * v2y will tell you the result:
positive = clockwise.
0 = aligned visited points
negative ...
Regards
|
|
|
|
|
I have a project that started out in VS2003. The last build in 2003 was 2.0.20727.42. I had the AssemblyVersion value in AssemblyInfo.cs set to 2.0.*.*. Things worked as I expected.
Now in 2005 I identified the new AssemblyVersion to 3.0.*.*. If I use Environment.Version , I keep getting the version from 2003 (2.0.20727.42) and it is never changing. If I set AssemblyFile, then I can see that value in Application.ProductVersion but a) This is a string I'd have to break down to get the versionning if I was to use it. b) It doesn't auto-increment.
When I did the upgrade from 2003, I created a new project in 2005 and then I used "Add Existing..." to add the forms and User Controls. Did something else get sucked in that is not allowing me to get the correct Environment.Version ?
|
|
|
|
|
I did the same as what I think you have done (i.e., add existing) and it worked fine for me. In fact, I have no version info.
1. Make sure to have the 2003 file set in a different folder than where the 2005 set will be.
2. Create a new project.
3. Add all the existing files (if .resx files having the same name exist, they will be imported automatically).
4. Click "Project" and select the project name (on the 2005 menu)
5. Click "Assembly Information..." (in the Application tab section)
6. Setup your new version info
Worked for me. Hope it works for you.
|
|
|
|
|
When text control in grid is active, esc key does not close form
How to close the form in this case in .NET 1.1 ?
To reproduce:
1. Run the code
2. Click in first row in first column
3. Press esc key
Observed: esc key is ignored
Expected: Esc must close form
using System;
using System.Windows.Forms;
namespace closeissue
{
public class Form1 : Form
{
public Form1()
{
this.IsMdiContainer = true;
this.Load += new System.EventHandler(this.Form1_Load_1);
}
private void Form1_Load_1(object sender, EventArgs e)
{
Form x =new Form2();
x.MdiParent = this;
x.Show();
}
}
public class Form2 : Form
{
public Form2()
{
dataGrid1=new DataGrid() ;
this.form1BindingSource = new System.Windows.Forms.BindingSource();
this.dataGrid1.DataMember = "";
this.dataGrid1.DataSource = this.form1BindingSource;
this.dataGrid1.Dock = System.Windows.Forms.DockStyle.Fill;
this.form1BindingSource.DataSource = typeof(createdobjectstotshown.Form1);
this.Controls.Add(this.dataGrid1);
this.KeyPreview = true;
this.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.Form2_KeyPress);
}
private System.Windows.Forms.DataGrid dataGrid1;
private System.Windows.Forms.BindingSource form1BindingSource;
private void Form2_KeyPress(object sender, KeyPressEventArgs e)
{
Close();
}
}
static class Program
{
static void Main()
{
Application.Run(new Form1());
} } }
Andrus
|
|
|
|
|
Create a cancel button on your form. In the form properties set this button in the CancelButton property.
- - - --[ i love it when a plan comes together ]-- - - -
|
|
|
|
|
Thank you.
My whole form contains datagrid.
I do'nt want to add a button to form.
Thi sis like Excel spredsheet which does not contain buttons inside.
Any idea how to close datagrid with Esc key, without button ?
Andrus
|
|
|
|
|
I'm creating a MONO/.NET 1.1 C# WinForms application.
I need run custom hook code before saving invoices and in other places.
I need to run and change C# scripts in customer site without VCS Express 2005 installed.
Any idea how to implement this ?
Andrus
|
|
|
|