Board index » delphi » Problems calling InputBox from inside of dll

Problems calling InputBox from inside of dll

If I put the following line in my application:

  InputBox ('TestBox',
                  'Enter a value',
                  TestVal);

....it comes up fine with an Ok and Cancel button.

but if I put that same line in a .dll file and then from that same
application (after having seen a good copy of the dialog display) I call the
routine in the .dll I get the same dialog up but the Ok button has changed
to Ignore All and (right off I don't remember what the Cancel button is but
it isn't right).  What causes the change of behavior of this dialog
depending on whether you call InputBox from the main app or from inside a
.dll?   And more important is how do I fix it?   Thanks (yet once again) for
any tips.  You are all being very helpful in this group even if I'm still in
the 'taking baby steps' phase......

 

Re:Problems calling InputBox from inside of dll


Quote
In article <4241f...@newsgroups.borland.com>, Warren O. Merrill wrote:
> If I put the following line in my application:

>   InputBox ('TestBox',
>                   'Enter a value',
>                   TestVal);
> .....it comes up fine with an Ok and Cancel button.

> but if I put that same line in a .dll file and then from that same
> application (after having seen a good copy of the dialog display) I call the
> routine in the .dll I get the same dialog up but the Ok button has changed
> to Ignore All and (right off I don't remember what the Cancel button is but
> it isn't right).

Not unsurprisingly i cannot reproduce this problem. There has to be something
involved you have not told us about.

 - Which Delphi version are you using?

 - Have you made sure to use the correct unit for InputBox, i. e. Dialogs,
   not QDialogs?

This was my test function in the DLL:

function DLLInputTest: Shortstring;
var
  TestVal: String;
begin
  Application.Handle := GetForegroundWindow;
  try
    Testval := InputBox ('TestBox',
              'Enter a value',
              'Dummy');
    MessageBox(GetForegroundWindow, Pchar(Testval), 'DLL', MB_OK);
    Result := Testval;
  finally
    Application.Handle := 0;
  end;
end;

exports
  DLLInputTest;

--
Peter Below (TeamB)  
Use the newsgroup archives :
http://www.mers.com/searchsite.html
http://www.tamaracka.com/search.htm
http://groups.google.com
http://www.prolix.be

Other Threads