|
Is it WIA? If so, a link from a few months ago on my blog might help you. It's directed at capturing images from a scanner. However, it uses the WIA SDK so if your webcam is WIA all you should need to do is change a few settings (e.g. the device type).
Link: http://geekswithblogs.net/tonyt/archive/2006/07/29/86608.aspx[^]
|
|
|
|
|
|
omc79 wrote: can anybody help me in implementing blowfish algorithm in c/c++ for encryption/decryption between client and server in unix enviornment.
i dont have a clue how to do it..
Well, first of all, this is the C# forum. You might have better luck in the C++ forum. Second of all I turned up this after a quick google search. http://www.schneier.com/blowfish-download.html[^]
Never having worked with it, I'm afraid I can't be much more help than that. HTH.
|
|
|
|
|
Hello i have something like this:
This Method call me a form and disable the main menu so you can not call another form until you finish the one that you have active.
private void tiendasToolStripMenuItem_Click(object sender, EventArgs e)
{
frmTienda Tienda = new frmTienda();
Tienda.MdiParent = this;
Tienda.Show();
Tienda.Visible = true;
//Here I'm Trying to handel the closing event so to be able to disable the main form(menu)
Tienda.FormClosed +=new FormClosedEventHandler(Tienda_FormClosed);
menuStrip1.Enabled = false;
}
//This is my method where i try to handel the "decision" that you want or not to close the form.
private void Tienda_FormClosed(object sender, EventArgs e)
{
DialogResult r = MessageBox.Show("Seguro desea Cerrar esta ventana?", "Tienda", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
Form f = (Form)sender;
if(r == DialogResult.Yes){
menuStrip1.Enabled = true;
return;
}
}
The thing is that i event i select No as a answer that i dont want to close the form it close anyway, so i would like another way to do it, eather disable the forms behind, or to take the answer of the messagebox so when i select no the form does not get close.
La Light
|
|
|
|
|
If you want your form to not close when the No button is clicked, add an event handler to the Closing event instead of the Closed event. Your code would look like this:
Tienda.FormClosinng += new FormClosingEventHandler(Tienda_FormClosed);
...
private void Tienda_FormClosing(object sender, FormClosingEventArgs)
{
DialogResult result = MessageBox.Show("Seguro desea Cerrar esta ventana?", "Tienda", MessageBoxButtons.YesNo, MessageBoxIcon.Information);
if(result == DialogResult.No)
{
e.Cancel = true;
}
}
|
|
|
|
|
Iridania wrote: This Method call me a form and disable the main menu so you can not call another form until you finish the one that you have active.
If I understand your question, It sounds like you want your form to behave as a modal dialog. I think what you want is "Tienda.ShowDialog()". Then you don't really need to disable/enable your menu or other forms. In your FormClosing event you can show your message box and if the user answers "No", set e.Cancel to true in your FormClosingEventArgs parameter. Any buttons you place on your form can be assigned a DialogResult property.
|
|
|
|
|
I got a project to ues C/C++ to make database. Anyboday knows any where could get any helpfull information? Thanks.
|
|
|
|
|
Certainly not in this forum, which is the C# language forum. At the very least, you'll need to be in the C++ forum.
|
|
|
|
|
I am working on Messenger developing as a course work, and i have to MSF documentation, but i can not understand what will be the Technical Design Strategy and Architectural Design Strategy for Messenger ? and what should I discuss under these headings ?
please reply soon
|
|
|
|
|
Hello...Iam working in C# .NET and I use a webbrowser control. I already follow all instructions about references, but when the webbrowser is created, look like if everything goes ok, but, the webbrowser don't have good behavior. There are some errors in properties that are not create very well. I can see in WATCH window the errors
Example:
property HWND <error: an="" exception="" of="" type:="" {system.runtime.interopservices.comexception}="" occurred="">
property Resizable <error: an="" exception="" of="" type:="" {system.notimplementedexception}="" occurred=""> bool
Please, I need help.
Thanks
Maite
|
|
|
|
|
Maite, this really isn't enough information; what error occurs? What do you mean by "the webbrowser doesn't have good behavior"? What behavior is it exhibiting?
|
|
|
|
|
Hello Judah...Thanks so much for your quick answer. Here I explain better.
I want to open a word document from my application. I searched in internet and I found a solution and I follow the steps from the site:
http://support.microsoft.com/kb/304662
Everything goes ok, but want a try to show the toolbar, show an exception and the toolbar is not show. I debbug the code and the unique bad that I found is the objet axWebBrowser1 when I made the View in the WATCH Window, there some properties that thrown exception: HDNW, Resizable, etc.
I think that could be there exception for that reason
Here is the code for open ans show toolbar:
//open the document in the webbrowser.
axWebBrowser1.Navigate(strFileName, ref refmissing, ref refmissing, ref refmissing, ref refmissing);
//show the toolbar
axWebBrowser1.ExecWB(SHDocVw.OLECMDID.OLECMDID_HIDETOOLBARS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, ref refmissing, ref refmissing);
The behavior that I see after all is that the first time, the right click for the document is ok, but when I go to another application and come back, the right click is not available and the buttons availables doesn't work.
Please, let me know if you have any idea to fix the error.
Thanks so much
Maite
|
|
|
|
|
Hi,
I am developing a deployment project in VS2005 in which there are several COM components also. I know the Register property of each COM component is to be set to vsdrfCOM but the problem is that how can i identify which file is a COM component and which one is not?
Any help,suggestion,link would be highly appreciated.
Regards,
Wasif Ehsan.
|
|
|
|
|
HI Everyone!
I have used this line in AfterSelect Event of treeView.
e.Node.IsSelected && e.Button == MouseButtons.Right
But this doesn't recognize "e.Button"
Is there any NodeMouse_Click event? How can I use that?
I want to invoke context (popup) menu in tree that enable and disable its item according to selected node. But when i click using rightMouseButton the treeView node not considered as selected.
please tell me how i can select node using right mousebutton.
Thank you.
|
|
|
|
|
If you want to get the mouse button that's currently down, you can access that by the static Controls.MouseButtons property.
|
|
|
|
|
We are using a COM library through interop (ESRI's lib). Since the library is sometimes slow we decided to create a dialog to allow the user to cancel a long running request.
The request is running on a thread. Pressing the cancel button on that dialog will Thread.Abort() the request.
The problem we are facing is that the application's behavior is unpredictable after the user performs several cancellations. Sometimes, the application waits forever (hangs) and sometimes it just takes all of the processor's time.
As you can see there is little info here. The only thing that we know about the COM library is that it is running in a single threaded apartment - STA.
Questions:
1. Is it possible to do this kind of threading work with an STA COM library through interop?
2. Is there any other way to do the same thing (other than aborting the thread)?
3. Do you have any experience with multi-threading ESRI tasks in .NET (not C++)? If yes, can you please provide any advice on how to tackle this problem.
We posted this problem on ESRI's forums to no avail
Any help is greatly appreciated.
Thanks
|
|
|
|
|
This really sounds like a problem with the vendor's dll.
Now, aborting threads is generally a bad idea; it's better to manually cancel by building the work to watch for a cancellation flag so that it can do the necessary cleanup. Without cleanup, as you've discovered, code is left in an unpredictable, volatile state.
Emad, what happens if you run the work on a background thread? Then if the user cancels, would it be safe to leave the work running, but the user doesn't see the work running? If that's feasible, that may be your only option outside of having ESRI provide some cancellable work method.
|
|
|
|
|
hi Judah,
yes it seems like it is a problem with the vendor's library.
I am not sure about the cancel flag. We are working with Legacy code that we need to wrap the cancellation code around (not new design). Also, having code littered with checks like (if cancelled) doesn't seem to be the best solution for us.
We are running the work on a background thread as you suggested. Leaving the work to run sounds like a good idea. It is worth a try if all fails.
Thanks for your help.
|
|
|
|
|
Hi,
Before generics I used something like this to connect childs with parent classes
interface IMyItem
{
CollectionOwner Owner{get;set;}
}
class MyCollection : System.Collections.CollectionBase
{
public MyCollection(CollectionOwner owner)
{
_owner = owner;
}
protected override OnAdd(object item)
{
if(item is IMyItem) ((IMyItem)item).Owner = _owner;
}
}
this way one was able to add items to a owner class owner.Items.Add(new Item()) and the owner had the item instance in his list while the item had a reference to his owner, which made a call like item.Remove() possible instead of calling owner.Items.Remove(item)
Now, .net 2.0 introduced generics, way cool. But how do I implement this behaviour with generics? There is no overrideable method instead of using the brute force method with new
class MyCollection<T> : List<T>
where T : IMyItem
{
MyCollection(CollectionOwner owner)
{
_owner = owner;
}
new public void Add(T item)
{
item.Owner = _owner;
base.Add(item);
}
}
this way if one is casting MyCollection back to List<> my custom add method isn't run. bad design
how can I extend generic collection base classes with such logic to do some extra work on each add or remove?
myMsg.BehindDaKeys = "Chris Richner";
|
|
|
|
|
Rather from inheriting from List<T>, have your class implement IList<T>, and keep a List<T> field in your class. Something like this:
public class MyCollection<T> : IList<T>
{
readonly List<T> list = new List<T>();
public void Add(T item)
{
item.Owner = _owner;
list.Add(item);
}
....
}
Of course, for you to set the Owner property of the item, there must be a constraint on your T class type. You could accomplish this like this:
interface IOwnable
{
CollectionOwner Owner { get; set; }
}
The tell your MyCollection object that only IOwnable objects can be stored in it.
class MyCollection<T> : IList<T>
where T : IOwnable
{
...
}
*edit* alternately, as Daniel said, inheriting from the System.Collections.ObjectModel.Collections would require less work. You'll still need the IOwnable constraint if you want to set the owner on the items.
|
|
|
|
|
Instead of inheriting from List<t>, inherit from System.Collections.ObjectModel.Collection<t>. There you can override ClearItems, RemoveItem and InsertItem, which will be called by all normal Add/Clear/Insert/Remove/RemoveAt methods.
|
|
|
|
|
Thanks guys,
This way round things look like they did in System.Collections.xx namespace. Seems like I just got the wrong base class ;(
myMsg.BehindDaKeys = "Chris Richner";
|
|
|
|
|
Hello
I am using SendAsync command on the Smtp client to send the email message. Although, it seems that the message was send, it does not get send until I close the form. How can I make, so that the message goes out right away?
Thank you.
|
|
|
|
|
If you're using the MailMessage class, try calling the Dispose method.
|
|
|
|
|
Is there a way to get the default namespace name?
If I embed a resource in a dll file the resource will be named <default namespace="">.<file name="">.
But I don't want to hardcode the default namespace name into the code (because I may change later and forget to change in code the namespace).
Any suggestion is welcome
|
|
|
|
|