|
Thanks, but is there a problem or what?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
there is no problem I just wanted to share it with you.
|
|
|
|
|
That's cool. How about you write a quick little beginner article on it. As simple as it is, some folks might find it helpful
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
|
Ummm, you don't know what?
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
I don't know that I can write an article,because I'm working on a project for Infomatrix. How about you? I guess you're a Software Developer.
|
|
|
|
|
Furkan93 wrote: How about you?
Could just add it to the never ending list to todo
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
"Not only do you continue to babble nonsense, you can't even correctly remember the nonsense you babbled just minutes ago." - Rob Graham
|
|
|
|
|
what does this code code ....upload a picture
|
|
|
|
|
Hey guys,
When I was programming a chip in C, the chip had a built in function to check if the COMPort is busy. Is there an equivalent function in C#?
This is my first time doing it in C#, and I am trying to use the serialPort control to send/receive packets of data, but I don't think it's as easy as just reading bytes instantaneously, so I would imagine there needs to be a way to check if the COMPort is busy.
Any ideas would be appreciated.
|
|
|
|
|
Hi,
since .NET 2.0 there is a System.IO.Ports.SerialPort class that offers a lot of functionality.
See_Sharp wrote: a built in function to check if the COMPort is busy
Not sure what you mean by busy.
IIRC the SerialPort(portname) constructor will fail (=throw an exception) if the port does not
exist, or is already in use by another process.
whether data is currently being sent/receives by another process is something you cannot or cannot easily figure out, since you won't be able to create a SerialPort object under those conditions.
whether data is currently being sent/received by your own process is something you can figure out by using the SerialPort properties and events.
I suggest you thoroughly read the SerialPort documentation.
|
|
|
|
|
I've tried unsuccessfully to get the AnimateWindow API to work. As far as I know, my flags are correct, but no matter what I do, the form just pops up on the screen. Can anyone see anything wrong with this code?
using System;
using System.Runtime.InteropServices;
namespace WinAPI
{
public class AnimateWindowAPI
{
public const int AW_HIDE = 0x10000;
public const int AW_ACTIVATE = 0x20000;
public const int AW_SLIDE = 0x40000;
public const int AW_BLEND = 0x80000;
public const int AW_HOR_POSITIVE = 0x00000001;
public const int AW_HOR_NEGATIVE = 0x00000002;
public const int AW_VER_POSITIVE = 0x00000004;
public const int AW_VER_NEGATIVE = 0x00000008;
public const int AW_CENTER = 0x00000010;
[DllImport("user32.dll", CharSet = CharSet.Auto)]
public static extern int AnimateWindow(IntPtr hWnd, int dwTime, int dwFlags);
}
}
I'm calling the function from within the Shown() event handler, like so:
using WinAPI;
private void Form1_Shown(object sender, EventArgs e)
{
int flags = AnimateWindowAPI.AW_ACTIVATE|AnimateWindowAPI.AW_BLEND;
AnimateWindowAPI.AnimateWindow(this.Handle, 3000, flags);
Show();
}
I also wrote some threaded fader code (that doesn't use the AnimateWindow function) to see if I was calling it from the wrong place, and that code works fine.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
It's too late in the Shown event - move it (minus the Show(); ) to the Load and it works fine.
private void Form1_Load(object sender, EventArgs e)
{
int flags = AnimateWindowAPI.AW_ACTIVATE | AnimateWindowAPI.AW_BLEND;
AnimateWindowAPI.AnimateWindow(this.Handle, 3000, flags);
}
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Thanks a million. I would have taken a while to get to that thought process.
Now, if you have any insight as to why this doesn't work on child forms with the DockPanel library, I'm all ears.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Never used it so can't help with that one - sorry. Which library is it and I'll have a look - this one[^]?
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
Yeah, that's the one.
My first attempt at it was to:
0) Create a new class called FadingForm , derived from System.Windows.Forms.Form .
1) In the FadingForm class, I added code to use either the AnimateWindow API function, or a fader thread of my own design (I actually wrote that code before finding out about AnimateWindow ).
2) Derive FadingForm from the DockPanel DockContent class.
3) Derive my child forms from FadingForm .
After doing all of this, I realized it probably wouldn't work without a lot more work.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: a lot more work
Yeah - I've had a brief play around and I can't figure it. Sound's like I'm talking to a CP noob , but it may be worth asking the author[^]. He hasn't been active here since March though.
DaveBTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)Visual Basic is not used by normal people so we're not covering it here. (Uncyclopedia)
|
|
|
|
|
John, I've never used this API before, but I see the MSDN docs might give a hint,
AW_BLEND : Uses a fade effect. This flag can be used only if hwnd is a top-level window.
|
|
|
|
|
It doesn't work even if I use my threaded fader. I'm trying to fade a form which is usually considered a top-level window, but maybe that status changes if it's a MDI child... Even so, my threaded fader should still work...
[EDIT] I checked it under the debugger, and after setting the MdiParent value, the TopLevel property is set to false, and that's why the AnimateWindow call doesn't work.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
modified on Sunday, November 23, 2008 2:54 PM
|
|
|
|
|
Hi
Could you please let me know how to view and edit "domain Password and Account lockout policy" using C#.Net.Let me know about the classes and methods to be used as well.please respond ASAP.
Thanks
|
|
|
|
|
This[^] article might help you out.
Loading signature. Please wait...
|
|
|
|
|
Hi
Thanks for ur previous post.
i was not able to find what the stuff which i wanted.I wanted to know write a program in C# to view and edit Domain Password and Account Lockout policy.How do i go about the problem.I am an amateur programmer only. plz do respond asap.
Thanks
|
|
|
|
|
|
what are you doing?
dhaim
ing ngarso sung tulodho, ing madyo mangun karso, tut wuri handayani. "Ki Hajar Dewantoro"
in the front line gave a lead, in the middle line build goodwill, in the behind give power support
|
|
|
|
|
what can i do to solve this prob?
NullReferenceException was unhandled
Object reference not set to an instance of an object
Thanks
|
|
|
|
|
This means that the object you are manipulating upon is null.
|
|
|
|