Board index » delphi » BC++ Builder - error msgs

BC++ Builder - error msgs

Hello....

   I'm using BC++ Builder and I'm trying to use TBitmap and the Clipboard
and having little success - this worked easily in Delphi but I'm having
trouble with BCB...  Please respond via email if possible - aol's
newsgroup setup is pretty flaky.... <g>

Here's what I have now:
    Graphics::TBitmap*  Bmp;

    Bmp = new Graphics::TBitmap;
   // do some stuff
    Clipboard->Assign(Bmp);
    // do some stuff
    Image2->Picture->Assign(Clipboard);

   I  was getting the following error:

 TBitmap* BM;            
  -error - ambiguity between 'Graphics::TBitmap' and 'Windows::TBitmap'
 BM = new TBitmap:     ^^^^ same

   I assume I need to do Graphics::TBitmap*  ?

   I still get the following:

  Clipboard->Assign(BM);    
  -error- Pointer to structure require on left side of -> or ->*

  Image2->Picture->Assign(Clipboard);  
 -error- Cannot convert 'Clipbrd::TClipboard * (_fastcall*)()' to
'Classes::TPersistent*'
   and
Type mismatch in parameter 'Source' in call to '_fastcall                
                     Graphics::TPicture::Assign(Classes::TPersistent*)'

   The online help refers to 'the following example', but there is no
following example.....

  Thanks for any help.... Rich

 

Re:BC++ Builder - error msgs


[This followup was posted to comp.lang.pascal.delphi.misc and a copy was
sent to the cited author.]

In article <19970310073700.CAA12...@ladder01.news.aol.com>,
rps...@aol.com says...

Quote
> Hello....

>    I'm using BC++ Builder and I'm trying to use TBitmap and the Clipboard
> and having little success - this worked easily in Delphi but I'm having
> trouble with BCB...  Please respond via email if possible - aol's
> newsgroup setup is pretty flaky.... <g>

> Here's what I have now:
>     Graphics::TBitmap*  Bmp;

>     Bmp = new Graphics::TBitmap;
>    // do some stuff
>     Clipboard->Assign(Bmp);
>     // do some stuff
>     Image2->Picture->Assign(Clipboard);

>    I  was getting the following error:

>  TBitmap* BM;            
>   -error - ambiguity between 'Graphics::TBitmap' and 'Windows::TBitmap'
>  BM = new TBitmap:     ^^^^ same

>    I assume I need to do Graphics::TBitmap*  ?

>    I still get the following:

>   Clipboard->Assign(BM);    
>   -error- Pointer to structure require on left side of -> or ->*

>   Image2->Picture->Assign(Clipboard);  
>  -error- Cannot convert 'Clipbrd::TClipboard * (_fastcall*)()' to
> 'Classes::TPersistent*'
>    and
> Type mismatch in parameter 'Source' in call to '_fastcall                
>                      Graphics::TPicture::Assign(Classes::TPersistent*)'

>    The online help refers to 'the following example', but there is no
> following example.....

>   Thanks for any help.... Rich

The variable Clipboard is actually the return value of the function
Clipboard(). Try substituting Clipboard() for Clipboard everywhere in
your example. I haven't checked to see if you're having any other
problems, but that should take care of the big one.

I don't have Delphi in front of me, and I'm too lazy to open up the VCL
files, but I'm guessing that there's no change from Delphi to BCB. It's
just going to take you awhile to get used to / refresh you memory about
making function calls in C. You get so used to not using parens with
Pascal, that you forget to use them in C. I know I do.
--

Richard Porter
===
To respond by email, remove leading zeros from
"From" Field, or try richa...@calweb.com

1

1

1

Other Threads