|
Hans Dietrich wrote: By far the simplest: WinExec().
Yeah but you need to remember to quote-enclose long filenames!
|
|
|
|
|
You can also use CreateProcess().
|
|
|
|
|
I've got code that reads Exif metadata from JPG files. One file in particular is giving me trouble when reading its PropertyTagEquipModel property. On my XP machine, it reads fine. On my Win7 machine, however, the call to GetPropertyItemSize(PropertyTagEquipModel) returns 0 , thus the property itself cannot be read. I even dumped all of the properties using GetAllPropertyItems() and PropertyTagEquipModel was not one of them (it is on my XP machine, though).
To add to the confusion, if I right-click the file in Explorer on the Win7 machine and select Properties, it will find the PropertyTagEquipModel property. Further, I downloaded a few Exif viewer programs and they found the property just fine.
For what it's worth, here is my code that reads the PropertyTagEquipModel property:
UINT uSize = pImage->GetPropertyItemSize(PropertyTagEquipModel);
if (uSize > 0)
{
PropertyItem *pItem = (PropertyItem *) new BYTE[uSize];
if (pImage->GetPropertyItem(PropertyTagEquipModel, uSize, pItem) == Ok)
{
if (pItem->type == PropertyTagTypeASCII)
}
delete [] pItem;
} Any ideas what I might be overlooking? All of my other 20,000+ files are working fine on both platforms.
[edit]
I got positive results by changing the GDI+ version in the manifest file. It defaults to v1.1, so by changing it to v1.0, I was able to read the property. That makes me wonder what feature(s) I might be missing by going "backward."
[/edit]
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
modified on Thursday, February 17, 2011 10:52 AM
|
|
|
|
|
Documentation is a bit 'light', I see.
What was the return value of the (incomplete) GetAllPropertyItems ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CPallini wrote: What was the return value of the (incomplete) GetAllPropertyItems?
Status::Ok
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
That is, no cookie for us.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I don't follow.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Sorry for my bad English. I mean, with such a poor documentation and a successfull return value (on incomplete results), I see no solution.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
A side note:
delete [] (BYTE*) pItem;
|
|
|
|
|
Why the cast?
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Strictly speaking you will be running the destructor(s) of PropertyItem (s) if you don't.
Actually, you are just lucky it works without. Change compiler and it might break. (Not very likely, I know)
|
|
|
|
|
i am writing small utility which will sync two bookmarks file ....
|
|
|
|
|
yogish293 wrote: i am writing small utility which will sync two bookmarks file
So, what have you written so far ? What is your problem ?
Sorry, but noone is going to study your requirements nor write code for you.
You have to help yourself a bit, define what are your requirements, try to develop a skeleton app from where you can progress.
Then, when you have a specific problem/question, you can come back here and ask for help.
|
|
|
|
|
they have checksum value for bookmarks file...if i add any bookmarks into file i have to recalculate checksum value otherwise browser wont read added bookmarks
modified on Thursday, February 17, 2011 7:34 AM
|
|
|
|
|
Well you still have not described your problem.
I must get a clever new signature for 2011.
|
|
|
|
|
Plus :
Did you try what had been told to you in this post ?
Please don't create a new thread for a question you still posted. It's a very rude attitude and you won't get much from it.
|
|
|
|
|
hello guys... im trying to store time in sql database using ADO. Now im using ctime() to get time and then send it as arguments in function to be stored. But it show the following error
Conversion failed when converting Datetime from character string
NOTE:Datatype of this column is DateTime in Sql Server. Here is my code to get time
char time1[60] = "";
time_t sTime;
time(&sTime);
strcat(time1,ctime(&sTime));
printf("the time is:\t %s", time1);
Database db;
db.InsertRec(time1);
Now Here is the code for the function which inserts record in the database-----db.InsertRec()
char sTime[60] = "";
strcat_s(sTime,time1);
char query[100] = "INSERT INTO Tracks VALUES('";
strcat_s(query,sTime);
strcat_s(query,"')");
try
{
recordset->Open(query, connection.GetInterfacePtr(),ADODB::adOpenForwardOnly,ADODB::adLockReadOnly,ADODB::adCmdText);
}
catch(_com_error &e)
{ printf("\n\n%s", (LPCSTR)((_bstr_t)e.Description())); }
recordset->raw_Close();
what can be the problem?? thnx
modified on Thursday, February 17, 2011 2:38 AM
|
|
|
|
|
overloaded Name wrote: Conversion failed when converting Datetime from character string
That seems a fairly clear message. Your database expects a DateTime value and you are sending it a string.
I must get a clever new signature for 2011.
|
|
|
|
|
When I google it than I find why this error comes:
This error message appears, when SQL Server cannot convert a string to a valid DATETIME value. Check here -> [^]
Here is Sample[^] application that uses DateType value.
I believe in LOVE AT FIRST SIGHT...
Bcoz I have loved my Mother...
even since I opened my eyes...(ICAN)
|
|
|
|
|
Print that query and enter it in e.g. SQL Server Enterprise Manager, and play with it there. I think that the date/time was not formatted the way the server expected it to be - e.g. "17.02.2011" instead of "2/17/2011". Fortunately, you tried it today, and not a week ago, as only a wrong value would have been recorded in the database.
If possible, change to parameterized queries - they will handle that scrap for you.
|
|
|
|
|
I am trying to access this key in my code (which is a Windows Service and is launched with admin privilege):
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\MMDevices\Audio\Capture
and I keep getting the error code 5 (ERROR_ACCESS_DENIED ).
I followed this solution[^] to adjust the token privilege. This step succeeded, but then RegOpenKeyEx still returned ERROR_ACCESS_DENIED .
What else should I do to access this key?
Thanks in advance.
Maxwell Chen
|
|
|
|
|
|
Hi Cool_Dev,
I roughly had a glance on the discussion thread just now. In the thread, they came out with the solution using manifest file, right?
Answering to your question: Yes, I am on Windows 7 32-bit platform. My code is to be compiled with VC++6 and WDK 6000. So manifest files might not be the solution to this issue ... I guess.
Maxwell Chen
|
|
|
|
|
That thread says that the error code 5 can be ERROR_CANTWRITE also. Have a look into it. you can ensure it by checking the value got in in PHKEY argument.
Also try using KEY_ALL_ACCESS Or KEY_WOW64_64KEY in RegOpenKeyEx.
|
|
|
|
|
Cool_Dev wrote: That thread says that the error code 5 can be ERROR_CANTWRITE also. Have a look into it. you can ensure it by checking the value got in in PHKEY argument.
Also try using KEY_ALL_ACCESS Or KEY_WOW64_64KEY in RegOpenKeyEx.
Hi Cool_Dev,
1) The name KEY_WOW64_64KEY is not defined in VC++ 6. So I did not add it since the compiler said "undeclared identifier".
2) RegOpenKeyEx returns value 0 in the PHKEY argument.
3) I have been using KEY_ALL_ACCESS all the time.
4) During run-time seen on the debugger, ERROR_ACCESS_DENIED is 0x0005 and ERROR_CANTWRITE is 0x03F5 .
Please refer to the screenshot[^] on VC++2005 remote debugger.
Maxwell Chen
|
|
|
|