#native_company# #native_desc#
#native_cta#

Using .NET Assembly (Interoperability with COM) Page 6

By Jayesh Jain
on November 5, 2002

Examining the Code

First we shall create a COM object for the object we just installed and registered, as COM interop makes the .NET assembly look like COM objects we can use the same syntax as we use to create COM objects in PHP.

<?php

$MyObj 
= new COM ("phpclass.HealthRecord.patient");

?>



We shall now set the lmp property to a valid date, which would be used to calculate edd.

<?php

$MyObj
->lmp "05/08/2002";

?>



We shall now output the LMP property in human readable date format and shall also output the calculated EDD property to the browser.

<?php

echo "LMP : $MyObj->lmp";

echo 
"<br />EDD : $MyObj->edd";

?>



1
|
2
|
3
|
4
|
5
|
6
|
7
|
8