|
code_wiz wrote: Is there any reason why MS did not support databinding in these controls even in .NET 2.0?
I think I miss your point!! Both TreeView and ListView have a DataBindings property inherited from Control class, available both in the designer and the code.
Regards
|
|
|
|
|
Hi all
I'm new to C# multithreading and I read that to resolve deadlock it is best to use monitor with timeout.With this in mind I used the following code to see what happens to the deadlocking generated.
The result is the following exception
Unhandled Exception: System.Threading.SynchronizationLockException: Object synchronization method was called from an unsynchronized block of code.
Why this? What's wrong with my code or my approach?
Regards
manuStone
class ThreadFoos
{
public static void First()
{
Monitor.TryEnter(ResourceA, 1000);
try{
Thread.Sleep(500);
Monitor.TryEnter(ResourceB, 1000);
try{
Console.WriteLine("First");
}
finally{
Monitor.Exit(ResourceB);
}
}
finally{
Monitor.Exit(ResourceA);
}
}
public static void Second()
{
Monitor.TryEnter(ResourceB, 1000);
try{
Thread.Sleep(500);
Monitor.TryEnter(ResourceA, 1000);
try{
Console.WriteLine("Second");
}
finally{
Monitor.Exit(ResourceA);
}
}
finally{
Monitor.Exit(ResourceB);
}
}
private static object ResourceA = new Object();
private static object ResourceB = new Object();
}
|
|
|
|
|
hi there.
this is what i think.
to start with
http://msdn2.microsoft.com/en-us/library/system.threading.monitor.exit.aspx[^]
which implies that Monitor.Exit can be called on a thread , for a resource only if that thread has already acquired lock for that resource.
you are calling Monitor.Exit (one out of try statements) on threads without assuring that a thread has already successfully acquired monitor on a specified resource. (i.e Monitor.TryEnter may not have been successfull). please Check the returned value from Monitor.TryEnter for both 'First' and 'Second' rountines.
regards.
|
|
|
|
|
Thank you very much for your resposne.
Have a nice day.
Regards
manuStone
|
|
|
|
|
I looked into the DDK which I guess is now know as the WDK. However, its a 1gig download which I would much rather not do. Is there an alternative way to do this in C#?
I would like to build some cmds and then send them to my drive, and get the responses back. How does one do this in the C# environment?
Thx.
|
|
|
|
|
Can you explain what you want to do?
|
|
|
|
|
I would like to implement the article that used the DDK listed here: http://www.codeproject.com/system/mydvdregion.asp
Except in C#. The WDK is for C and C++ and is a 1-2 gig download I would much rather not do. Any other libraries for sending CDBs to a drive? Thx.
Any help?
|
|
|
|
|
Why do you need the DDK? If you look through the source code you'll see that nothing in the DDK is referenced, he's simply borrowed definitions from the DDK so that people don't need to download it.
To use this in C# all you need to do is translate the C++ to C# et voila. It uses nothing special you'd just need to use P/Invoke to send the commands using DeviceIOCtrl.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
Cheers to you. I'm now on the right track. Basically I load in the kernall32.dll and I can call the DeviceIoControl() method from there. P/Invoke is a way to make interop possible by loading .dlls from the past. Very nice. Thanks very much Ed.Poore
Many Thanks.
Try
|
|
|
|
|
Hi to all!
I would like to ask you which coding convention do you use?
Regards,
|
|
|
|
|
That's a very broad question, how do you mean ?
I use braces like this
try
{
}
not
try{
}
I use _ and camel case for private variables, and I capitalise the first letter of public and protected methods/variables.
I make sure all variables are private
I don't use Hungarian notation
What else were you hoping for ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
|
oops. i refreshed the page before responding to this..
|
|
|
|
|
Hi every one,
I have server/client programming.
I'm using Remoting idea. I have server that should send the device(web cam) to the client so he can use it to capture video. But I have failed to send the device???
Can any one tell me how to send the device using the remoting? is it creating new Filter or what??
If there is any other simple & better idea other than remoting please tell me.
Thank u any way
Ali
|
|
|
|
|
Why would you want to do that? Wouldn't it be better to set-up a streaming server or something like that, take a look at Windows Media Encoder[^]. Just set-up your server and connect to it from the client program.
|
|
|
|
|
Um can you explain more clearly for those who missed the earlier question?
|
|
|
|
|
I'm writing a program that needs to take a list of hostnames/usernames/passwords and change each machine's registry settings over the network. I've tried using OpenRemoteBaseKey, but that only allows for a hostname input. I have limited network programming experience and was wondering if there was an easy way I could connect to each of my nodes over the network to change the registries. I can elaborate if needed. Thanks in advance!
-Ryan
|
|
|
|
|
|
Sorry if it sounds like a stupid question. I did a bunch of searching before I asked here, but I'm kind of lost as to what's a good way to do this. Most links just explained how to access remote registries that you already have permission to access. If you could just point me in the right direction, I'd really appreciate it.
|
|
|
|
|
How do you expect to access registries you don't have permission to? You planning to write a virus or something?
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
I have an administrator username/password for each of the machines. I'm trying to remotely update registry values on multiple machines at once.
|
|
|
|
|
What about the RegistryKey.OpenRemoteBaseKey[^] method? Doesn't that do what you want, obviously you'll need to be logged in so presumably if you're a domain administrator then you can just run the code. If you have individual usernames/passwords for each computer then my guess is that you'll have to access the machine through explorer first to "log" onto it. Once that is done then you should be able to update it.
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
OpenRemoteBaseKey only takes the hostname as an input. I need to use a username/password, also. I did some more searching and saw this - http://groups.google.com/group/microsoft.public.dotnet.languages.csharp/browse_thread/thread/37d17466c08886cb/935e84260c3a280f?lnk=st&q=c%23+remote+registry+username+password&rnum=9&hl=en#935e84260c3a280f
I'm assuming this is what I'm looking for hopefully.
|
|
|
|
|
That would make sense
I have no idea what I just said. But my intentions were sincere.
|
|
|
|
|
For example I'm buiding Find/Search function in new form and I want to be able to search for sting in parent form from this child form (child form have text box where user enter word he is looking for)?
Parent form have multi Rich Text Box(es) (in tabs)... menus etc
So this is probably simple I tried few things but none works... I guess I'm just doing something wrong.
Thanks 
|
|
|
|