ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder
ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 TImageEnProc
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Bernhard

19 Posts

Posted - Feb 08 2021 :  06:21:37  Show Profile  Reply
Hi,

using Delphi, I can create an instance of TImageEnProc:
proc := TImageEnProc.CreateFromBitmap(bmp);
or
proc := TImageEnProc.create(nil);

How can I create an instance of TImageEnProc with C++? Everything I tried didn't work.

Thank you for any help
Bernhard

xequte

5869 Posts

Posted - Feb 08 2021 :  18:46:21  Show Profile  Reply
Hi Bernhard

It should be the same:

TImageEnProc proc = TImageEnProc->create(NULL);

Nigel
Xequte Software
www.imageen.com
Go to Top of Page

Bernhard

19 Posts

Posted - Feb 09 2021 :  01:53:48  Show Profile  Reply
Hi Nigel,
Thanks for the prompt reply.
Of course I tried this line and the compiler aborted with the error message:
Delphi-style classes must be allocated with 'new'

Then I tried
TImageEnProc *proc = new TImageEnProc;
This works with TIEBitmap, for example, but not with TImageEnProc. The compiler aborted with:
no matching constructor for initialization of 'Imageenproc::TImageEnProc'

Next I tried:
TImageEnProc *proc = new TImageEnProc(NULL);
Compiler refused work and responded: call to constructor of 'Imageenproc::TImageEnProc' is ambiguous

Now I've tried something else:
TIEBitmap *Quelle = new TIEBitmap;
TImageEnProc *proc = new TImageEnProc(Quelle);
And so it finally worked!

Should that be mentioned in the help for the class?
Go to Top of Page

xequte

5869 Posts

Posted - Feb 10 2021 :  23:23:45  Show Profile  Reply
Hi Bernhard

My C++ is not great, but I would have thought you'd need to pass a TComponent class, e.g.

TImageEnProc *proc = new TImageEnProc(Self);

Nigel
Xequte Software
www.imageen.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To: