Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2001-07-04
4
Medium Priority
?
209 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
[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
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 200 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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

722 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