ActiveX Components?

Not for 'how-to' coding questions but PHP theory instead, this forum is here for those of us who wish to learn about design aspects of programming with PHP.

Moderator: General Moderators

Post Reply
Stoneguard
Forum Contributor
Posts: 101
Joined: Wed Aug 13, 2003 9:02 pm
Location: USA

ActiveX Components?

Post by Stoneguard »

Ok, this is a bit of a tricky situation, and I am not sure if a asolution even exists. Basically, I have an ActiveX control which provides a link into a specific type of file. This control also has a COM object which I can implement in PHP.

One of the functions within the control actually renders a drawing from the file into the ActiveX Component. The function returns a success code in PHP, but I am unsure what it has drawn or where, since there is no actual output on the server side (web based, obviously).

Does anyone know of a way to define a workspace within PHP where rendered information can then be captured and put into a bitmap or printer object?
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

hmm.. I really dont know anything about how Bill Gates Web Servers do stuff, but as far as apache goes, unless specific (physical or pipe) file is mentioned all produced data goes to stdout (and/or stderr).. So if the Bill-Gates-Com/Active-X renders something that is not sent to stdout in an image format I dont think it belongs on a web server?

If it writes directly to videomem or some other buffer I guess you need to capture this buffer... I dont know what you are working on, but are you sure imlib and gd couldnt do the job?
Stoneguard
Forum Contributor
Posts: 101
Joined: Wed Aug 13, 2003 9:02 pm
Location: USA

Post by Stoneguard »

Unfortunately I am having to deal with 3rd party software and file formats which I do not have the structure to (nor the time to figure it out at this point).

I believe the ActiveX component is built on a VB PictureBox ( though I am not 100% positive).
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

Hmmmm - have you tried building a script that does nothing but call the COM component, add a http header for the correct content type,
binary write the results, and set an image tag equal to this helper script on another page? Just a thought...
User avatar
Stoker
Forum Regular
Posts: 782
Joined: Thu Jan 23, 2003 9:45 pm
Location: SWNY
Contact:

Post by Stoker »

..or if that doesnt work, how do you do it with IIS/ASP? Just build an executable that sends the result to stdout and call this from PHP..
Stoneguard
Forum Contributor
Posts: 101
Joined: Wed Aug 13, 2003 9:02 pm
Location: USA

Post by Stoneguard »

Heh, I haven't even figured out exactly how to do it in ASP. I could write my own activeX control to print the rendered image to a file and then convert it to pdf, I think.

I like fractal's thoughts, so I am going to see if I can work with that, not sure if I will have any success though.

Thanks for the input, guys!
fractalvibes
Forum Contributor
Posts: 335
Joined: Thu Sep 26, 2002 6:14 pm
Location: Waco, Texas

Post by fractalvibes »

With ASP there is no concept of stdout, really. stdout would be just the html page produced and any images, etc. What exactly does this COM component produce - i.e. it returns something - a jpg, a pdf, an excel file - something! I typically have a ASP script that serves as a media sever i.e.
<img src='MediaServer.asp?id=3564'>
but can be used for just about anything, so long as you know the content-type (MIME TYPE). Same principle should apply to PHP.

fv
Stoneguard
Forum Contributor
Posts: 101
Joined: Wed Aug 13, 2003 9:02 pm
Location: USA

Post by Stoneguard »

My whole delimna is that the component is actually a Control, not a COM component. It can be called through the COM layer, but I believe it inherits from the PictureBox control.

Within VB itself, I have to set up a size for the control and the rendered image is sent directly to the Form on which the component sits. It does not ever return any type of stream with the image in it. The original owners of the code have locked it out tight from the security perspective so that you have to own a physical key (USB port adapter) to access each level of functions.

So, my thought was either to built my own wrapper around the control and try and somehow pull in the image info or to directly call the component and try and capture the rendering. I have not been successful yet and have pretty much set it aside to accomplish some more important things at the moment.

If you have any more suggestions or some code specifics, please let me know!
Post Reply