Solved

Clipboard Cut, Copy, Paste Handlers

Posted on 1998-02-16
3
276 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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 discusses moving either the default database or any database to a new volume.

707 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now