#1
  1. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12

    undefined symbol problem in BCB V6.


    I am trying to create a function that is invoked when a user closes a form. The function should put a message up on the screen asking if the user really wishes to close (yes, no or cancel). I think the problem may be that i am missing a header file or some other simple thing.

    My code is:

    TMessageButton Option;
    TMessageButtons msgButtons;
    msgButtons << smbYes << smbNo << smbCancel;
    Action = caFree;
    if(ClientDataSet1->State == dsEdit || ClientDataSet1->State == dsInsert)
    {
    ClientDataSet1->Post();
    }
    if(ClientDataSet1->ChangeCount > 0)
    {
    Option = Application->MessageBox("You have pending updates.
    Do you want to write them to the database?",
    "Pending Updates", msgButtons, smsWarning, smbYes, smbNo);
    if(Option == smbYes)
    {
    ClientDataSet1->ApplyUpdates(-1);
    }
    else
    if(Option == smbCancel)
    {
    Action = caNone;
    }
    }


    The error says that TMessage Button is an undefined symbol...do i have a definition missing somewhere or what?!

    All help appreciated.
    -----------------------------------------------------------
    4dr14n
  2. #2
  3. Bad Andy
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    OH
    Posts
    275
    Rep Power
    12
    I beleive you meant to use message dialog. You would want something like:

    MessageDlg("Are you sure you want to exit?", mtConfirmation, TMsgDlgButtons() << mbYes << mbNo << mbCancel, 0)
  4. #3
  5. Huh?
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2003
    Location
    Scotland, UK
    Posts
    223
    Rep Power
    12
    yip...you're right. i did!

    Thanks for that! I had realised that was the command i needed but was unsure of the syntax...thanx for the example...much appreciated
    -----------------------------------------------------------
    4dr14n

IMN logo majestic logo threadwatch logo seochat tools logo