what's wrong?

This is a discussion on what's wrong? within the Windows Programming forums, part of the Platform Specific Boards category; I looked in the help... and tried to do like the example.. but it still wont compile... what's wrong with ...

  1. #1
    Registered User V1P3R V3N0M's Avatar
    Join Date
    Jan 2003
    Posts
    22

    Question what's wrong?

    I looked in the help... and tried to do like the example.. but it still wont compile... what's wrong with it?


    Code:
    void __fastcall TForm1::Button1Click(TObject *Sender)
    {
      TQRLabel **bob;
      int top = 100, left = 112;
    
      bob = new TQRLabel*;
      bob->Top = top;
      bob->Left = left;
      top = top + 25;
    }

    thx!
    vv

  2. #2
    Registered User
    Join Date
    Jun 2003
    Posts
    70

    code:-----------------------------------------------------------------------------void __fastcall TForm1::Button1Click(TObject *Sender)
    {
    TQRLabel **bob;
    int top = 100, left = 112;

    bob = new TQRLabel*;
    bob->Top = top;
    bob->Left = left;
    top = top + 25;
    }
    --------------------------------------------------------------------------------


    I don't know about TQRLabel...I assume it as a class. So in that way you can write your code in following manner

    void __fastcall TForm1::Button1Click(TObject *Sender)
    {
    TQRLabel **bob;
    int top = 100, left = 112;

    bob = &(new TQRLabel);
    (*bob)->Top = top;
    (*bob)->Left = left;
    top = top + 25;
    }
    Chintan R Naik

  3. #3
    King of the Internet Fahrenheit's Avatar
    Join Date
    Oct 2001
    Posts
    128
    I'm not sure you can __fastcall class members.

  4. #4
    Registered User
    Join Date
    Jun 2003
    Posts
    70
    Sorry w00tsoft, I can't understand what do you want to say ??
    Chintan R Naik

  5. #5
    Registered User V1P3R V3N0M's Avatar
    Join Date
    Jan 2003
    Posts
    22
    w00t.. it's not the class we're fastcallin' ... it's the buttonclick function



    cr_naik

    thx a lot! I'll try this.... btw a TQRLabel is a QuickReport label... just an object as any other...

    thx again

    VV

  6. #6
    Registered User V1P3R V3N0M's Avatar
    Join Date
    Jan 2003
    Posts
    22
    doh


    now it says...

    [C++ Error] Unit1.cpp(23): E2285 Could not find a match for 'TQRLabel::TQRLabel()'

    but I guess its not a big error.. but I don't know what to do ...

    vv

  7. #7
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Eh, I thought member functions had to be thiscall

  8. #8
    King of the Internet Fahrenheit's Avatar
    Join Date
    Oct 2001
    Posts
    128
    Originally posted by V1P3R V3N0M
    w00t.. it's not the class we're fastcallin' ... it's the buttonclick function
    I'm sorry, but your buttonclick function is apart of the class because you are using ::

    Also, Eibro is correct.

  9. #9
    Registered User V1P3R V3N0M's Avatar
    Join Date
    Jan 2003
    Posts
    22
    the builder writes it itself.... I guess a builder doesn't make errors... ..

  10. #10
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Originally posted by V1P3R V3N0M
    the builder writes it itself.... I guess a builder doesn't make errors... ..
    What were your initial errors?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 07-15-2004, 04:30 PM
  2. Debugging-Looking in the wrong places
    By JaWiB in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 11-03-2003, 10:50 PM
  3. Confused: What is wrong with void??
    By Machewy in forum C++ Programming
    Replies: 19
    Last Post: 04-15-2003, 01:40 PM
  4. God
    By datainjector in forum A Brief History of Cprogramming.com
    Replies: 746
    Last Post: 12-22-2002, 12:01 PM
  5. Whats wrong?
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 07-14-2002, 02:04 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21