|
Are you using DirectInput for the joystick ?
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Hi all,
How can i predict whether a file is being used by any process. I wanted to wait till the deletion of file gets over.
Thanks in advance
Praveen Raghuvanshi
Software Engineer
|
|
|
|
|
You could use a FileSystemWatcher and specifically the Deleted event.
"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
|
|
|
|
|
Friends,
Does anybody know how to get the list of all previously logged users on a windows machine? One simple way is to go to documents and settings and get the folder names. But can we have some other alternative like using registry or WMI?
Jayant D. Kulkarni
Brainbench Certified Software Engineer in C#, ASP.NET, .NET Framework and ADO.NET
|
|
|
|
|
W hat is the different between user controls and custom controls.
Any body help me.
Continue...
|
|
|
|
|
One has a design view and the other does not, I believe.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Despite sounding simple, this one's really stumped me.
I've got a C# desktop application running. From a second C# app, can I get the main Form of the first C# application?
I know I can create and register a .NET IPC channel and talk between the 2 processes, but that seems like overkill; I just want to get at the Form of the first application. Is there an easy way?
p.s. Please note that I need more than just the Form's handle, the Form's text. I actually need the Form instance itself.
|
|
|
|
|
Depends what you mean. Can you get a handle to the window ? Yes, using Win32 calls. Can you get a reference to the form class ? No.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Christian Graus wrote: Can you get a reference to the form class ? No.
That's what I mean. I know I can get the handle, the text, and other things via native interop, but I need the actual form reference. I was hoping System.Windows.Forms.NativeWindow.FromHandle would work, but no luck.
|
|
|
|
|
Almost certainly not, no.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
i think it can be done. There is a project in codeproject that can select an other .net form and display its properties and events in a propertygrid.
That means that it gets a handle to that object.
Let me Look it up.
Ok found it
I think that this RuntimeObjectEditor Project[^]does what you are looking for not only for a form
After getting the object a cast must be feasible
|
|
|
|
|
Looks like you would need to inject code into the other process to get this to work. Rama's wfspy[^] does that to get access properties of forms running in other processes.
|
|
|
|
|
What is the correct syntax for a default datetime value in the dataset design window for a MS Access database.
The field is a DateTime and I want to change it from "DBNull" to "DateTime.Today" but I keep getting a "String was not recognized as a valid DateTime." error.
Glen Harvy
|
|
|
|
|
In order to open a cash register hooked up to my receipt printer, I need to send 'G' using the CONTROL font to the printer. Using PrintDocument does not work because all of the text gets turned into a picture before it gets printed and so the printer does not recognize the special font. The printers are on USB and Ethernet and so it's not as simple as sending a code over the desired port... how do I actually send the string to the printer?
One way that I think will work is if I send a string to a WORD document with the specified font and print it (with visibility set to false to make it transparent). Can someone point me in the right direction to do so?
Thanks!
|
|
|
|
|
For the first time in many years I need (really need badly) a data breakpoint and just discovered it doesn't exist. Is this a limitation of .net? VS2k5? Or did Microsoft decide no one needs it anymore?
|
|
|
|
|
John, I'm not sure this is what you're after, but I'll say it anyways:
-set a break point
-right-click on the breakpoint
-select 'condition' from the context menu
-type in the variable you want to watch for changes, then select the "has changed" radio button
Is that what you're looking for?
|
|
|
|
|
Hi Judah, thanks but no what I'm after is a data breakpoint, one that isn't set on any line of code. Like I enjoyed with c++ for many years. I.E. I have a business object with an "IsDirty" property, somewhere in a mountain of code something is setting one of it's properties which in turn is flagging it as dirty and I want to find out where that is happening. In the c++ days I could set a data breakpoint on the condition that IsDirty=true. The code would break when that condition happened irrespective of any particular line of code.
|
|
|
|
|
I didn't know you could do that in c++, but it makes sense, as a memory location for a variable would not change. This is not so in C#. What you could do, is hide your data behind a property and set a breakpoint in the setter.
Christian Graus - C++ MVP
'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert
|
|
|
|
|
Unfortunately there is no single property to set it on, it's a complex business object with sub objects and dozens of properties. All I have to go on is an isdirty flag that is set by any of those properties being set different than how they were when it was loaded / created, but that property is buried several levels below in the business object framework itself of which I don't have the code in my main project. I figured out the source of the problem anyway since then, but I was surprised that such a useful feature doesn't exist in c#.
Maybe there's an article in there somewhere down the road.
|
|
|
|
|
No, no, no.... Wrap the IsDirty in a Property, then set a breakpoint in the setter of that prop. WHen the code stops, you can look at the call stack to see the line of execution that got you there.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I see what you mean, it's a good idea in most cases, but it would be too disruptive to my project (besides which I already found the culprit some time ago) because isdirty is already a property that is based on, in turn, the isdirty properties of all the sub objects which are many layers deep and in turn have their base isdirty variable buried in the lowest level of the business object framework which is in another solution entirely because it's all just too big to be practical in one solution (This particular object I was debugging is a complex object with children and grandchildren, part of an asp.net UI layer based on a business object layer in turn based on a generic business framework layer plus). I could do it with some re-arrangement but it would sure be nice if I could set a data breakpoint on the root level isdirty change to true then track back down from there.
It's a massive released application, I'm not touching a thing below the UI level at this point as it's all tested and production code with a *lot* of code sitting on top of it.
Good suggestion though, thank you.
|
|
|
|
|
John Cardinal wrote: it would sure be nice if I could set a data breakpoint on the root level isdirty change to true then track back down from there.
How about changing the top level object's IsDirty property to a method and setting a code breakpoint there?
/ravi
|
|
|
|
|
This is a truly annoying feature in visual studio. Even VB6 gave you the opportunity to break on value changed or on an expression. It has saved me many times in the past, especially if it's someone else's object that is changing and you want to know when that change happens.
|
|
|
|
|
Hi all,
Is there a way to save HTML from, say a WebBrowser (express) COM object automatically--that is, without using the ShowSaveAs function?
Is there another object capable of accessing online information that would have this ability if it's not available with WebBrowser?
Thanks!
|
|
|
|
|
You can cast the DomDocument property of the WebBrowser to the mshtml.IHTMLDocument2 COM interface. From there, you can access the HTML body using the .body property.
|
|
|
|