|
It depends on what library you're using to communicate with the webcam. But, generally, if the device shows up in the device list, it's connected to the machine. Usually, the only way to tell if the device is available for use (it could be in use by another application!) is to try and open the device to get an image. If the open fails, it's not available.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
Well, im using a library that I got from here and it imports the method capCreateCaptureWindowA like this.
[DllImport("avicap32.dll", EntryPoint="capCreateCaptureWindowA")]<br />
public static extern int capCreateCaptureWindowA(string lpszWindowName, int dwStyle, int X, int Y, int nWidth, int nHeight, int hwndParent, int nID);
when I try to start the capture and the device is busy, it shows a device selection window, that's what I'm trying to handle. If the device is already taken by another application , I want my program to detect it and don't take any picture.
Thanks in advance
Best regards
Christian Arenas Díaz
|
|
|
|
|
You'll have to ask the person that wrote the article. We're not a company that puts out libraries for commercial use. Code Project is a massive individual effort. No two people will know about the in's and out's of every article on the site.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I've seen many sites and searched a lot, but I haven't found my exact answer. Help me please...
Well, I think that everything has to be said in the ConnectionString. Don't you think so?
But I have 2 steps:
1.Connecting to server and then (sth like what CuteFTP. (you know that it can do everything itself. Even changing the file(s) permission. I mean it's trusted by the server. How can I also be let to change, update and maybe delete a file on server( e.g. the Access DB file)
2.And then conenctiong to DB
CAN I HAVE THE EXACT CONNECTIONSTRIGN PLEASE???
Much more than thanks!;)
|
|
|
|
|
|
You mean the only I have to do is using and working with a right connections string?
I knew that but I thaught an alone connection string isn't enough.
So I have to use sth like (1) for SQL Server DBs and sth like (2) for Access. Yes?
(1):
connectionstrings.com | SQL Server | SQL Connection (.net) | Connect via an IP address:
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=pubs;User ID=myUsername;Password=myPassword;<br /> (((But where to enter the username and password of host? Of course DB is not public viewable)))
(2):
connectionstrings.com | Access | OLE DB, Oledb Connection (.net) | There wasn't a Connect via an IP address section
What do I have to do?
Thank you
|
|
|
|
|
Seyyed Mohammad Hassan Naji wrote: connectionstrings.com | Access | OLE DB, Oledb Connection (.net) | There wasn't a Connect via an IP address section
You cannot use IP addresses with Access. You have to supply the machine name on the network and Access is only visible on the network. You cannot use it as a server like SQL 200x.
|
|
|
|
|
|
Hi Seyyed,
Seyyed Mohammad Hassan Naji wrote: please link a clear and obvious way to connect to an SQL Server DB on server. I'd searched a lot before asking in this topic
Not sure exactly what you're looking for, but the connectionstrings website is what I use.
Paul
|
|
|
|
|
I want my program to update, change, read, delete and do everything (updating is the most important) with a SQL Server database that is on server. It can take the username and password of host control panel, the username and pass of ftp account (if needed), and of course the username and pass of the SQL Server database.
The connection string of accessing SQL Server with IP address doesn't pay attention to the username and password of host. Are they really trivia? Don't they help us when connecting to DB?
In other words are the username and password of SQL Server database (on host) enough to connect to database and do everything with that?
|
|
|
|
|
Seyyed Mohammad Hassan Naji wrote: In other words are the username and password of SQL Server database (on host) enough to connect to database and do everything with that?
No. You still need username and password. SQL Server has the default 'sa' username and it is strongly suggested not to use this username from your apps. Pretty much all of the connection strings on the website I suggested, require username and password.
Seyyed Mohammad Hassan Naji wrote: I want my program to update, change, read, delete and do everything (updating is the most important) with a SQL Server database that is on server. It can take the username and password of host control panel, the username and pass of ftp account (if needed), and of course the username and pass of the SQL Server database.
You should have your app do the updates/read/create/delete and an ftp account is not really necessary. Take a look at the numerous excellent articles on this site that show how to do database driven apps
Paul
|
|
|
|
|
Hello, I made an application that browse through a list of urls and i was wondering to make it multithread. i need some help with that im a litle confused convining Multithreading with the axwebbrowser events. thanks, Mike
|
|
|
|
|
The webbrowser control will only open one URL at a time. You can't send it multiple URLs from different threads and have them all be retrieved.
The only way around that is to use one webbrowser control for each thread. But, this gets VERY resource intensive. If all you're doing is downloading a single page, without care about any images on that page, then you might want to consider using the much lighter weight HttpWebRequest[^] class to fetch the pages instead.
Dave Kreskowiak
Microsoft MVP - Visual Basic
|
|
|
|
|
I have a requirement to import data from an Excel spreadsheet file into some legacy software within in a language called Retieve 4GL, which has limited support for non R4GL files. Basically it supports CSV files.
I therefore need to convert an Excel Spreadsheet to a CSV file for importing. I would be greatful for any pointers as I have little experince of Excel integration. Ideally I would write a console app in VB.NET 2005, which I could shell to from R4GL, to convert the excel spreadsheet. Excel 2003 is installed on the PCs which will be running this task.
I guess what I need to do is start an instance of Excel, load the file, then force it to save in as a CSV, or is there a better option.
Thanks in advance for suggestions
Steve Jowett
|
|
|
|
|
This was just cropped from an old VB 6 application, but should get your started in the right direction...
Dim excelapp As New Excel.Application
Dim excelWB As Excel.Workbooks
Set excelapp = Excel.Application
Set excelWB = Excel.Workbooks
excelWB.Application.DisplayAlerts = False
excelWB.Open LTrim(<your file="" path="">), UpdateLinks:=3
excelapp.ActiveWorkbook.SaveAs FileName:= _
"<your file="" name="">" & ".csv", _
FileFormat:=xlCSVMSDOS, CreateBackup:=False
Tim
|
|
|
|
|
Thanks Tim, not difficult when you know how;)
Cheers
Steve Jowett
|
|
|
|
|
I want to test how long it takes to load a form with 150 buttons with a background image(on each button) and test how long it takes to open a form with 150 buttons without a background image(on each button)... I have never worked with a timer control and Im assuming that is what I will want to use. I have built three forms, the first form has two buttons, one to open each of the forms with the buttons. The next form has 150 buttons each with a background image, the last form is the same except each button does not have a background image. That is as far as I have gotten, can someone please explain to me what I need to do from here. Thank you...
|
|
|
|
|
Since this is a test, you don't have to do it perfectly.
Create a global variable called dtBuild as date
Dim oFrm as form1
dtBuild = now
ofrm.show
In the activate event of form1 put this code
MsgBox((Now.Subtract(dtBuild).TotalMilliseconds) / 1000)
-- modified at 11:19 Wednesday 8th November, 2006
|
|
|
|
|
I just get a message box with a zero in it BEFORE the form loads. The msgbox comes up, i click OK and then the form loads... Any ideas????
|
|
|
|
|
Try this instead
1) put a dummy label on your form.
2) dim a variable at the form level
Private dt As Date
3) code activate with the result
Private Sub Form2_Activated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Activated
Label1.Text = (Now.Subtract(dt).TotalMilliseconds / 1000).ToString
End Sub
4) code the handlecreated event with the start of the "timer"
Private Sub Form2_HandleCreated(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.HandleCreated
dt = Now
End Sub
|
|
|
|
|
OK cool, that worked, I THINK....
Do you think its possible for a form full of buttons with a background images to load faster than a form with the same amount of buttons that do no have a background image??? because that is what I am getting...
|
|
|
|
|
actually nevermind, it doesnt work. I mean it shows how long it takes for the form and the label to load. The label appears before the buttons all are loaded. I need to to appear after the buttons are loaded...
|
|
|
|
|
how about moving the code from the activate to the paint event...?
|
|
|
|
|
that worked!!! thank you very much for your help...
|
|
|
|
|
I have a datagrid that is not bound to a datasource. I write to the grid by inserting new rows. How can I clear the datagrid so that the inserts begin over again at row 0?
tia!
|
|
|
|