We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now


Delphi bugs?

Matvey asked
Medium Priority
Last Modified: 2010-04-03
First I want to mention that you can have as many points as you want for this question (up to 200).

I'm having problems using ActiveXes with Delphi and it seems that these are Delphi bugs.
The library I'm using is the OCXes that come with WANG Imaging - It's free as an add-on for win95 and you can download it at http://www.eastmansoftware.com/products/imagingpro/instal95.htm
This library is for operating on images of different formats and theoretically it does what I want. Also I have to mention that it work very well with VB, and on the other hand very buggy with Delphi.

I try to use the method "TImageAdmin.Append", where "TImageAdmin" is "IMGADMIN.OCX". For me it will produce different errors depanding on Delphi version: With Delphi 3 the error message is '???????????????', but on the other hand with D2 the error message is a bit better: 'exception class EOIeError with message 'Illegal function call Bad optional parameter'. I must mention that exactly the same call, with the same optional parameters, works well with VB. Also: I don't want to post any optional parameters - Delphi makes them not optional when installing the ActiveX so I have to post them anyway! Is there a way to make them optional again - some settings I don't know?

Please, if you want to help me, the first thing is try it on your own machine so I'm sure it's not only my problem. -Do the ActiveXes work bad with Delphi - is it a known fact?

Send anything you find helpful also to bosism@netvision.net.il
Kind regards,
Watch Question

Matvey, can't help you with this one, but for looking if this is a bug and a solution to it, look at this page : http://www.dataweb.nl/~r.p.sterkenburg/bugsall.htm
Regards, Zif.


Hi Tom, thanks - great page, I didn't know about it.
Anyway, they only have one ActiveX bug registered. I don't really understand what they mean there, but I've tried theyr bug-fix and what happend is that D3 now behaves similar to D2, I mean ot produces the same message: 'exception class EOleException with message 'Illegal function call Bad optional parameter'
EOleException are found in the help, and as alwais tell you nothing.

Tom, maybe you can help me still: can you please try the same with your computer?

Hi Matvey,

 If I can help you just by trying it out on my computer, then I'll help offcourse. Just send me the code. And I'll try it out.

c.u. Tom.


The code is just two lines. As I mentioned works fine with VB:

  ImgAdmin1.Image := 'd:\temp\test1.tif';
  ImgAdmin1.Append('d:\temp\1.tif', 1, 1, 5, 2);

ImgAdmin is IMGADMIN.OCX. Help can be found on this in the WangOCXd.hlp

Big thanks!

Matvey, I'm going to try it out at home, so you've to wait a little bit. Sorry.

Hi Matvey, I was looking at the URL, but it references to a product Imaging Pro which you've to buy. Can you give me the URL where I can find more information of it? What does it install, where does it stands it's free ... Thanks.


No no, this page is just stupidly built so in the beginning I thought too that I have to buy it. So no, be sure it's free because it's an add-on for Windows made by WANG for MS.

Down in the page - do you see the red words? "English", "Dutch"... -So these are links. :) Click on them to download a self-extracting archive, just be sure you follow the instruction in the frame on the top: into a correctly named directory (the old DOS fashion - < 8 chars). Then when you extract the files out of it, run the Setup.exe that will install everything.
I must say that it's 2.5 MB. But there is a possibility that you already have it - it comes with lots of win95 versions. To check see if you have "Imaging" in the "Accesories" folder...

Anyway, the setup will copy the Imaging application that also uses the same OCXes I'm using (it installs the OCXes too).

The equivalent function in the Imaging aplication to the one I'm trying to call is menu\Page\Append. You can try it too...
It also installs a help file and a demo VB application. The application is in Windows/Wangsamp, and the help file is C:\WIN\HELP\WANGOCXD.HLP

I also send you a description file that is somehow not inclued in the download...

Well, enjoy :)
I think this thing is very useful, becuase it handles lots of graphics formats, supports scanner, converting, compression etc. But delphi has bugs too. Real shame that this is something that leaves me totlly stuck. I can concider making this with VB, but my application is very small - it even has no windows! -just some command line parameters and some lines of code to handle them using this stuff. I wouldn't want to make a 2MB setup program for that, and that what I'll have to do in case of using VB!

Thanks again!


I did it! I found it! Yeah! I won! I won!

I removed some parameter declarations from AdminLib_TLB (the Delphi generated file) and now it works! It goes in this patern now:

procedure TImgAdmin.Append(const Source: WideString; SourcePage, NumPages: Integer{; CompressionType, CompressionInfo: OleVariant});
  ControlInterface.Append(Source, SourcePage, NumPages{, CompressionType, CompressionInfo});

-See the {} ?

Thanks Tom, and I hope you will now fully enjoy these ActiveXes - I find them very very cool!

c u, and keep in touch
PS how is your new machine?

PS maybe you can help me with my new question about FAX?
Unlock this solution and get a sample of our free trial.
(No credit card required)


Tell me, vladika, do you read previous comments? That's almost exactly what I did - actually, I don't even need those parameters, they should be optional anyway. Maybe Delphi supports optional parameters?

Ă…hanks anyway. I'm glad someone got down to the root of the problem, so I think I'll accept your answere. Just after Odie sees this question...

Great Matvey! You did it! Good luck with it.
My new computer is great. I've a new one at my office and at home. The only bad thing is that I now finally recieve D3 while D4 is already on the market. Zif.

Yes, I read previous comments. I really was interested with this problem.
So, you can reject answer.


I'll accept the answere soon. I just want one guy to see this too...

cheers everybody!
PS maybe someeone can help me with my new question?



Sorry for the long pause - for got about this at all...

Anyway, big thanks again for everybody who commented this.
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.