|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
HI!
I'm doing my work of thesis on a c++ project using C++ Builder 5. My tutor has obliged me to do a thing (that I've had yet in a simpler way) using a DLL. Here come the problems. In fact in a common application like this: PHP Code:
, I'm able to use the command Application->OnShortCut. And the application does what required (the message is displayed). Instead if I try to do a similar thing using a DLL, everything is harder (actually too hard for me). In fact I think it's not possible to use a declaration like void __fastcall TForm1::KeyEvent(TWMKey &Msg, bool &Handled) in the body of the DLL, because of the fact that I cannot declare it anywhere (there isn't a header file to do this like in common applications). So to avoid this problem I decided to add to my DLL a fictitious Form (Form2) where I declared the event KeyEvent: in the main body of the DLL I used the command Application->OnShortCut=Form2->KeyEvent. According to me, everything should work, but it seems that the pushing of the key is not recognized. But I don't know why. PHP Code:
This simple application should return true if the RETURN key has been pushed, false in the other cases. Any ideas? Thanx |
|
#2
|
||||
|
||||
|
Try showing your form?
Code:
int WINAPI DllEntryPoint(HINSTANCE hinst, unsigned long reason, void* lpReserved)
{
Form2 = new TForm2(NULL);
Application->OnShortCut = Form2->KeyEvent;
Form2->Show();
return 1;
}
__________________
Up the Irons What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home. "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest Down with Sharon Osbourne Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#3
|
|||
|
|||
|
The problem wasn't due to the showing of the form but to the unchecked option "Build with runtime packages" in Projects|Options|Packages.
Thanx 4 your help! |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > Delphi Programming > using event in DLL |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|