View Issue Details

IDProjectCategoryView StatusLast Update
0006483JEDI VCL00 JVCL Componentspublic2016-08-06 21:11
ReporterKevinBlackAssigned To 
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Product Version3.48 
Target VersionFixed in Version 
Summary0006483: TJvDesktopAlert in DLL Function Does not Display if Called fron Console Application
DescriptionHave DLL which has a function to display an alert message using TJvDesktopAlert. Function works exceptionally well if called from a Delphi GUI (Forms) application.

Same DLL function called from (Delphi) Console Application does not show alert. Same if DLL function called from C++ console app. (Delphi) Console application calling DLL function is very simple, see additional info.

Notes: 1. DLL has showmessage at beginning of function to show correct parameters passed
       2. The JvDesktopAlert Execute command is executed in DLL when called from console app, just no alert appears

Additional Information{$APPTYPE CONSOLE}
...
...
begin
  try
    pTitle := 'Message Title';
    pMessage := 'Message Text';
    icon := ICON_CONFIRMATION;

    Writeln ('before the alert code');
    sfms_message(pMessage,ptitle,icon); <--Call to DLL with JvDesktopAlert function
    Writeln ('after the alert code');

    readln; <--Just to stop the console app closing
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.

::::::: GUI CALL WHICH WORKS ::::::::::
// Displays multiple alerts with different Icons
...
...
begin
  try
    pTitle := 'Message Title';
    pMessage := 'This is a message';

    for I := 0 to 4 do
    begin
      case i of
        0: icon := ICON_NONE;
        1: icon := ICON_MESSAGE;
        2: icon := ICON_WARNING;
        3: icon := ICON_ERROR;
        4: icon := ICON_CONFIRMATION ;
      end;

      errCode := sfms_message(pMessage, pTitle, icon);
      if errCode < 0 then
        raise Exception.Create('Error returned: ' + IntToStr(errCode));
    end;
  except
    on E: Exception do
    begin
      ShowMessage(E.Message);
    end;
  end;

end;
TagsNo tags attached.

Activities

AHUser

2016-08-06 21:11

developer   ~0021360

Your console application doesn't process window messages. JvDesktopAlert needs a message loop. A VCL application has a main message loop, the ReadLn call has no message loop and blocks the application.

Issue History

Date Modified Username Field Change
2015-12-26 13:37 KevinBlack New Issue
2016-08-06 21:11 AHUser Note Added: 0021360
2016-08-06 21:11 AHUser Status new => closed
2016-08-06 21:11 AHUser Resolution open => fixed