Solved

Clipboard Cut, Copy, Paste Handlers

Posted on 1998-02-16
3
286 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

615 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