Re: MSFlexGrid in simple ATL container window doesn't accept keystrokes

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: DavidB (davidb3_at_Ihatespam.hurkle.com)
Date: 08/11/04


Date: Wed, 11 Aug 2004 14:47:48 GMT

Hi Alexander

Yes, we found that and it's helpful, to a point. However (a) we're building
a wrapper, not an app and (b) it uses an old version of ATL and won't build
on VS7.

As a wrapper, we don't have access to the event loop. The keyboard solution
in this app to intercept keystrokes in the PreTranslateAccelerator of one
window and WM_FORWARDMSG them to another window. So far, we haven't managed
to find a way to do that in a wrapper. Surely getting the keyboard to work
can't be that hard?

Getting it to build in VS7 may be just a few tweaks -- dunno yet. There are
heaps of "ambiguous base class" errors.

The ideal would be just a few hints about what to add to the simple
container solution provided in the help and on MSDN, to get the keyboard to
work and to enable ambient properties. Doesn't anybody actually use this
sample? Everybody must run across the same problems.

DavidB

"Alexander Nickolov" <agnickolov@mvps.org> wrote in message
news:uaLi%23SvfEHA.704@TK2MSFTNGP09.phx.gbl...
> Not sure if this is what you are looking for, but there's an excellent
> article in the December'99 issue of then MIND titled something
> like "Extending ATL for real world containers" by Chris Sells and
> Dharma Shukla.
>
> --
> =====================================
> Alexander Nickolov
> Microsoft MVP [VC], MCSD
> email: agnickolov@mvps.org
> MVP VC FAQ: http://www.mvps.org/vcfaq
> =====================================
>
> "DavidB" <davidb3@Ihatespam.hurkle.com> wrote in message
> news:41182dfb$0$27243$61ce578d@news.syd.swiftdsl.com.au...
> > Actually, turns out the control is irrelevant.
> >
> > The standard sample based on ATL's AxHost implementation for control
> > containment works -- just! The hosted calendar control does not support
> the
> > keyboard, and as soon as you change from calendar to any other control
(eg
> > Rich Text, Flex Grid, etc), the sample crashes on start up with a LIBID
> > problem. It's a toy sample, and it's not obvious what to do next to make
> it
> > work in the real world.
> >
> > My question was about keyboard support, but then there are other
questions
> > about type library support, ambient properties, accessing other
> interfaces.
> > I guess I'm looking for a better sample or a tutorial on advanced usage.
> > Suggestions?
> >
> > DavidB
> >
> > "Igor Tandetnik" <itandetnik@mvps.org> wrote in message
> > news:eM2rpaifEHA.2468@TK2MSFTNGP12.phx.gbl...
> > > "david hurkle" <david at hurkle dot com> wrote in message
> > > news:4116db1a$0$27220$61ce578d@news.syd.swiftdsl.com.au
> > > > We have an MSFlexGrid in a simple ATL-derived container (but
> > > > implementing minimal interfaces), based on the sample previously
> > > > mentioned here. It works just fine in most respects, including mouse
> > > > and all the display stuff, but it doesn't accept or respond to any
> > > > keyboard input. It does however call outgoing event interfaces on
> > > > keystrokes (as well as other stuff).
> > >
> > > I'm not familiar with this particular control. You say it fires events
> > > on keystrokes - isn't there, by any chance, a boolean parameter or
> > > something for these events that you need to set a certain way to
> > > indicate that you have not handled the keystroke and that the control
> > > should perform its default processing? In other words, may it be that
> > > you are eating those keystrokes in your event handlers?
> > > --
> > > With best wishes,
> > > Igor Tandetnik
> > >
> > > "For every complex problem, there is a solution that is simple, neat,
> > > and wrong." H.L. Mencken
> > >
> > >
> >
> >
>
>



Relevant Pages

  • Re: Using Keyboard Combinations
    ... Control your program? ... or a form's Key events. ... no matter what app currently has focus, ... System-Wide Keyboard Trapping with RegisterHotKey ...
    (microsoft.public.vb.general.discussion)
  • Re: typing characters not present on your keyboard (was Re: OT What does RET (Enter) do and how does
    ... needed *full control* of the keyboard (meaning that no keypress gets ... I finally understood the process of reading off keyboard ... keyboard for my app. ... right ctrl, for example. ...
    (Fedora)
  • Re: Have to click twice to gain focus?
    ... when you click on a control in the app, ... type on the keyboard, nothing happens. ... Practices group to build this app. ... Can I capture Windows messages to see what is ...
    (microsoft.public.dotnet.framework.windowsforms)
  • Need Help !!!
    ... OK I'm working on an app that needs to generate Hex Codes from the keyboard ... For example to generate a 04h use Control D to generate a 02h use a Control ...
    (comp.protocols.appletalk)
  • Re: Second HID for exclusive use.
    ... but writing a keyboard and/or mouse filter driver that talks to your app through a separate "control device object" is probably the only way you'll be able to do it without modifying the firmware. ... Now, if your *application* is in the foreground, and it wants to split out data from *its* input stream and get the input from 1 device in the form of WM_INPUT messages, and leave the rest of the keyboards sending data through the traditional WM_CHAR, etc. messages, it can of course do that, but there's no way that I know of for a background app to remove keyboard data from the input stream of another app. ... Of course, one half of that hole has existed for a long time via SendInput, but at least malicious apps haven't in the past been able to steal the input from the real keyboard and replace it with scancodes of their own, at least not without installing a driver... ...
    (microsoft.public.development.device.drivers)