|
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 
|
|
|
|
|
If you have a Form (say mainForm) containing text, and you want an interactive search facility, you could create a dialog using a new Form (say findDialog)
which has mainForm as parent (so it hides when mainForm hides), and which is
shown as modeless dialog (i.e. it can give up focus to other windows in same app).
Now mainForm can have button event handlers attached to the buttons of findDialog,
read an editTextBox on findDialog, and do whatever is required within mainForm.
So the trick is in mainForm attaching event handlers to another form's buttons,
but then it did create that other form (findDialog) so it has a reference to it.
Hence it boils down to one of the following:
- make the Controls on findDialog public (is not what Visual Studio Designer does
by default, but there is a "Modifiers" field on the properties panel)
- add public properties to get access to the non-public controls you need
- add one or more public methods to findDialog to attach an event handler to the
non-public controls you need.
The choice is yours.
Personaly I often create dialogs programmatically (rather than through Designer)
and make all controls public.
-- modified at 14:05 Saturday 6th January, 2007
Luc Pattyn
|
|
|
|
|
OK I like idea, I did change properties to buttons and textbox in child to public, so I can now access them within main form, but how do I add event handler to button from child form in main form?
Sorry for trivial question but I'm new in this.
Also does anyone have idea why I can't access richtextbox in main form from child form it's labeled as public also?
I can for example access text box in child form from main form, but it's of no use, I need to attach that event so it does that on button click not before or after.
|
|
|
|
|
No no, the simplest way is the other way around, it is the main form that does
everything about the text, including the searching, the findDialog's purpose is
to specify and trigger the search, not to perform it.
And the architecture would be something like this (incomplete!):
public class mainForm : Form {
FindDialog findDialog;
public mainForm() {
}
public void btnOpenFind_Click(object sender, EventArgs e) {
findDialog=new FindDialog();
findDialog.btnFind.Click+=new EventHandler(btnFind_Click);
findDialog.btnClose.Click+=new EventHandler(btnClose_Click);
findDialog.ShowDialog();
}
private void btnFind_Click(object sender, EventArgs e) {
}
private void btnClose_Click(object sender, EventArgs e) {
findDialog.Close();
}
}
public class FindDialog : Form {
public Button btnFind;
public Button btnClose;
public TextBox tbSearch;
}
Hope this helps you way forward.
Luc Pattyn
|
|
|
|
|
It works thanks, can someone explain what we did here (I understand basic), so we can add event to current object to instance in another object?
|
|
|
|
|
Event Listeners are another option. Personally I usually use Dialogs, which has already been said.
On two occasions I have been asked [by members of Parliament], 'Pray, Mr. Babbage, if you put into the machine wrong figures, will the right answers come out?' I am not able rightly to apprehend the kind of confusion of ideas that could provoke such a question. - Charles Babbage
|
|
|
|
|
Im probably missing something simple but here is my problem.
the app have 1 main form (Form1) with a dataset, dataAdapter and
databinding to some table.
Then i create another form (Form2) that contains a DataGridView
in order to bind the columns in the designer, I must have a new dataset object
another dataAdapter and another binding source.
How to prevent that , the ideia is that i want to call the Form2 in Form1
with something like new Form2(BindingSource), but still be able to use the designer
generated code.
How can i do that besides messing with the autogenerated code ???
|
|
|
|
|
Seperate your code into layers, such as Data Access and Business Logic. If you place the code to access your data into another class with a method that returns a DataSet then you can bind the controls on both forms to the same source, possibly using a ObjectDataSource control.
only two letters away from being an asset
|
|
|
|
|
Hello
I've a problem. I use DShowNet to send view from my camera to panel in C#. I would like to take position from this panel. I try to use "OnMouseMove", but it's not working. Any idea? Thanks, and sorry for my english.
|
|
|
|
|
RockyC# wrote: I would like to take position from this panel.
What exactly do you mean? In case you're interested in the panel's position on the form, the Location property is what you're looking for.
"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
|
|
|
|