| Author |
Message |
nistvan_ro
Joined: 03 Oct 2005
Posts: 16
Location: Brasov, RO
|
Posted:
Thu Nov 03, 2005 10:08 am Post subject:
IWMDMStorageControl Insert fails in THREAD mode |
|
|
Hi!
I have a problem with this:
HRESULT hr = pIWMDMStorageControl->Insert(
WMDM_CONTENT_FILE | WMDM_MODE_THREAD | WMDM_FILE_CREATE_OVERWRITE,
ConvertStringToBSTR(doFileList[intCurrentFileIndex].c_str()),
NULL, pProgress,
&pDummyStorage);
I call this function after each IWMDMProgress pProgress->End (when transfer is finished for a file), and after 2 calls I get E_OUTOFMEMORY error. I don't know what's happening! I need WMDM_MODE_THREAD otherwise the function blocks my interface while transferring...
|
|
| Back to top |
|
 |
decang
Guest
|
Posted:
Thu Nov 03, 2005 5:30 pm Post subject:
Re:IWMDMStorageControl Insert fails in THREAD mode |
|
|
Probably you need to release the IWMDMStorage
that allocated by
IWMDMStorageControl::Insert()
every time you called to it.
In you case:
if (pDummyStorage!= NULL)
pDummyStorage->Release(); |
|
| Back to top |
|
 |
nistvan_ro
Joined: 03 Oct 2005
Posts: 16
Location: Brasov, RO
|
Posted:
Tue Nov 22, 2005 9:01 am Post subject:
re:IWMDMStorageControl Insert fails in THREAD mode |
|
|
Still the same thing happens, it gave me a E_OUTOFMEMORY error.
I am releasing pDummyStorage, but does not help.
One thing I noticed: after the function returns, pDummyStorage is NULL. I do not understand why. If I go in WMDM_MODE_BLOCK, then pDummyStorage is what it should be a pointer to a Storage object, and can be released.
Also, before going to the next insert, I am also checking the device status to be ready (as the SDK told me).
Here is the buggy code again:
if (pDummyStorage) {
pDummyStorage->Release();
pDummyStorage = NULL;
}
HRESULT hr = pIWMDMStorageControl->Insert(
WMDM_CONTENT_FILE | WMDM_MODE_TRANSFER_PROTECTED | WMDM_MODE_THREAD | WMDM_FILE_CREATE_OVERWRITE,
CA2W(doFileList[intCurrentFileIndex].c_str()),
NULL, pProgress,
&pDummyStorage);
|
|
| Back to top |
|
 |
decang
Guest
|
Posted:
Fri Dec 09, 2005 5:30 pm Post subject:
re:IWMDMStorageControl Insert fails in THREAD mode |
|
|
Do you call the second, third, etc. of insert() in pProgress->End()?
Probabley you need another approach where you can wait for the status ready
to call following insert() instead of just call it in pProgress->End(). |
|
| Back to top |
|
 |
nistvan_ro
Joined: 03 Oct 2005
Posts: 16
Location: Brasov, RO
|
Posted:
Mon Dec 12, 2005 11:06 am Post subject:
Re: re:IWMDMStorageControl Insert fails in THREAD mode |
|
|
| decang wrote: | Do you call the second, third, etc. of insert() in pProgress->End()?
Probabley you need another approach where you can wait for the status ready
to call following insert() instead of just call it in pProgress->End(). |
Actually I am calling the insert in pProgress->End(), but I am doing a status check, like this:
DWORD dwStatus;
((IWMDMDevice*)doDeviceOperation.di->Device)->GetStatus(&dwStatus);
if (dwStatus ==WMDM_STATUS_READY){
doDeviceOperation.StoreNext(doDeviceOperation.intCurrentFileIndex);
} |
|
| Back to top |
|
 |
|
|
|
|