Link to home
Start Free TrialLog in
Avatar of Mobinex
Mobinex

asked on

How to disable drag/drop from other to HTML View Control MFC?

Hi Experts,
I have used the HTML View Control in my MFC project to view HTML page.
But it has problem is that User can drag/drop any folder from any folder to the dialog to open as window explorer.

How to disable this issue? Can you help me to give some example or ideas?

Thank in advance!
ASKER CERTIFIED SOLUTION
Avatar of alb66
alb66
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mobinex
Mobinex

ASKER

What about OnInitialUpdate function?
This is a virtual function that we need tm implement and it will auto call when HTML control init?
I checked but i don't see this function from CHtmlView  (AFXHTML.H)

Can you give me suggestion again?
OnInitialUpdate() is a virtual function of CView class. Since CHtmlView inherits from CView you can override it in your CHtmlView derived class.

I have a question: are you using the web control via CHtmlView or have you inserted it in a dialog?
Avatar of Mobinex

ASKER

I have used a dialiog, MFC dialog. I have implemented a MyHTML class that public CHTMLView.

CHTMLView or CHtmlView? What is CHTMLView? Is the wrapper for the ActiveX control?
Can you attach  a code snippet to show me how to use it?
Avatar of jkr
If that does not work or isn't enough:


void CMyApp::InitInstance()
{
    DragAcceptFiles(FALSE);
 
    //... the rest
}

Open in new window

Avatar of Mobinex

ASKER

I have used m_cHtmlCtrl.SetRegisterAsDropTarget(false); function
then it works

Thank fo all help.
Any points? ;-)