IWMDMStorageControl Insert fails in THREAD mode
WMPTalk.com Forum Index WMPTalk.com
Discuss Windows Media Player
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web wmptalk.com
IWMDMStorageControl Insert fails in THREAD mode

 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK
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 Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
decang
Guest





Posted: Thu Nov 03, 2005 5:30 pm    Post subject: Re:IWMDMStorageControl Insert fails in THREAD mode Reply with quote

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 Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
decang
Guest





Posted: Fri Dec 09, 2005 5:30 pm    Post subject: re:IWMDMStorageControl Insert fails in THREAD mode Reply with quote

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 Reply with quote

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
View user's profile Send private message Send e-mail Yahoo Messenger MSN Messenger
 
Post new topic   Reply to topic    WMPTalk.com Forum Index -> SDK All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



Microsoft Office Forum New Topics
Powered by phpBB