I have made a class that you can view video through a web camera with.
I keep getting the error 'Unable to initialise camera' when i go to start the camera. But i can't see whats wrong with the class itself. Its attached.
Any ideas what the problem is?
p.s. The error is generated because the camera driver couldn't be successfully connected.
1st I only see this as your API:
Code:
[DllImport("user32.dll", EntryPoint = "SendMessageA")]
static extern int SendMessage(IntPtr hwnd, int wMsg, int wParam, int lParam);
[DllImport("avicap32.dll", EntryPoint = "capCreateCaptureWindowA")]
static extern int capCreateCaptureWindow(string lpszWindowName, int dwStyle, int x, int y, int nWidth,
int nHeight,
IntPtr hWndParent,
int nID);
[DllImport("avicap32.dll", EntryPoint = "capGetDriverDescriptionA")]
static extern int capGetDriverDescription(int wDriverIndex, string lpszName, int cbName, string lpszVer,
int cbVer);
Ok i dont see a Reference to the Actually Drivers your trying too Call up...If its a logitech Cam call up the Logitech Drivers....Because every cam has to have its own Drivers because Windows dosnt supply a Universal Driver that will allow a cam to work with the Manufactures Driver version..I could be wrong..lol
Still dont see where your Pointing to the Camera Drivers , Call up the Camera Drivers that are installed and see if that helps...
I dont know what kind of cam your using so here is an example::
Code:
[Dllimport("LQCaptur.dll",EntryPoint = "capGetDriverDescriptionA")]
static extern int capGetDriverDescription(int wDriverIndex, string lpszName, int cbName, string lpszVer,
int cbVer);
A DLL from my Logitech Cam probably isnt the right one but this should give you an idea..