RE: [PHP-WIN] RE: PHP4 & GIF Generation, I'm stuck!
| From: | Mikey | Date: | Tue, 11 Jul 2000 12:07:13 +0000 |
| Subject: | RE: [PHP-WIN] RE: PHP4 & GIF Generation, I'm stuck! | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-1014@lists.php.net to get a copy of this message | ||
I don't know if this helps you, it is a paragraph taken from "Developing ASP
Components" (O'Reilly):
"When a client wants to create an instance of a component and query for an
interface on that component, it must do two things. first, it must
initialise COM - call itwaking COM up - by calling a function named
CoInitialize or CoInitializeEx. CoInitialize takes one parameter, a value of
NULL, and CoInitializeEx takes two parameters, the first again being NULL
and the second containing a flag describing the thread's concurrency model.
Either of these functions is only called once on a thread and basically
initializes the COM library on that thread."
So, it would appear that your COM object is trying to re-initialize COM.
This in PHP3/CGI is no problem because the thread dies as soon as the script
finishes, however with ISAPI PHP4, the thread is still around to process
requests and already had the COM library initialised.
This is where my knowledge becomes supposition :-)
*If* this is the case, you may be able to use CoInitialiseEx with an
apartment or both threaded model - this may then execute it in the same
style as an ASP component which tries for both-threaded, then settles for
apartment-threaded if it has to.
Or, alternatively, run PHP4 as CGI...
Yours guessing quite a bit-ly,
Mikey
-----Original Message-----
From: Howard Cohodas [mailto:Howard.Cohodas@dkt.com]
Sent: 11 July 2000 12:22
To: Php-Windows
Subject: [PHP-WIN] RE: PHP4 & GIF Generation, I'm stuck!
Mark,
0. otf_GIF works with ASP and PHP3 and CGI applications without difficulty.
They continue to work after the PHP4 failure.
1. unset($id) had no effect.
2. Cannot test MSword example, Office not installed on server. Other
objects
have same result.
3. PHP seems to clean up well. Cannot find evidence of dll in memory after
execution.
4. We are C challenged here. Although not elegant, a command line version
could be built. It is a good idea for fallback, thanks.
5. Multiple simultaneous executions are permitted (refer to 0 above).
Howard A. Cohodas
Design Knowledge Technologies Inc.
Phone: (011)(330)492-9900
FAX: (011)(330)492-1100
otfGIF Encoder: http://www.dkt.com/otfGIF
-----Original Message-----
From: Nold, Mark [mailto:Mark.Nold@normandy.com.au]
Sent: Tuesday, July 11, 2000 4:47 AM
To: 'Howard Cohodas'; Php-Windows
Subject: [PHP-WIN] RE: PHP4 & GIF Generation, I'm stuck!
----------------------------------------------------------------------------
-----------------
Disclaimer: The information contained in this email is intended only for the
use of the person(s) to whom it is addressed and may be confidential or
contain legally privileged information. If you are not the intended
recipient you are hereby notified that any perusal, use, distribution,
copying or disclosure is strictly prohibited. If you have received this
email in error please immediately advise us by return email at
postmaster@normandy.com.au and delete the email document without making a
copy.
----------------------------------------------------------------------------
-----------------
Howard,
First of all cross-posting is probably not required in most situations.
Php-windows is probably the right place for anybody who cares about PHP +
COM.
I've never used com in PHP but it looks like the connection has been
initialised but never killed. Is there any sort of unload function for com
or your ActiveX control? Try unset($id) and see if that works.
Can you use other com objects repeatedly? Like the MS Word example? Can
other tools the otf_GIF com object repeatedly?
Is there away of tracing what OCX's are being used in memory? I seem to
remember some tool that came with VB years ago that allowed you to kill
specific .dll's in memory and maybe .vbx's but hey i know nothing about any
of this, and im just guessing.
Since you are from dkt.com i assume you are somehow involved in writing
otf_GIF why not just build a C app to do it on the command line? Deploy your
site with the command line option then go back to working on this problem.
Something like "CoInitialize has not been called" sounds like you need to
expressly state that more than one of these things can be in use at a
time... (Even if you did unset() it i would be concerned about simultaineous
users)
Just some guesses,
mn
-----Original Message-----
From: Howard Cohodas [mailto:Howard.Cohodas@dkt.com]
Sent: Tuesday, July 11, 2000 7:03 AM
To: Website-Talk; Php-Windows; Php-General; Php-Dev
Subject: PHP4 & GIF Generation, I'm stuck!
I'm out of things to try so I hope one of you has an idea. The only item
holding us back from deploying a php4 site we are working on is that we are
unable to get the Windows COM interface working.
Our Configuration..
OS - NT4 SP6a
PHP Version - 4.0.1pl2
HTTP Server - O'Reilly WebSite Pro 2.4.22
Code Snippet..
$id = new com("otf_GIF31.GIF_Encode");
print "Loaded otf_GIF Version {$id->Version}";
This code works perfectly the first time it is used after restarting the
http server.
The output is..
Loaded otf_GIF Version otf_GIF31 3.1.18.
After that the error message is..
Warning: Unable to obtain IDispatch interface for CLSID
{36D611A0-FAE1-11D1-AAEF-0000C0378AC3}: CoInitialize has not been called. in
D:\Web_Sites\Testing_PHP4\HTdocs\test_com.php4 on line 9
Loaded otf_GIF Version
TIA
Howard A. Cohodas
Design Knowledge Technologies Inc.
Phone: (011)(330)492-9900
FAX: (011)(330)492-1100
otfGIF Encoder: http://www.dkt.com/otfGIF
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-windows-unsubscribe@lists.php.net
For additional commands, e-mail: php-windows-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net