|
Yes That's all you get in VFW these days. WDM is a newer driver model so if you use
DirectShow (which supports WDM devices as well as legacy VFW drivers) then you'll see descriptive
names. With VFW you'll only see descriptive names for old devices that haven't moved to WDM.
Mark
|
|
|
|
|
Damn.. that really complicates things I was hoping to avoid DirectX.
It sounds quite absurd that you can open a device, but you can’t know its name.
|
|
|
|
|
tanffn_aj wrote: It sounds quite absurd that you can open a device, but you can’t know its name.
Yeah it's a pain. It makes it impossible to select a device either programmatically or presenting
the user with an intuitive list to choose from.
Microsoft hasn't deprecated VFW yet but the device manufacturers have moved on to WDM for their
drivers. Windows wraps those drivers so they can be used by VFW (that's the generic name you
get).
If only you had wasted a whole day in the DirectShow SDK instead....you'd probably have something
up and running (sorry - salt in the wound)
If you choose to (or have to) go the DirectShow route I'll help out if I can. The code samples
in the SDK work decent - it gets a little wordy with all the COM stuff but it's fairly
straight forward for common video capture tasks. Way more flexible than VFW as well.
Mark
|
|
|
|
|
Thanks for all the help so far Mark.
I’ll try to figure out DirectShow by my self for now. I Don’t want to ask questions that are too dumb.
|
|
|
|
|
I thought only unasked questions were too dumb...
BTW, the DirectShow SDK is in the Platform SDK, not the DirectX SDK if you didn't know already
Good luck!
Mark
|
|
|
|
|
I ended up using DSPACK (delphi). It went a lot faster then I expected, too bad I wasted a day on VFW..
|
|
|
|
|
Hello.
I'm trying to get connection to dBase file by using ODBC.
I'm trying to use code like this:
CDatabase cdb;<br />
cdb.OpenEx( _T("DBQ=F:\\database\\a.dbf;DefaultDir=F:\\database\\;DRIVER=Microsoft dBASE Driver (*.dbf);DriverId=533;MaxBufferSize=2048;PageTimeout=5;"));
But i get message: string F:\database\a.dbf is an invalid path. But this file exactly exists!!!
I'm using Visual Studio 2005. How should I solve the problem please?
|
|
|
|
|
Create a DSN in the ODBC Data Source Administrator. That way you can create the connection settings and test it right there.
led mike
|
|
|
|
|
It looks like the smiley-face-tongue-sticking-out may be the problem.
Otherwise, what led mike said.
Mark
|
|
|
|
|
It's just a guess, but do you need to put ODBC; before DBQ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi
Only for test purposes try to change the location. I guess that file is in a network path.
Regards
David Leyva
|
|
|
|
|
|
No.
If I will create DSN, will my application run at the other computer?
|
|
|
|
|
Jackson86 wrote: ...the other computer?
What other computer?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I meant that, if i will create my DSN in ODBC Administrator in my computer, I sure that in another computer will be another DSN.
Bu t I've already done with my problem. I got ODBC connection,using connection string. I understood my error. It's necessary after "DBQ=" in connection string to write path of folder, not of file.
|
|
|
|
|
Jackson86 wrote: It's necessary after "DBQ=" in connection string to write path of folder, not of file.
That must be a dBase thing. I used the following for a DSN-less connection to an Access database:
"ODBC;Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\\somefolder\\dataaccess\\ADO\\nwind.mdb;"
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Yes, you are right. It's dBase thing. But it was main problem for me. ODBC interprets dBase database as folder, where dbf files are located, and dbf files as tables of this database.
|
|
|
|
|
Hi all:
I have the following codes:
<br />
typedef struct Point3Struct {<br />
double x, y, z;<br />
} Point3;<br />
...<br />
Point3 Object1_vertex[] = {...}<br />
...<br />
void someFunction(Point3 *vertex_list){<br />
size_t size = sizeof(vertex_list) / sizeof(Point3);<br />
...<br />
}<br />
<br />
int main(){<br />
someFunction(Object1_vertex);<br />
}<br />
By passing the vertex array into the function "someFunction", I want to calculate the size of the array and do some other operations. But why this doesn't work? When I trace the program, the varialbe size is always 0. And the vertex_list is just the first element of the array.
Other than that, if I try to do something like
size_t size = sizeof(Object1_vertex) / sizeof(Point3);
It will give me an error message saying that
error C2070: 'Point3 []': illegal sizeof operand
which complains about the "sizeof(Object1_vertex)".
How should I solve the problem please? If I want to pass an array into a function, is this the correct way to do that???
Asura
|
|
|
|
|
You'll simply need to pass the size of the array as a separate argument.
If you want to know more details on why this is happening, see this discussion[^], or search for "array decay" on the Internet.
|
|
|
|
|
size_t size = sizeof(vertex_list) / sizeof(Point3);
won't work since vertex_list is a pointer and its size is 4 (or 8).
This...
size_t size = sizeof(Object1_vertex) / sizeof(Point3);
...works for me (size == 3 if I initialize with 3 Point3 structs) but that makes passing the array
useless since the array is accessible from anywhere in the same file anyway.
You may need to pass the size along with the array pointer unless you can define the array with
a set size.
Mark
|
|
|
|
|
In addition to the previous answer, I suggest that you take a look at the container classes from the STL (std::list or std::vector for example). At first sight it might be more complicated but it solves a lot of problems (and finally ease your life because you won't need to manage the memory yourself).
|
|
|
|
|
Hi,
So I have this code to open a handle hKey which works fine.
RegCreateKeyEx(HKEY_LOCAL_MACHINE, "SOFTWARE\\MyProgram", 0L, NULL, REG_OPTION_NON_VOLATILE, KEY_ALL_ACCESS, NULL, &hKey, NULL);
Then I try to set a value from a GUI CString member variable m_license_key into registry.
RegSetValueEx(hKey, "PROGRAM_KEY", 0L, REG_DWORD,(LPBYTE)&m_license_key, sizeof(DWORD));
The set function also works fine other than the fact that "rubbish" gets inserted as value for my registry key. In other words, HKEY_LOCAL_MACHINE\\SOFTWARE\\MyProgram\\PROGRAM_KEY is added, but the value is not what I keyed into m_license_key (it is just some strange text or some 0xHex numbers)
To be honest, I do not know what to specify for parameters 4, 5, 6 of RegSetValueEx. Any help would be greatly appreciated. Thanks.
|
|
|
|
|
I use this code...
bool CRegistry::SetKey(HKEY hKey, CString csSubkey, CString csValName, CString csVal)
{
if(hKey != HKEY_CURRENT_USER)
return false;
if(csSubkey.IsEmpty() || csValName.IsEmpty() || csVal.IsEmpty())
return false;
HKEY hWkKey;
LONG lRetorn = RegOpenKeyEx(hKey,csSubkey,0,KEY_ALL_ACCESS,&hWkKey);
if(lRetorn == ERROR_SUCCESS)
{
int iLength = csVal.GetLength();
lRetorn = RegSetValueEx(hWkKey,
csValName,
0,
REG_SZ,
(BYTE *)csVal.GetBuffer(0),
iLength);
RegFlushKey(hWkKey);
RegCloseKey(hWkKey);
if( lRetorn == ERROR_SUCCESS)
return true;
}
return false;
}
Hope this helps.
|
|
|
|
|
You can't cast a CString to a LPBYTE.
If you want the text in the CString saved then use the REG_SZ type...
RegSetValueEx(hKey, "PROGRAM_KEY", 0L, REG_SZ,(LPBYTE)(LPCTSTR)m_license_key, m_license_key.GetLength() + 1);
|
|
|
|
|
trumper wrote: I do not know what to specify for parameters 4, 5, 6 of RegSetValueEx.
They hide that information in the documentation[^]
led mike
|
|
|
|