[RESOLVED] F1Book - Drag and Drop
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 10 of 10

Thread: [RESOLVED] F1Book - Drag and Drop

  1. #1
    Join Date
    Aug 2005
    Posts
    27

    [RESOLVED] F1Book - Drag and Drop

    Does anyone know how to disable drag and drop on an F1Book (Tidestone Formula One ActiveX grid control)? I want to prevent users from dropping data from other applications onto the control. Not sure what other information will be helpful. Thanks for your help.

  2. #2
    Join Date
    Apr 1999
    Posts
    3,585

    Re: F1Book - Drag and Drop

    How are you using the control? Do you have a wrapper class? How is the control instantiated?
    Gort...Klaatu, Barada Nikto!

  3. #3
    Join Date
    Aug 2005
    Posts
    27

    Re: F1Book - Drag and Drop

    The control is linked to a resource on my dialog through DDE. The wrapper class for the control is CF1Book (generated by Visual Studio). I have the User's Guide for the control, but haven't been able to find anything related to disabling drag and drop.

  4. #4
    Join Date
    Apr 1999
    Posts
    3,585

    Re: F1Book - Drag and Drop

    If the wrapper is dervied from COleControl, you can try to use DragAcceptFiles().
    Gort...Klaatu, Barada Nikto!

  5. #5
    Join Date
    Aug 2005
    Posts
    27

    Re: F1Book - Drag and Drop

    The wrapper is derived from CWnd.

  6. #6
    Join Date
    Apr 1999
    Posts
    3,585

    Re: F1Book - Drag and Drop

    Not a problem. COleControl is derived from CWnd and DragAcceptFiles is actually a method of CWnd.
    Gort...Klaatu, Barada Nikto!

  7. #7
    Join Date
    Aug 2005
    Posts
    27

    Re: F1Book - Drag and Drop

    I tried calling DragAcceptFiles(FALSE) on my CF1Book in OnInitDialog and it still accepts the drop.

  8. #8
    Join Date
    Aug 2005
    Posts
    27

    Re: F1Book - Drag and Drop

    Found the answer...

    Code:
    WINOLEAPI RevokeDragDrop(
      HWND hwnd  //Handle to a window that can accept drops
    );
    Code:
    // m_f1 is a member variable of type CF1Book (the wrapper class)
    RevokeDragDrop((HWND)m_f1.GetHWnd());
    );
    Thanks for helping, Mike!

  9. #9
    Join Date
    Feb 2012
    Posts
    1

    Re: F1Book - Drag and Drop

    anybody knows where could get F1Book?

  10. #10
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Wallisellen (ZH), Switzerland
    Posts
    18,957

    Re: F1Book - Drag and Drop

    Quote Originally Posted by germanrachid View Post
    anybody knows where could get F1Book?
    Perhaps, from Tidestone web site?
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This a Codeguru.com survey!


On-Demand Webinars (sponsored)