Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: MessageDlg doesn't open dialog on Mac unless...


This question is not answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Oct 3, 2014 5:23 PM Last Post By: John Frazier
Grant Beattie

Posts: 77
Registered: 11/29/01
MessageDlg doesn't open dialog on Mac unless...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 1, 2014 11:13 AM
I have an XE7 vanilla desktop C++ application with two buttons. One writes "Hello" to an edit box. The other button pops up a dialog just to see if the dialog works.

This works fine on Windows and on Mac except if "Link with runtime packages" is false. In that case the dialog box does not appear at all on the Mac and the program is stuck waiting on the user to click something they cannot see (cannot find either ... it's no where to be found).

FWIW someone of the Delphi forum tested this on Delphi XE7 and it worked fine. So this is either a problem with my installation/configuration or it's some kind of compiler bug. I get the same behaviour in XE6. I tried a few different Mac SDKs but 10.8.5 is my current one.

Here is the code.

#include <fmx.h>
#pragma hdrstop
 
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
   : TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
Edit1->Text = "Hello";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click(TObject *Sender)
{
int choice;
 
choice = MessageDlg("Do you want to save your changes?", TMsgDlgType::mtConfirmation,
TMsgDlgButtons() << TMsgDlgBtn::mbYes << TMsgDlgBtn::mbNo << TMsgDlgBtn::mbCancel, 0);
}
//---------------------------------------------------------------------------
Grant Beattie

Posts: 77
Registered: 11/29/01
Re: MessageDlg doesn't open dialog on Mac unless...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 2, 2014 10:15 AM   in response to: Grant Beattie in response to: Grant Beattie
Any chance someone can try this on their FM C++Builder XE7 for me? It's just a form and really a button that pops up a dialog box. Depending on whether runtime packages is true or not, on my machine it either works or hangs. This is for the Mac target. PC works fine either way.
John Frazier


Posts: 726
Registered: 2/17/00
Re: MessageDlg doesn't open dialog on Mac unless...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 3, 2014 2:19 PM   in response to: Grant Beattie in response to: Grant Beattie
Grant Beattie wrote:
This works fine on Windows and on Mac except if "Link with runtime packages" is false. In that case the dialog box does not appear at all on the Mac and the program is stuck waiting on the user to click something they cannot see (cannot find either ... it's no where to be found).

There isn't "Link with runtime packages" for C++ app, that is a "Delphi Project | Options" setting. What are the exact settings you mean? By default in a C++ app we have "Link with Dynamic RTL"(True) and "Link with the Delphi Runtime Library (rtl package)"(False). This works fine for me no matter what combo of settings I use. FTR I am on Mavericks and just updated my SDK to 10.9.5.
--
John Frazier (Embarcadero Newsgroup Admin)

Edited by: John Frazier on Oct 3, 2014 2:19 PM

Oh and this was XE7
Grant Beattie

Posts: 77
Registered: 11/29/01
Re: MessageDlg doesn't open dialog on Mac unless...  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 3, 2014 2:46 PM   in response to: John Frazier in response to: John Frazier
It looks like some overall thing down at the bottom

C++Builder XE7
Project > Options... > Runtime Packages > Link with runtime packages (for each target choice)

I also just noticed the one you are talking about
Project > Options... > C++ Linker > Link with dynamic RTL

I guess that gives me a few more permuations to try (they are both currently true so that I can get some work done).

Edited by: Grant Beattie on Oct 3, 2014 2:56 PM

OK I just set them both to false and most of the dll's go away, the "exe" got much larger of course but still no dialog boxes.

Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: MessageDlg doesn't open dialog on Mac unless... [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 3, 2014 3:38 PM   in response to: John Frazier in response to: John Frazier
John wrote:

There isn't "Link with runtime packages" for C++ app

Yes, there is:

Project > Options > Packages > Runtime Packages > "Link with runtime packages"

that is a "Delphi Project | Options" setting.

No, it is not specific to Delphi only.

--
Remy Lebeau (TeamB)
John Frazier


Posts: 726
Registered: 2/17/00
Re: MessageDlg doesn't open dialog on Mac unless... [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 3, 2014 3:52 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:

Yeah I realized right after I posted I was looking in wrong place, my bad.

I reproduced and it is crashing good. It even killed PAServer once. Don't know why yet. If you want to see all of the ugliness, hit "v" in PAServer to turn on verbose mode.
--
John Frazier (Embarcadero Newsgroup Admin)
John Frazier


Posts: 726
Registered: 2/17/00
Re: MessageDlg doesn't open dialog on Mac unless...
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 3, 2014 5:23 PM   in response to: Grant Beattie in response to: Grant Beattie
Grant Beattie wrote:

So the issue doesn't have anything to do with dialog boxes perse and that is merely a red herring. The issue is we don't support static linking on OSX.
--
John Frazier (Embarcadero Newsgroup Admin)
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02