Solved

Clipboard Cut, Copy, Paste Handlers

Posted on 1998-02-16
3
284 Views
Last Modified: 2013-11-20
I am working on a MDI client/server appliaction where if I am calling the OnEditCut, OnEditPaste and OnEditCopy while running the application at Windows Nt 4.0  it loses focus. The same handlers are working okay if the application is run on Windows 95.
0
Comment
Question by:shye
  • 2
3 Comments
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1316236
No idea WHY that is happening, but you might be able to kludge it by calling SetForegroundWindow() after your calls to OnExitXxxx().  Or maybe a short duration timer...

(Just so you can make it work in the meantime.)

-=- James.
0
 
LVL 11

Accepted Solution

by:
mikeblas earned 100 total points
ID: 1316237
Why would you call those functions?  They're message handlers, designed to be called by MFC in response to a message.  It doesn't make much sense to call them directly yourself, and depending on exactly how you do so, you can crash or corrupt your system.

You should be calling the CEdit::Copy() or CEdit::Cut(), or CEdit::Paste() methods. You shoudln't call event handlers.

.B ekiM
0
 
LVL 4

Expert Comment

by:jtwine100697
ID: 1316238
Hmmm..  I shoulda read the question closer...  Mikeblas is correct.  Usually, any OnXxxx() functions are called by the framework in response to a message (action).

That actually might be your problem!

-=- James.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question