|
Yeah, i was going through it, and i must have missed it, but i figured it out now...
|
|
|
|
|
how to know which procces['s] have access to a file in c#?
thnx
|
|
|
|
|
Check out for 'Task Manager Extension' article in CodeProject. That would give some idea.
You may need to use it through P/Invoke.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
Task Manager Extension writen in vcc .... i dont understant vcc code ..can u give me c# or vb.net code?
|
|
|
|
|
Lots of things cannot be solved with .NET alone, so you better start learning to use Win32 calls as well.
Nobody here will translate the project for you just because you don't understand C++. We're all here to learn something and it seems to me that you've got an excellent opportunity to learn something new here...
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Hello all,
I am currently writing a very simple 2D game for school. I have created a Sprite class to display images on a windows form. In the constructor of the Form1 class, I have the following code:
handle = this.CreateGraphics();
handle is a Graphics object.
Then, in the Sprite class, this object is used to draw images to the screen:
public void Draw()
{
Matrix m = new Matrix();
m.Rotate(rotation);
handle.Transform = m;
handle.DrawImage(bitmap, destination);
handle.Dispose();
}
However, when I run the code, I get the following error on "handle.Transform = m;":
A first chance exception of type 'System.ArgumentException' occurred in System.Drawing.dll
Commenting out the line for testing just moves the error to "handle.DrawImage(bitmap, destination);".
I've been stuck on this for hours now without any progress. Anyone that can give me a push in the right direction?
Many thanks!
|
|
|
|
|
does the exception throw when you start the exe directly? (not from the ide..)
|
|
|
|
|
Yes, that doens't make a difference.
More detailed exception:
System.ArgumentException: Parameter is not valid.
at System.Drawing.Graphics.set_Transform(Matrix value)
at ATW.Sprite.Draw() in C:\Users\Laurens\Documents\School\P2\PT12\Around the World\Sprite.cs:line 55
at ATW.Airplane.Draw() in C:\Users\Laurens\Documents\School\P2\PT12\Around the World\Airplane.cs:line 29
at ATW.Engine.OnPaint(PaintEventArgs e) in C:\Users\Laurens\Documents\School\P2\PT12\Around the World\Engine.cs:line 300
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
|
|
|
|
|
hmm.. it's hard to say where it comes from, since i never used that.. but did you already try
Handle.Transform.Rotate(rotation); ?
|
|
|
|
|
Sadly that didn't make any difference either, I still get the same error, even when just passing in a number like 90 to be sure.
Thanks for the help so far though!
|
|
|
|
|
i think i found it..
look at the last line in your draw - function.
it says
handle.Dispose()
comment it out and it should work..
|
|
|
|
|
God how did I miss THAT. I'm so stupid
Works like a charm now. Thanks!
|
|
|
|
|
I dont think you can use a default Matrix, you need to probably just make it an identity matrix to start with.
xacc.ideIronScheme a R5RS-compliant Scheme on the DLR
The rule of three: "The first time you notice something that might repeat, don't generalize it. The second time the situation occurs, develop in a similar fashion -- possibly even copy/paste -- but don't generalize yet. On the third time, look to generalize the approach."
|
|
|
|
|
I hate to say it but I'm still getting the same error, on the same line.
|
|
|
|
|
I just found out that drawing directly in the overriden OnPaint method does not give an error, while calling methods and passing the graphics object in it in does. Any idea on why this could be?
Thanks!
|
|
|
|
|
Hi,
My aim is to create a form in inches and to print it. i know the code for printing the form but the main problem is creating the form in inches as dimension if anyone knows how to do this please do let me know
sindhu tiwari
its me sid
|
|
|
|
|
The Graphics class provides two methods, Graphics.DpiX and Graphics.DpiY, that gives you the Dots-per-inch resolution of the Device Context:
public void SetSize(float xInches, float yInches)
{
Graphics g = Graphics.FromHwnd(this.Handle);
this.Size = new Size((int)(xInches * g.DpiX), (int)(yInches * g.DpiY));
g.Dispose();
}
|
|
|
|
|
Assuming you're using WinForms, you can assume that there are 72 dots (pixels) per inch, so multiply up by 72.
|
|
|
|
|
Pete O`Hanlon wrote: Assuming you're using WinForms, you can assume that there are 72 dots (pixels) per inch, so multiply up by 72.
I think it's mostly 96 dpi these days.
|
|
|
|
|
I want to access the FireBird directly without using .NET Provider. Is this possible? If Yes how? Can someone point me to some place from where I can get more info as well as a few examples also.
TIA
Yogi Yang
|
|
|
|
|
|
Have you considered using an ODBC connection?
"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
"There is no wealth like knowledge, no poverty like ignorance." Ali ibn Abi Talib
"Animadvertistine, ubicumque stes, fumum recta in faciem ferri?"
|
|
|
|
|
I want to avoid ADO as well as ODBC. Want direct access to the Engine without any middle man libs.
Yogi Yang
|
|
|
|
|
That wouldn't be worth the trouble.
|
|
|
|
|
I use their connector, have you tried it?
|
|
|
|