|
Hello guys!
I have a little problem with my first C# program.
I'm making a room cam controller with my webcam. What it does is, time to time, it connects to the cam and take a pic. No big deal.
My problem is, when the cam is in use (in MSN for example), the instruction that connects to the cam
SendMessage(mCapHwnd, WM_CAP_CONNECT, 0, 0)
opens a Dialog asking me to select the device to use (in my case i only have one webcam)
How can i bypass this? I mean, if it cannot connect it just don't take any pic, it wouldn't be any problem. The problem is that it starts to fill the screen with Dialog Boxes, so what i really want is avoid the Dialogs.
Please help
|
|
|
|
|
I was intrigued - so googled "sendmessage webcam dialog"
Is this[^] of any help?
___________________________________________
.\\axxx
(That's an 'M')
|
|
|
|
|
... it doesn't really helps, at least to me, there is some visual basic stuff in the page i don't understand... maybe there is some kind of handler i can create to kill the dialog?
|
|
|
|
|
Hi All,
I am having problems trying to get the selected index and subsequently the datakey value within a gridview , when a button is selected for a particular row.
Ive used the following event handler to fire the action yet the index is -1 regardless of which row is selected and the datakey value is null.
Some help on this would be great. Thanks.
heres my code
<br />
<br />
<asp:sqldatasource id="SqlDataSource1" runat="server" xmlns:asp="#unknown"><br />
ConnectionString="<%$ ConnectionStrings:NORTHWNDConnectionString %>" <br />
SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [ContactTitle] FROM [Customers]"><br />
</asp:sqldatasource><br />
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown"><br />
DataKeyNames="CustomerID" DataSourceID="SqlDataSource1" <br />
Width="453px" onselectedindexchanged="GridView1_SelectedIndexChanged"><br />
<columns><br />
<asp:commandfield showselectbutton="True" /><br />
<asp:boundfield datafield="CustomerID" headertext="CustomerID" readonly="True"><br />
SortExpression="CustomerID" /><br />
<asp:boundfield datafield="CompanyName" headertext="CompanyName"><br />
SortExpression="CompanyName" /><br />
<asp:boundfield datafield="ContactName" headertext="ContactName"><br />
SortExpression="ContactName" /><br />
<asp:boundfield datafield="ContactTitle" headertext="ContactTitle"><br />
SortExpression="ContactTitle" /><br />
</asp:boundfield></asp:boundfield></asp:boundfield></asp:boundfield></columns><br />
</asp:gridview><br />
<br />
<br />
protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)<br />
{<br />
int i = GridView1.SelectedIndex;<br />
string datakeyval = GridView1.SelectedDataKey[i].ToString();<br />
}<br />
|
|
|
|
|
Is it possible to ping a port? like pinging an IP address + port.
Although I created an application that does this but it is inefficient and slow because I try to access a certain port using a try-catch block....
|
|
|
|
|
Silvyster wrote: Is it possible to ping a port? like pinging an IP address + port.
No. You cannot ping a port, just the IP address.
Silvyster wrote: that does this but it is inefficient and slow because I try to access a certain port using a try-catch block....
That's about the only way to find out if a server is listening on said port.
|
|
|
|
|
Hi,
I have a datagridview with a combobox column.
Wich eventhandler do i have to use when the selection in the combobox column changes?
|
|
|
|
|
|
does it work on winforms on the same way? i have a winform and i could'nt find any combobox events in the datagridview events list.
modified on Wednesday, January 21, 2009 7:23 PM
|
|
|
|
|
It would have been helpful if you would have mentioned this at first. No it doesn't work the same way, obviously.
only two letters away from being an asset
|
|
|
|
|
I assumed that it's here a winform forum and not asp.net.
|
|
|
|
|
|
HI all
when I use Xml Serialization for my class after I call "Serialize"
method on my file I have the following.
<br />
<MyXmlElem xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><br />
...other data<br />
</MyXmlElem><br />
What can I do to get rid of the schema info
to have my file as the following?
<br />
<MyXmlElem><br />
...other data<br />
</MyXmlElem><br />
Many Thanks
|
|
|
|
|
The first question is why do you need to get rid of it? Is it causing problems for you in some other application?
only two letters away from being an asset
|
|
|
|
|
Well..let's say that it was a request I had that I don't know how to fix!
( it is a very bad response but is what I need to do unfortunately..)
Off course if it is not possible absolutely don't worry!
|
|
|
|
|
Hi All,
As part of my project i created a MFC dialog application which broadcasts a user defined windows message.
I have a service that is created in C# and i want this service to listen to the broadcasted message.
How can i listen for a windows message in service. Any sample will be helpfull.
Thanks All
|
|
|
|
|
This is just a suggestion...but have you considered sending the message in a more standardized way, like with MSMQ? With MSMQ, your not bound to the old windows messaging system, and you can host your service and message queue on different boxes.
|
|
|
|
|
Oftentimes we load rows from the database into objects and the objects end up having a complex network. For example, customer can have 1 or many orders, orders can have 1 or many items, items can have 1 or many suppliers and the chain can continue.
Is it better to
1. Pass the parent to the child object in the constructor?
2. Pass only the id of the parent to the child constructor?
3. Pass either 1 or 2 but use properties instead?
Or
4. All of the above are no good.
|
|
|
|
|
If you really need to pass this data then only the parentID should be needed so 2.
3 using 2 should obly be used if the child's parent could potentially change. If not, then the parentID if it's needed as a property should be readonly which would only leave 2.
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)
|
|
|
|
|
Hi everyone,
Im having a wierd problem.
I have an application with several forms thats works perfectly great. the problems appears when i lock my user (windows+L). when im logging in again after the lock somehow my forms are not repainted.
for more info: i checked for the paintig of my forms by moving other windows on them and minimize maximize them and it works great.
Anyone have any idea how windows lock effects my application?
i need your help quickly....
|
|
|
|
|
Are you using custom OnPaint, WPF, or anything fancy?
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
I am having problems with merging my tables using DataTable.Merge(). The datasets that I am passing contains roughly 200k rows. I tried merging 3 datasets with this code and the memory usage when .Merge is called is outrageous. it goes from 91M to 1.3g of Ram - then an OutOfMemoryException is called. Most of the datasets only have 200k rows in them, which shouldnt be that much.
Is this normal memory usage for that many rows? Is there an alternative that will be fast and memory friendly?
Thanks.
|
|
|
|
|
DataSets suck. No application should ever have more than a few hundred rows in memory ever. I usually use a database for that type of merging or streams and sorting algorithms. The problem with the dataset is that your 200k rows are in memory.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|
|
I understand what you are saying, however, in my case I have no other alternative but to use DataTables and DataSets.
The application I have gives us a list of available datasources (some from DB but could be a file)
The user has the option to combine two available datasources together to create one datasource.
At first, I went the long way of doing the merging by looping through each row and each column.
This was a bad idea for many reasons.
I found DataTable.Merge and passed in each dataset
Seemed quick and handled my schemas for each dataset.
But the draw back is memory.
So, can you (or someone) offer another way of doing this? Something fast and easy on the memory?
|
|
|
|
|
Hrmm,
If you consider that each data source would have unique tables and thus unique rows you could write each data source to the file system, use an Xml Streaming Reader and Writer and then create the new file as a combination of the other two. It is definitely a non-standard method but may work, would definitely be fast.
Need software developed? Offering C# development all over the United States, ERL GLOBAL, Inc is the only call you will have to make.
If you don't ask questions the answers won't stand in your way.
Most of this sig is for Google, not ego.
|
|
|
|