note 83895 added to function.com-load-typelib

From: Date: Tue, 17 Jun 2008 10:40:27 +0000
Subject: note 83895 added to function.com-load-typelib
Groups: php.notes 
Request: Send a blank email to php-notes+get-140528@lists.php.net to get a copy of this message
Some libraries load other libraries as part of there functionality. For example Crystal Reports Object Factory uses the CreateObject() method to create an instance of a Crystal Design RunTime Application. If you want to use constants defined in the newly loaded library, you will need to manually register the library. Even with com.autoregister_typelib set to true. <?php echo 'com.autoregister_typelib = ', ini_get('com.autoregister_typelib'), PHP_EOL; $o_CrObjectFactory = New COM('CrystalReports11.ObjectFactory.1'); $o_CrApplication = $o_CrObjectFactory->CreateObject("CrystalDesignRunTime.Application"); echo 'Will not be defined : ', crOpenReportByDefault, PHP_EOL; com_load_typelib('CrystalDesignRunTime.Application'); echo 'Will now be defined : ', crOpenReportByDefault, PHP_EOL; ?> outputs ... com.autoregister_typelib = 1 Will not be defined : Notice: Use of undefined constant crOpenReportByDefault - assumed 'crOpenReportByDefault' in C:\refl.php on line 8 crOpenReportByDefault Will now be defined : 0 ---- Server IP: 216.92.131.65 Probable Submitter: 80.194.75.66 ---- Manual Page -- http://www.php.net/manual/en/function.com-load-typelib.php Edit -- https://master.php.net/note/edit/83895 Del: integrated -- https://master.php.net/note/delete/83895/integrated Del: useless -- https://master.php.net/note/delete/83895/useless Del: bad code -- https://master.php.net/note/delete/83895/bad+code Del: spam -- https://master.php.net/note/delete/83895/spam Del: non-english -- https://master.php.net/note/delete/83895/non-english Del: in docs -- https://master.php.net/note/delete/83895/in+docs Del: other reasons-- https://master.php.net/note/delete/83895 Reject -- https://master.php.net/note/reject/83895 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#140528) next »