OnAcceptDropFiles?OnDropFiles
Sunday, July 27, 2008 by lostfly | Discussion: ObjectDock
BUT OBJECTODOCK NEVER CALL OnDropFiles()!!!
when I drop file into the docklet.
pls tell me what's wrong??
Reply #2 Monday, August 25, 2008 1:26 PM
Reply #6 Tuesday, August 26, 2008 2:20 PM
Hello,
Much in the same way that Microsoft support will not give you advice on being a better writer if you buy Word, nor will Adobe teach you to be a better artist with Photoshop, Stardock Technical Support does not provide help with creating skins, themes, objects, etc. with our products. If you have problems/questions with the applications themselves, please feel free to contact us in the future. Until then, please visit http://www.skinning.net, or http://wiki.wincustomize.com for help and tutorials on creating with our applications.
Please let me know if you have any additional questions.
I would say no more until I get a response to my reply...
Reply #7 Tuesday, August 26, 2008 6:15 PM
I'm curious to know what exactly was the content of your message. If you were simply asking for help, maybe that's the reason they responded like that. A quick google search gives you this link saying it's broken. So it's more like a bug report than a request for documentation.
Anyway, clearly the documentation is outdated and ObjectDock doesn't implement the "Docklet API" the way it used to do.
OnDropFiles is not called anymore, instead you have to implement OnDropData.
Here is an example (without full error checking, release of pUnknown in STGMEDIUM if not NULL, etc...):
HRESULT CALLBACK OnDropData(IDataObject *pDataObject, DWORD grfKeyState, DWORD *pdwEffect)
{
FORMATETC fmtetc = { CF_HDROP, NULL, DVASPECT_CONTENT, -1, TYMED_HGLOBAL };
STGMEDIUM stgmed;
// ask the IDataObject for some CF_HDROP data, stored as a HGLOBAL
if(pDataObject->GetData(&fmtetc, &stgmed) == S_OK)
{
// We need to lock the HGLOBAL handle because we can't
// be sure if this is GMEM_FIXED (i.e. normal heap) data or not
HDROP hdrop = (HDROP)GlobalLock(stgmed.hGlobal);
UINT uNumFiles;
TCHAR szNextFile [MAX_PATH];
// Get the # of files being dropped.
uNumFiles = DragQueryFile ( hdrop, -1, NULL, 0 );
for ( UINT uFile = 0; uFile < uNumFiles; uFile++ )
{
// Get the next filename from the HDROP info.
if ( DragQueryFile ( hdrop, uFile, szNextFile, MAX_PATH ) > 0 )
{
MessageBox(NULL, szNextFile, "Sample Docklet", MB_OK | MB_ICONINFORMATION);
}
}
// cleanup
GlobalUnlock(stgmed.hGlobal);
ReleaseStgMedium(&stgmed);
}
*pdwEffect = DROPEFFECT_LINK;
return S_OK;
}
And here we have a nice snippet of code for support, much better than the standard response
Reply #8 Tuesday, August 26, 2008 11:01 PM
I think I needed something like you responded... sure I found the 2004 posts here and in Aqua-soft, but I have been doing Docklet development for just three months, when I was those post, my initial reaction was that they were too old and that "maybe" those issues where already taken care of.
I do not pretend that stardock's support will solve my "issues" with docklet development but is discouraging to recieve such a response when I have donde (as to date) 7 docklets... maybe they are not the best-of-the-best (surely they arent), and maybe they really stink. But hitting a wall... well that disapoints me.
I can only thanks you all, the Master Developers which have been around for years...
Thanks again.
Reply #9 Tuesday, August 26, 2008 11:53 PM
Reply #10 Wednesday, August 27, 2008 12:23 AM
Maybe it's all my fault, maybe I did not ask the right questions, maybe... but anyway, you did help me... back to the kayboard.
I really appreciate your help.
Reply #11 Wednesday, August 27, 2008 2:05 AM
Yes! it worked just fine... know I am able to get the file names that are dropped on the docklet... Thanks!
Reply #12 Sunday, November 9, 2008 9:02 PM
fedroponce
HRESULT CALLBACK OnDropData(IDataObject *pDataObject, DWORD grfKeyState, DWORD *pdwEffect)
by this function,
how to know WHICH docklet to accept files?
thanks
Reply #13 Saturday, February 14, 2009 1:33 AM
Just for reference, a way to know which docklet was called is to save the docklet data pointer in the call to OnAcceptDropFiles and use that in the next call to OnDropData (and hope that ObjectDock does not start to cache the results in the future...).
Please login to comment and/or vote for this skin.
Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:
- Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
- Access to a great community, with a massive database of many, many areas of interest.
- Access to contests & subscription offers like exclusive emails.
- It's simple, and FREE!







Reply #1 Monday, August 25, 2008 1:16 PM