To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
PHPBuilder.com  
 

 

Go Back   PHPBuilder.com > Misc Help > Windows Help

Windows Help Help with the Windows operating system

Reply
 
Thread Tools Rate Thread Display Modes
Old 08-09-2000, 04:09 AM   #1
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
Using COM object's with PHP?

Hi,

Is anybody familiar with how to use COM objects in PHP? I made a litle test code and everithing is seems to work fine, except when I trie to call function in COM object. Does anybody know how to do this?

Why I'm getting
"Warning: Invoke() failed: Type mismatch."
message when i try to call function in COM object???

What Am I doing wrong?

Simon

Here is the example code:

<?php
// Set the source and style sheet locations here
$root = "c:\inetpub\wwwroot\simple\\";

$sourceFile = $root."simple.xml";
$styleFile = $root."simple.xsl";

// Load the XML
$source = new COM( "Microsoft.XMLDOM" ) or die( "Cant read Microsoft.XMLDOM" );
$source->async = false;
$source->load( $sourceFile );

// Load the XSL
$style = new COM( "Microsoft.XMLDOM" ) or die( "Cant read Microsoft.XMLDOM" );
$style->async = false;
$style->load( $styleFile );

// set up the resulting document
$result = new COM( "Microsoft.XMLDOM" ) or die( "Cant read Microsoft.XMLDOM" );
$result->async = false;
$result->validateOnParse = true;

// parse results into a result DOM Document
//com_invoke( $source, "transformNodeToObject", $style, $result );
$source->transformNodeToObject( $style, $result );

echo $result;
?>
Anon is offline   Reply With Quote
Old 09-14-2000, 07:42 AM   #2
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using COM object's with PHP?

actually i am a biginner in php i am now able to enable allow_dcom directive in configuration please help regarding this topic i have seen this from phpinfo() function.
Anon is offline   Reply With Quote
Old 09-15-2000, 06:43 PM   #3
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
Destroying COM objects

I got badly burned by assuming that MS ASP pages destroyed COM objects created on a page. I am now experimenting with PHP and the person who got me started claims that PHP destroys all COM objects at the end of each page. Is this ABSOLUTELY 100% true?

As extra insurance, how do I explicitly destroy a COM object?

What I cannot afford is for COM objects to be left dangling in the system.

Thanks...
Anon is offline   Reply With Quote
Old 11-09-2000, 12:12 PM   #4
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Destroying COM objects

Hi,

I'm quite sure PHP does not automatically
destroy the COM-objects. [It didn't on
my system anyway.]


// Fredrik
Anon is offline   Reply With Quote
Old 05-17-2001, 05:33 AM   #5
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Using COM object's with PHP?

well i am myself foxed with the same problem!!

What i am trying to do is to create object of Microsoft.XMLDOM and then load an XML file and XSL file to display the results in the browser(in effect using XSL +XML at server)

the client side equivalent is attached to give you an idea.

Please let me know whether this is possible or not??
thanks

PS:
============================================

<body>
<script type="text/javascript">
// Load XML
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
xml.load("cd_catalog.xml")

// Load the XSL
var xsl = new ActiveXObject("Microsoft.XMLDOM")
xsl.async = false
xsl.load("cd_catalog.xsl")

// Transform
document.write(xml.transformNode(xsl))
</script>

</body>

Anon is offline   Reply With Quote
Old 07-23-2001, 05:34 AM   #6
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
RE: Destroying COM objects


So you can destroy an object

$myObj = null;


:-)
Anon is offline   Reply With Quote
Old 11-12-2001, 11:23 PM   #7
Anon
Senior Member
 
Join Date: Jun 2000
Posts: 65,386
count me in on the answer

I am having the same problem. If you find the solution please let me know, I will do the same. I can output the xml with "print($myXML->xml);" and if the document has a processing instruction I just get the text of the document. Even if I set the header to text/xml. The funny thing is methods like "$myXML->selectSingleNode('book')" seem to work fine, it's just transformNode that chokes??????
Anon is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT -4. The time now is 02:53 PM.






Acceptable Use Policy

internet.comMediabistrojusttechjobs.comGraphics.com

WebMediaBrands Corporate Info


Advertise | Newsletters | Feedback | Submit News

Legal Notices | Licensing | Permissions | Privacy Policy


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.