From: No�l Danjou on
Hello all,

I am trying to port an MFC application to Vista but I am encountering an
issue with COleDropTarget. I need to configure a page of a property sheet as
a drop target.

In Windows XP, the code (see snippet below) works as expected but in Vista,
despite the fact that the call to Register(this) succeeds, the OnDragEnter,
OnDragOver, OnDrop members of my COleDropTarget-derived class are never
called when I drop a file from the explorer to my page.

Do you have an idea what might be wrong? Did something change between
Windows XP and Vista about the way the shell drag and drop works? Any idea
would be welcome. Thank you.

--
No�l
http://noeld.com/




class CMyPage : public CPropertyPage
{
...

protected:
CMyOleDropTarget m_DropTarget;

...
};

BOOL CMyPage::OnInitDialog()
{
...

if (!m_DropTarget.Register(this))
{
AfxMessageBox(_T("Registration failed"), MB_ICONERROR);
}

return TRUE;
}

DROPEFFECT CMyOleDropTarget::OnDragEnter(CWnd* pWnd, COleDataObject*
pDataObject, DWORD dwKeyState, CPoint point)
{
...

return OnDragOver(pWnd, pDataObject, dwKeyState, point);
}

DROPEFFECT CMyOleDropTarget::OnDragOver(CWnd* pWnd, COleDataObject*
pDataObject, DWORD dwKeyState, CPoint point)
{
if (...)
{
return DROPEFFECT_COPY; // data fits
}
else
{
return DROPEFFECT_NONE; // data won't fit
}
}

BOOL CMyOleDropTarget::OnDrop(CWnd* pWnd, COleDataObject* pDataObject,
DROPEFFECT dropEffect, CPoint point)
{
if (...)
{
...
return TRUE;
}

return FALSE;
}


From: Charles Wang[MSFT] on
Hi, No�l,
To let me better understand your issue, I would like to know the following
questions:
1. What is your MFC library version?
2. Did you run your applicaion with "Run as Administrator"? If not, please
try running your applicatin with "Run as Administrator" to see if this
issue persists.
3. Had the Windows SDK for Vista been installed on your Windows XP SP2? If
not, please install it, rebuild your application, and then deploy your
application to Vista to see if this issue persists.
You can download Windows SDK for Vista via the following link:
Microsoft� Windows� Software Development Kit for Windows Vista� and
.NET Framework 3.0 Runtime Components

http://www.microsoft.com/downloads/details.aspx?familyid=c2b1e300-f358-4523-
b479-f53d234cdccf&displaylang=en

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications

If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.


Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================




From: No�l Danjou on
Hi Charles,

Thanks for your reply. Here are the answers to your questions:

1. I am using Visual Studio 2005 Pro SP1 and the program is statically
linked to the MFC library.

2. I did try "Run as Administrator" in Vista but to no avail, actually the
application has a manifest with trustInfo:

<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>

3. I do not have the Windows SDK for Vista on my Windows XP SP2 system
because the application needs to be backward compatible with Windows 98, ME
and 2000, I use the Platform SDK for Windows Server 2003 R2.

Nevertheless I installed Visual Studio 2005 SP1 w/ Vista update and the
Windows SDK for Vista on a Vista test system and I recompiled my application
but same result, drag and drop doesn't work in Vista.

Thanks for your help.

Best regards,
--
No�l
http://noeld.com/


From: Charles Wang[MSFT] on
Hi, Noel,
Thanks for your response. I am performing research on this issue now. Is it
convenient for you to send me (changliw_at_microsoft_dot_com) a test
project so that I can quickly reproduce your issue for further research?

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications

If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.


Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================






From: Charles Wang[MSFT] on
Hi, Noel,
I am sorry that I may need more time for the response due to two day's sick
leave. I have arranged this post as my priorist task tommorrow. I will let
you know the response as soon as possible. Sorry for bringing you any
inconvenience.

Best regards,
Charles Wang
Microsoft Online Community Support
=====================================================
Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications

If you are using Outlook Express, please make sure you clear the check box
"Tools/Options/Read: Get 300 headers at a time" to see your reply promptly.


Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
======================================================
When responding to posts, please "Reply to Group" via
your newsreader so that others may learn and benefit
from this issue.
======================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
======================================================