Solved

Delphi bugs?

Posted on 1998-06-23
14
496 Views
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,
Matvey
0
Comment
Question by:Matvey
  • 7
  • 5
  • 2
14 Comments
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355401
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.
0
 
LVL 3

Author Comment

by:Matvey
ID: 1355402
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?
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355403
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.
0
 
LVL 3

Author Comment

by:Matvey
ID: 1355404
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!
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355405
Matvey, I'm going to try it out at home, so you've to wait a little bit. Sorry.
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355406
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.
0
 
LVL 3

Author Comment

by:Matvey
ID: 1355407
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!
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 3

Author Comment

by:Matvey
ID: 1355408
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});
begin
  ControlInterface.Append(Source, SourcePage, NumPages{, CompressionType, CompressionInfo});
end;

-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?
0
 
LVL 3

Accepted Solution

by:
vladika earned 50 total points
ID: 1355409
Hi Matvey!

I compared code which produce Delphi and VB.
In the VB code type of CompressionType is varSmallInt
In the Delphi code type of CompressionType is varInteger

So if you want use optional parameters then you can
modify AdminLib_TLB as
procedure TImgAdmin.Append(const Source: WideString; SourcePage, NumPages: Integer; CompressionType, CompressionInfo: OleVariant);
begin
  ControlInterface.Append(Source, SourcePage, NumPages,
    VarAsType(CompressionType, varSmallInt),
    VarAsType(CompressionInfo, varSmallInt));
end;

So. Delphi has not bug, It's ImgAdmin OCX problem.


0
 
LVL 3

Author Comment

by:Matvey
ID: 1355410
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...
0
 
LVL 8

Expert Comment

by:ZifNab
ID: 1355411
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.
0
 
LVL 3

Expert Comment

by:vladika
ID: 1355412
Yes, I read previous comments. I really was interested with this problem.
So, you can reject answer.

0
 
LVL 3

Author Comment

by:Matvey
ID: 1355413
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?

http://www.experts-exchange.com/Q.10059744
0
 
LVL 3

Author Comment

by:Matvey
ID: 1355414
Sorry for the long pause - for got about this at all...

Anyway, big thanks again for everybody who commented this.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now