Solved

TMemo, Occasionally not accepting Keypress events in a DLL. (D5)

Posted on 2001-07-04
4
201 Views
Last Modified: 2010-04-06
I have put together a program that works / looks much the same as the Windows 2000 Manage option.
the program has a tree menu, and a panel on the other side that depending on which option you select opens that form / page.
now these pages are all in different DLL's, and are created useing the form CreateParented procedure giving me the required result of a simple menu with different option screens all on one page.
Another reason i did this was some of the screens are also available as programs in there own right, a simple DPR that calls the dll, pops up the form and it just acts like a normal program. simple.

now on one of the screens i have a memo, just a standard TMemo, and if it is running as a single program, or as a popup form from the main menu program, or the first time you run the individual form as a parented window it works fine. BUT if when the form is parented i move to another application and then back again, all navigation keys( up, down, left, right, Alt, CTLR ) do not work.

i have tried setting an on keypress and keydown event and they are just not being called at all. WHY.
if i close the dll form and reopen it again its fine.
If the form is in popup mode rather than parented mode it will allways work fine, only when parented does this happen.
i have checked through out the entire source code and i am not accessing any keypress / keydowns any where ( apart from my own TMyEdit in my package). but that obviously does not have an impact on a TMemo miles away.

im absolutely baffled.

any advice / thoughts / work arounds / fudges / fixs welcome.

Cheers Kristian.
0
Comment
Question by:Kristian
  • 2
4 Comments
 
LVL 9

Expert Comment

by:ITugay
ID: 6252725
Hi Kristian,

this behaviour looks like loosing a focus. Seems it looses focus and can't get it back. Try to set focus manually via windows API windows.SetFocus(Handle); Not sure, may it help.

------
Igor.
0
 
LVL 1

Author Comment

by:Kristian
ID: 6252790
I was with you then, as i also have a status bar that needed some subtle setting of focus to always work when i posted a message to it.

BUT

i tried:

windows.setfocus(QueryMO.handle);
&
SetFocusedControl(QueryMO);
&
QueryMO.Setfocus;

in the OnEnter event of the memo ( ive steped through each time and its doing the call ).

but no luck.

BUT by doing this it did make the problem start straight away rather than after i loose focus and come back so i think were on the right track.

Kristian
0
 
LVL 8

Accepted Solution

by:
TOndrej earned 50 total points
ID: 6254433
Have you compiled the DLLs and the main project with runtime packages?
0
 
LVL 1

Author Comment

by:Kristian
ID: 6254724
I cant beleive you've hit the nail on the head !!

I have a design + runtime package ( well theres no design time parts so it makes sence to have just the one package).

When im developing i compile including the packages so that it saves me compiling all programs / Dll's if i change the package ( good time saver ).

But as part of the software there is a release unit that compiles and releases itself, and this does not include runtime packages as i wanted to utilize the decrease in network traffic as it is a big suit ETC.

and when compiled with out the package it works absolutely fine ( well i havnt seen any problems yet anyway )..

I dont understand why, and i think its probably not worth trying to find out, ( as its ok on site i can live with it )..

anyway nice one,
Kristian
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone 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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

680 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