Re: [PHP] COM - Assigning to method.
On 15 July 2013 16:27, Andrew Ballard aball...@gmail.com wrote: On Mon, Jul 15, 2013 at 4:21 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Andrew Thanks for this. But I'm still getting errors. I think I need to explain a bit more. Unfortunately there isn't a PHP API for this application I'm trying to interact with, my goal really is to be able to expose the COM functionality over a web-service such as SOAP so I can use it in a CMS. The application I'm trying to integrate with is Blackbuad's Raiser's Edge - API documentation here: https://www.blackbaud.com/files/support/guides/re7ent/api.pdf I think part of the problem is that the field names are also represented by an integer. So to get data out I would do: $oBank-Fields(22); // which maps to BANK_fld_BRANCH_NAME. When I do: $oBank-22 = 'blah blah'; I get an error because a property can't be numeric, it has to start as alpha character. If I use: $oBank-BANK_fld_BRANCH_NAME = 'blah blah blah'; I get the following error: Fatal error: Uncaught exception 'com_exception' with message 'Unable to lookup `BANK_fld_BRANCH_NAME': Unknown name. I've also tried using your Value property returned by Fields(): $oBank-Fields(22)-Value = 'Blah Blah blah blah'; Which I then get: PHP Warning: Creating default object from empty value in [C:\Users] Fatal error: Call to undefined method variant::Save() Soo seems nearly impossible to implement a safe way to write to the COM API. At the moment, I'm still in the scoping/prototype stage of my project, so I'm beginning to think that using this COM API for this project is a no-go, which is unfortunate. I'm also guessing even if we did implement this API, exposing it as a Web Service is going to be tricky for performance sake (given that I've read that COM doesn't multithread very well??) Many Thanks Adam. It's definitely possible to do, once you figure out the syntax you need for this object. I'm guessing you must have gotten past the $oBank-Init() method call without issues. What happens if you just use this for the value assignment? $oBank-Fields(BANK_fld_ACCOUNT_NAME) = Test account; $oBank-Fields(BANK_fld_ACCOUNT_NO) = 12345; $oBank-Fields(BANK_fld_BANK) = Bank of the Nation; $oBank-Fields(BANK_fld_BRANCH_NAME) = State Street Branch; It also looks like you're getting errors from the call to $oBank-Save() saying that the method is not defined. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php I used to use PHP+Windows+COM+Crystal Reports. I'm in the middle of something else, but a few things. Does the library you are using have a valid COM interface? Some of the .NET libraries simply don't. The last version of CR that was COM enabled was CR XI R 2. After that it was .NET and Java only. No COM. Having said that, I never got around to using http://uk1.php.net/manual/en/class.dotnet.php, so I don't know how this all worked. From memory the DOTNET layer of PHP was just a wrapper around COM and still required COM exposure in the lib. I think. Use a TypeLib Explorer to see exactly what interface is available - from memory, the right tool is all you need. I was able to code anything I needed with Crystal Reports. There is also a PHP function http://uk1.php.net/manual/en/function.com-load-typelib.php which I used to allow the various constants within the typelib to be exposed and usable within PHP. And also look at http://uk1.php.net/manual/en/function.com-print-typeinfo.php and the user notes. Not used it but bucket loads of info is a good thing to see normally. -- Richard Quadling Twitter : @RQuadling
Re: [PHP] COM - Assigning to method.
Hi Andrew Thanks for this. But I'm still getting errors. I think I need to explain a bit more. Unfortunately there isn't a PHP API for this application I'm trying to interact with, my goal really is to be able to expose the COM functionality over a web-service such as SOAP so I can use it in a CMS. The application I'm trying to integrate with is Blackbuad's Raiser's Edge - API documentation here: https://www.blackbaud.com/files/support/guides/re7ent/api.pdf I think part of the problem is that the field names are also represented by an integer. So to get data out I would do: $oBank-Fields(22); // which maps to BANK_fld_BRANCH_NAME. When I do: $oBank-22 = 'blah blah'; I get an error because a property can't be numeric, it has to start as alpha character. If I use: $oBank-BANK_fld_BRANCH_NAME = 'blah blah blah'; I get the following error: Fatal error: Uncaught exception 'com_exception' with message 'Unable to lookup `BANK_fld_BRANCH_NAME': Unknown name. I've also tried using your Value property returned by Fields(): $oBank-Fields(22)-Value = 'Blah Blah blah blah'; Which I then get: PHP Warning: Creating default object from empty value in [C:\Users] Fatal error: Call to undefined method variant::Save() Soo seems nearly impossible to implement a safe way to write to the COM API. At the moment, I'm still in the scoping/prototype stage of my project, so I'm beginning to think that using this COM API for this project is a no-go, which is unfortunate. I'm also guessing even if we did implement this API, exposing it as a Web Service is going to be tricky for performance sake (given that I've read that COM doesn't multithread very well??) Many Thanks Adam. On 14 July 2013 22:16, Andrew Ballard aball...@gmail.com wrote: On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com wrote: Richard - I've tried that I get an error about it not being defined as property of the object. Andrew - do you mean try using the method Richard has shown? Cheers Adam. On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote: On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote: On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Guys/Gals, I'm doing some integration work with a COM API and according to their documentation to save data in the API, you have to assign to the method. This is their example in Visual Basic: - Set oBank = New CBank oBank.Init Application.SessionContext With oBank .Fields(BANK_fld_ACCOUNT_NAME) = Test account .Fields(BANK_fld_ACCOUNT_NO) = 12345 .Fields(BANK_fld_BANK) = Bank of the Nation .Fields(BANK_fld_BRANCH_NAME) = State Street Branch End With oBank.Save - Obviously in PHP is isn't possible to assign to a method in this way (thats what parameters are for!) So I'm at a bit of a loose end. I'm wondering if anyone else has come across this? Or am I missing something obvious in PHP's implementation of the COM that allows me to work around this? My PHP Code is looks like this: - $API = new COM('API7.API'); $API-Init($SerialNo, $Login, '', 1, '', 1); $API-SignOutOnTerminate = True; $Record = new COM(Data.Record); $Record-Init($API-SessionContext); $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work - I've also tried (below) but the API says wrong number of parameters $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account'); I've also tried something crazy like this (below) but that overwrites the $Record object. $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME'); $_R = 'Test Account'; Any ideas? Is it possible? Many Thanks Adam Nicholls That example isn't assigning values to method return value. Fields is a collection of ADO Field objects. The default property of a Field object is its Value property, so the shorthand is simply assigning the values of the variables to the value of each field in a record within a Recordset. Andrew So .. $oBank-BANK_fld_ACCOUNT_NAME = Test account; sort of thing. -- Richard Quadling Twitter : @RQuadling -- Adam Nicholls Richard has the general idea correct, but as I recall it is a little more involved because it's COM. I've never done that much with COM in PHP because it was always such a pain. The example you posted probably used to require com_set() in PHP 4, although it looks like that has been deprecated in favor of a more typical OO syntax in PHP 5. Is there any
Re: [PHP] COM - Assigning to method.
Hello, did you tried var_dump or print_r the $oBank object to see his structure ? Also you can try: $BANK_fld_BRANCH_NAME = 22; $oBank-$BANK_fld_BRANCH_NAME = 'something'; Premek. On Mon, 15 Jul 2013 10:21:48 +0200, Adam Nicholls inkysp...@gmail.com wrote: Hi Andrew Thanks for this. But I'm still getting errors. I think I need to explain a bit more. Unfortunately there isn't a PHP API for this application I'm trying to interact with, my goal really is to be able to expose the COM functionality over a web-service such as SOAP so I can use it in a CMS. The application I'm trying to integrate with is Blackbuad's Raiser's Edge - API documentation here: https://www.blackbaud.com/files/support/guides/re7ent/api.pdf I think part of the problem is that the field names are also represented by an integer. So to get data out I would do: $oBank-Fields(22); // which maps to BANK_fld_BRANCH_NAME. When I do: $oBank-22 = 'blah blah'; I get an error because a property can't be numeric, it has to start as alpha character. If I use: $oBank-BANK_fld_BRANCH_NAME = 'blah blah blah'; I get the following error: Fatal error: Uncaught exception 'com_exception' with message 'Unable to lookup `BANK_fld_BRANCH_NAME': Unknown name. I've also tried using your Value property returned by Fields(): $oBank-Fields(22)-Value = 'Blah Blah blah blah'; Which I then get: PHP Warning: Creating default object from empty value in [C:\Users] Fatal error: Call to undefined method variant::Save() Soo seems nearly impossible to implement a safe way to write to the COM API. At the moment, I'm still in the scoping/prototype stage of my project, so I'm beginning to think that using this COM API for this project is a no-go, which is unfortunate. I'm also guessing even if we did implement this API, exposing it as a Web Service is going to be tricky for performance sake (given that I've read that COM doesn't multithread very well??) Many Thanks Adam. On 14 July 2013 22:16, Andrew Ballard aball...@gmail.com wrote: On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com wrote: Richard - I've tried that I get an error about it not being defined as property of the object. Andrew - do you mean try using the method Richard has shown? Cheers Adam. On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote: On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote: On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Guys/Gals, I'm doing some integration work with a COM API and according to their documentation to save data in the API, you have to assign to the method. This is their example in Visual Basic: - Set oBank = New CBank oBank.Init Application.SessionContext With oBank .Fields(BANK_fld_ACCOUNT_NAME) = Test account .Fields(BANK_fld_ACCOUNT_NO) = 12345 .Fields(BANK_fld_BANK) = Bank of the Nation .Fields(BANK_fld_BRANCH_NAME) = State Street Branch End With oBank.Save - Obviously in PHP is isn't possible to assign to a method in this way (thats what parameters are for!) So I'm at a bit of a loose end. I'm wondering if anyone else has come across this? Or am I missing something obvious in PHP's implementation of the COM that allows me to work around this? My PHP Code is looks like this: - $API = new COM('API7.API'); $API-Init($SerialNo, $Login, '', 1, '', 1); $API-SignOutOnTerminate = True; $Record = new COM(Data.Record); $Record-Init($API-SessionContext); $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work - I've also tried (below) but the API says wrong number of parameters $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account'); I've also tried something crazy like this (below) but that overwrites the $Record object. $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME'); $_R = 'Test Account'; Any ideas? Is it possible? Many Thanks Adam Nicholls That example isn't assigning values to method return value. Fields is a collection of ADO Field objects. The default property of a Field object is its Value property, so the shorthand is simply assigning the values of the variables to the value of each field in a record within a Recordset. Andrew So .. $oBank-BANK_fld_ACCOUNT_NAME = Test account; sort of thing. -- Richard Quadling Twitter : @RQuadling -- Adam Nicholls Richard has the general idea correct, but as I recall it is a little more involved because it's COM. I've never done that much with COM in
Re: [PHP] COM - Assigning to method.
On Mon, Jul 15, 2013 at 4:21 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Andrew Thanks for this. But I'm still getting errors. I think I need to explain a bit more. Unfortunately there isn't a PHP API for this application I'm trying to interact with, my goal really is to be able to expose the COM functionality over a web-service such as SOAP so I can use it in a CMS. The application I'm trying to integrate with is Blackbuad's Raiser's Edge - API documentation here: https://www.blackbaud.com/files/support/guides/re7ent/api.pdf I think part of the problem is that the field names are also represented by an integer. So to get data out I would do: $oBank-Fields(22); // which maps to BANK_fld_BRANCH_NAME. When I do: $oBank-22 = 'blah blah'; I get an error because a property can't be numeric, it has to start as alpha character. If I use: $oBank-BANK_fld_BRANCH_NAME = 'blah blah blah'; I get the following error: Fatal error: Uncaught exception 'com_exception' with message 'Unable to lookup `BANK_fld_BRANCH_NAME': Unknown name. I've also tried using your Value property returned by Fields(): $oBank-Fields(22)-Value = 'Blah Blah blah blah'; Which I then get: PHP Warning: Creating default object from empty value in [C:\Users] Fatal error: Call to undefined method variant::Save() Soo seems nearly impossible to implement a safe way to write to the COM API. At the moment, I'm still in the scoping/prototype stage of my project, so I'm beginning to think that using this COM API for this project is a no-go, which is unfortunate. I'm also guessing even if we did implement this API, exposing it as a Web Service is going to be tricky for performance sake (given that I've read that COM doesn't multithread very well??) Many Thanks Adam. It's definitely possible to do, once you figure out the syntax you need for this object. I'm guessing you must have gotten past the $oBank-Init() method call without issues. What happens if you just use this for the value assignment? $oBank-Fields(BANK_fld_ACCOUNT_NAME) = Test account; $oBank-Fields(BANK_fld_ACCOUNT_NO) = 12345; $oBank-Fields(BANK_fld_BANK) = Bank of the Nation; $oBank-Fields(BANK_fld_BRANCH_NAME) = State Street Branch; It also looks like you're getting errors from the call to $oBank-Save() saying that the method is not defined. Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM - Assigning to method.
Richard - I've tried that I get an error about it not being defined as property of the object. Andrew - do you mean try using the method Richard has shown? Cheers Adam. On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote: On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote: On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Guys/Gals, I'm doing some integration work with a COM API and according to their documentation to save data in the API, you have to assign to the method. This is their example in Visual Basic: - Set oBank = New CBank oBank.Init Application.SessionContext With oBank .Fields(BANK_fld_ACCOUNT_NAME) = Test account .Fields(BANK_fld_ACCOUNT_NO) = 12345 .Fields(BANK_fld_BANK) = Bank of the Nation .Fields(BANK_fld_BRANCH_NAME) = State Street Branch End With oBank.Save - Obviously in PHP is isn't possible to assign to a method in this way (thats what parameters are for!) So I'm at a bit of a loose end. I'm wondering if anyone else has come across this? Or am I missing something obvious in PHP's implementation of the COM that allows me to work around this? My PHP Code is looks like this: - $API = new COM('API7.API'); $API-Init($SerialNo, $Login, '', 1, '', 1); $API-SignOutOnTerminate = True; $Record = new COM(Data.Record); $Record-Init($API-SessionContext); $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work - I've also tried (below) but the API says wrong number of parameters $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account'); I've also tried something crazy like this (below) but that overwrites the $Record object. $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME'); $_R = 'Test Account'; Any ideas? Is it possible? Many Thanks Adam Nicholls That example isn't assigning values to method return value. Fields is a collection of ADO Field objects. The default property of a Field object is its Value property, so the shorthand is simply assigning the values of the variables to the value of each field in a record within a Recordset. Andrew So .. $oBank-BANK_fld_ACCOUNT_NAME = Test account; sort of thing. -- Richard Quadling Twitter : @RQuadling -- Adam Nicholls -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM - Assigning to method.
On Sun, Jul 14, 2013 at 3:18 PM, Adam Nicholls inkysp...@gmail.com wrote: Richard - I've tried that I get an error about it not being defined as property of the object. Andrew - do you mean try using the method Richard has shown? Cheers Adam. On 13 July 2013 17:11, Richard Quadling rquadl...@gmail.com wrote: On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote: On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Guys/Gals, I'm doing some integration work with a COM API and according to their documentation to save data in the API, you have to assign to the method. This is their example in Visual Basic: - Set oBank = New CBank oBank.Init Application.SessionContext With oBank .Fields(BANK_fld_ACCOUNT_NAME) = Test account .Fields(BANK_fld_ACCOUNT_NO) = 12345 .Fields(BANK_fld_BANK) = Bank of the Nation .Fields(BANK_fld_BRANCH_NAME) = State Street Branch End With oBank.Save - Obviously in PHP is isn't possible to assign to a method in this way (thats what parameters are for!) So I'm at a bit of a loose end. I'm wondering if anyone else has come across this? Or am I missing something obvious in PHP's implementation of the COM that allows me to work around this? My PHP Code is looks like this: - $API = new COM('API7.API'); $API-Init($SerialNo, $Login, '', 1, '', 1); $API-SignOutOnTerminate = True; $Record = new COM(Data.Record); $Record-Init($API-SessionContext); $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work - I've also tried (below) but the API says wrong number of parameters $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account'); I've also tried something crazy like this (below) but that overwrites the $Record object. $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME'); $_R = 'Test Account'; Any ideas? Is it possible? Many Thanks Adam Nicholls That example isn't assigning values to method return value. Fields is a collection of ADO Field objects. The default property of a Field object is its Value property, so the shorthand is simply assigning the values of the variables to the value of each field in a record within a Recordset. Andrew So .. $oBank-BANK_fld_ACCOUNT_NAME = Test account; sort of thing. -- Richard Quadling Twitter : @RQuadling -- Adam Nicholls Richard has the general idea correct, but as I recall it is a little more involved because it's COM. I've never done that much with COM in PHP because it was always such a pain. The example you posted probably used to require com_set() in PHP 4, although it looks like that has been deprecated in favor of a more typical OO syntax in PHP 5. Is there any chance there is a PHP version of the library that you can work with to avoid COM? If not, hopefully what follows will help start you on the right direction. A more explicit version of your original VBScript example looks like this: Set oBank = New CBank oBank.Init Application.SessionContext Set oField = oBank.Fields(BANK_fld_ACCOUNT_NAME) oField.Value = Test account Set oField = oBank.Fields(BANK_fld_ACCOUNT_NO) oField.Value = 12345 Set oField = oBank.Fields(BANK_fld_BANK) oField.Value = Bank of the Nation Set oField = oBank.Fields(BANK_fld_BRANCH_NAME) oField.Value = State Street Branch oBank.Save I'm not familiar with your CBank COM class, but the rest of it looks like it is similar to the COM('ADODB.Recordset'). If so, a rough translation of your original example should resemble this: ?php // I'm not familiar with this object, so I'm guessing on the call to instantiate it here. $oBank = new COM('CBank'); /** Application.SessionContext in the original refers to an object that is global to every request in an application. PHP does not have such a global registry, so I'm not sure where you're $config needs to come from. */ $oBank-Init($config); /** I am assuming that BANK_fld_ACCOUNT_NAME and such are constant names that were already defined with the names of the actual column names in a recordset returned by $oBank. */ $oBank-Fields(BANK_fld_ACCOUNT_NAME)-Value = Test account; $oBank-Fields(BANK_fld_ACCOUNT_NO)-Value = 12345; $oBank-Fields(BANK_fld_BANK)-Value = Bank of the Nation; $oBank-Fields(BANK_fld_BRANCH_NAME)-Value = State Street Branch; $oBank-Save(); ? I don't know if you could leave out the -Value part of the syntax in PHP like you can in the VBScript example you posted. If so, then Richard's syntax would have been pretty
Re: [PHP] COM - Assigning to method.
On 13 July 2013 01:24, Andrew Ballard aball...@gmail.com wrote: On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Guys/Gals, I'm doing some integration work with a COM API and according to their documentation to save data in the API, you have to assign to the method. This is their example in Visual Basic: - Set oBank = New CBank oBank.Init Application.SessionContext With oBank .Fields(BANK_fld_ACCOUNT_NAME) = Test account .Fields(BANK_fld_ACCOUNT_NO) = 12345 .Fields(BANK_fld_BANK) = Bank of the Nation .Fields(BANK_fld_BRANCH_NAME) = State Street Branch End With oBank.Save - Obviously in PHP is isn't possible to assign to a method in this way (thats what parameters are for!) So I'm at a bit of a loose end. I'm wondering if anyone else has come across this? Or am I missing something obvious in PHP's implementation of the COM that allows me to work around this? My PHP Code is looks like this: - $API = new COM('API7.API'); $API-Init($SerialNo, $Login, '', 1, '', 1); $API-SignOutOnTerminate = True; $Record = new COM(Data.Record); $Record-Init($API-SessionContext); $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work - I've also tried (below) but the API says wrong number of parameters $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account'); I've also tried something crazy like this (below) but that overwrites the $Record object. $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME'); $_R = 'Test Account'; Any ideas? Is it possible? Many Thanks Adam Nicholls That example isn't assigning values to method return value. Fields is a collection of ADO Field objects. The default property of a Field object is its Value property, so the shorthand is simply assigning the values of the variables to the value of each field in a record within a Recordset. Andrew So .. $oBank-BANK_fld_ACCOUNT_NAME = Test account; sort of thing. -- Richard Quadling Twitter : @RQuadling
[PHP] COM - Assigning to method.
Hi Guys/Gals, I'm doing some integration work with a COM API and according to their documentation to save data in the API, you have to assign to the method. This is their example in Visual Basic: - Set oBank = New CBank oBank.Init Application.SessionContext With oBank .Fields(BANK_fld_ACCOUNT_NAME) = Test account .Fields(BANK_fld_ACCOUNT_NO) = 12345 .Fields(BANK_fld_BANK) = Bank of the Nation .Fields(BANK_fld_BRANCH_NAME) = State Street Branch End With oBank.Save - Obviously in PHP is isn't possible to assign to a method in this way (thats what parameters are for!) So I'm at a bit of a loose end. I'm wondering if anyone else has come across this? Or am I missing something obvious in PHP's implementation of the COM that allows me to work around this? My PHP Code is looks like this: - $API = new COM('API7.API'); $API-Init($SerialNo, $Login, '', 1, '', 1); $API-SignOutOnTerminate = True; $Record = new COM(Data.Record); $Record-Init($API-SessionContext); $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work - I've also tried (below) but the API says wrong number of parameters $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account'); I've also tried something crazy like this (below) but that overwrites the $Record object. $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME'); $_R = 'Test Account'; Any ideas? Is it possible? Many Thanks Adam Nicholls -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM - Assigning to method.
On Jul 12, 2013 4:53 AM, Adam Nicholls inkysp...@gmail.com wrote: Hi Guys/Gals, I'm doing some integration work with a COM API and according to their documentation to save data in the API, you have to assign to the method. This is their example in Visual Basic: - Set oBank = New CBank oBank.Init Application.SessionContext With oBank .Fields(BANK_fld_ACCOUNT_NAME) = Test account .Fields(BANK_fld_ACCOUNT_NO) = 12345 .Fields(BANK_fld_BANK) = Bank of the Nation .Fields(BANK_fld_BRANCH_NAME) = State Street Branch End With oBank.Save - Obviously in PHP is isn't possible to assign to a method in this way (thats what parameters are for!) So I'm at a bit of a loose end. I'm wondering if anyone else has come across this? Or am I missing something obvious in PHP's implementation of the COM that allows me to work around this? My PHP Code is looks like this: - $API = new COM('API7.API'); $API-Init($SerialNo, $Login, '', 1, '', 1); $API-SignOutOnTerminate = True; $Record = new COM(Data.Record); $Record-Init($API-SessionContext); $Record-Fields('BANK_fld_ACCOUNT_NAME') = 'Test Account';//doesn't work - I've also tried (below) but the API says wrong number of parameters $Record-Fields('BANK_fld_ACCOUNT_NAME', 'Test Account'); I've also tried something crazy like this (below) but that overwrites the $Record object. $_R = $Record-Fields('BANK_fld_ACCOUNT_NAME'); $_R = 'Test Account'; Any ideas? Is it possible? Many Thanks Adam Nicholls That example isn't assigning values to method return value. Fields is a collection of ADO Field objects. The default property of a Field object is its Value property, so the shorthand is simply assigning the values of the variables to the value of each field in a record within a Recordset. Andrew
[PHP] COM/DCOM
Hello, I'm trying to write a few scripts to help automate some Windows administration tasks. One of these is to add people to groups on different networked machines. I've written something like the following: ?php $computer = TestComputer; $groupName = TestGroup; $server_config = array('Server' = TestComputer' , 'Username' = 'TestUser' , 'Password' = 'TestPass'); // list all current group members $domainObject = new COM(WinNT://.$computer./.$groupName.,group,$server_config) or die(Cannot create COM object); foreach ($domainObject-Members as $var) { echo $var-Name.br; } // add person to group $usertoadd = APerson; $domainUser = new COM(WinNT://DOMAIN/.$usertoadd.,user,$server_config) or die(Cannot create COM object ); $domainObject-Add($domainUser-ADsPath); ? TestUser is a local administrative account on TestComputer. If I run apache using the standard local system account, the code lists the members of the group but refuses to add APerson. If I run apache with a domain administrator account it works fine, but I don't want to do this - I want to be able to pass the username and password of an account on the target machine that has permissions set up for this purpose. I've tried making changes using dcomcnfg on the target machine, but no luck so far. Does anyone have any experience in using COM functions and can spot anything I'm doing wrong or a misunderstanding in how it works? Thanks, Jon - This e-mail does not reflect the views or opinions of Travellers Tales (UK) Ltd or any other related TT Games group company.
[PHP] COM Help (hopefully)
We have a US postal database called ZP4 that we that we use to scrub client addresses into something useful. For future projects we need to expand on this scrubbing so that we can view counties and such. The scrubbing is currently being performed by a custom application a former employee wrote for us while he still worked here. Unfortunately, he didn't commit the source of that application into our SVN repository (bad). Sadly, I don't have C/C++ creation skills worth relying upon. What I found in ZP4 is a COM wrapper for the ZP4 DLL. From the examples it should be simple to implement what I want, and this VB code does work fine: --- begin --- Set ZP4 = CreateObject(zp4ipcom.zp4com) ZP4.reset ZP4.input Address, 2401 Utah avenue south ZP4.input City, seattle ZP4.input State, wa ZP4.input ZIP, 98134 ZP4.correct WScript.Echo ZP4.output(Error code) WScript.Echo ZP4.output(Address (final)) WScript.Echo ZP4.output(City (final)) WScript.Echo ZP4.output(State (final)) WScript.Echo ZP4.output(ZIP (five-digit)) WScript.Echo ZP4.output(County name) --- end --- However, when I implement this code in PHP using COM all I get are errors: ?php try { $zp4 = new com( 'zp4ipcom.zp4com' ); $zp4-reset(); $zp4-input( 'Address', '2401 Utah avenue south' ); $zp4-input( 'City', 'seattle' ); $zp4-input( 'State', 'wa' ); $zp4-input( 'ZIP', '98134' ); $zp4-correct(); echo( $zp4-output( 'Error code' ) . \n ); echo( $zp4-output( 'Address (final)' ) . \n ); echo( $zp4-output( 'City (final)' ) . \n ); echo( $zp4-output( 'State (final)' ) . \n ); echo( $zp4-output( 'ZIP (five-digit)' ) . \n ); echo( $zp4-output( 'County name' ) . \n ); } catch( exception $e ) { echo( $e . \n ); } ? Results: exception 'com_exception' with message 'Error [0x80020003] Member not found. ' in C:\Documents and Settings\adamr\Desktop\zp4.com.php:7 Stack trace: #0 C:\Documents and Settings\adamr\Desktop\zp4.com.php(7): com-reset() #1 {main} I've tried everything I could think to get the above to work. If I specify a member that I know is not in the ZP4 DLL I get a different error. The Member not found error always seems to line up with the procedures/functions defined in the ZP4IPCOM source. ZP4 is a Windows only application. My development machine is running PHP 5.2.6. I've done other COM related code with Word without any troubles. I'm guessing that maybe the ZP4IPCOM interface itself is not complete enough for PHP, or there is some bug that I'm missing. The source for the ZP4IPCOM is provided with the ZP4 disk, but it's all in Pascal and I'm not sure hot to either tweak or rebuild that (my VS 2005 doesn't seem to think much of it :) While I could go with a VB solution for doing the address scrubbing, I had wanted to set it up in PHP so that I could open one COM connection to the DLL, and then via database burn through a large number of addresses. If I had the skills I'd also rather just create an extension for PHP itself that is a wrapper for the ZP4 DLL. If someone is interested in building that for my company on commission I'd love to discuss that with you. If anyone wants to help me with this I'd greatly appreciate it. Regards, Adam. -- Adam Randall http://www.xaren.net AIM: blitz574 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] php COM example usage
Hi, I have some cli scripts that previously ran on Linux, now i have to make available on Linux. I use semaphores for synchronization. I also have to develop some new scripts for windows that interact other custom programs. I need to create and signale events. Basically what i need is acces to the win api. If i am not mistaking (i am not much of a windows kind of person) i cann acces this via COM. I have searched for other methods too, but i foudn thet the Com extension is the only trust worthy. Other extensions for windows like the win32api is experimental, i need a stable solution for this. I am now stuck on how to access the win api via COM if possible. I have found that something like $Object = new COM(WinNT://Semaphore); works, but takes a long time to complete, and after that i no idea how to go on from there. There is a callable create() function on the object, but it complains about arguments. where can i find information about thease com objects? Is the instantiation of a Com objects really that slow or am i doing somthing wrong? -- Alpar Torok
[PHP] COM and the PHP equivalent of ASP Currency data type
Hi all, I am working with a COM interface and the specification which is wrtten for ASP calls for a Currency data type to be passed to a function. What is the equivalent in PHP? If I call com_print_typeinfo() I can see that the function has the following info: function GetPrice( /* VT_PTR [26] [in][out] -- VT_VARIANT [12] */ $Account, /* VT_PTR [26] [in][out] -- VT_CY [6] */ $Quant, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $QuantMult, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $prMult ) The parameter I am having problems with parameter 2 - $Quant. I tried to create a VARIANT of type VT_CY so I did: $qty = new VARIANT('1.', VT_CY); The error I am getting is: Uncaught exception 'com_exception' with message 'Parameter 2: Type mismatch. Thanks all, Alex - Alex Bovey Web Developer | Alex Bovey Consultancy Ltd Registered in England Wales no. 6471391 | VAT no. 934 8959 65 PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility
Re: [PHP] COM and the PHP equivalent of ASP Currency data type
Alex Bovey schreef: Hi all, I am working with a COM interface and the specification which is wrtten for ASP calls for a Currency data type to be passed to a function. What is the equivalent in PHP? If I call com_print_typeinfo() I can see that the function has the following info: function GetPrice( /* VT_PTR [26] [in][out] -- VT_VARIANT [12] */ $Account, /* VT_PTR [26] [in][out] -- VT_CY [6] */ $Quant, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $QuantMult, /* VT_PTR [26] [in][out] -- VT_I2 [2] */ $prMult ) The parameter I am having problems with parameter 2 - $Quant. I tried to create a VARIANT of type VT_CY so I did: $qty = new VARIANT('1.', VT_CY); total guess work from me: $qty = new VARIANT('1', VT_CY); i.e. use an 'int' rather than a 'float' or maybe just $qty = new VARIANT(1); The error I am getting is: Uncaught exception 'com_exception' with message 'Parameter 2: Type mismatch. you might try catching the exception and see if it contains any more useful info. Thanks all, Alex - Alex Bovey Web Developer | Alex Bovey Consultancy Ltd Registered in England Wales no. 6471391 | VAT no. 934 8959 65 PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM and com_safearray_proxy objects
Hi all, I'm trying to get my head around COM and interfaces and I'm making slow progress but have hit a problem. I have an IProduct interface and using com_print_typeinfo($iproduct) I can see it has the following property (amongst others): /* DISPID=1745027081 */ var $Description; /* DISPID=1745027081 */ /* VT_BSTR [8] */ var $Description; If I do var_dump($iproduct-Description) I get the following output: object(com_safearray_proxy)#7 (0) {} Now I have no idea what a com_safearray_proxy object is at all, and googling it hardly produces any results so I can't imagine it's very common. Any ideas how I am to access that property in my code? Thanks all, Alex -- Alex Bovey Web Developer | Alex Bovey Consultancy Ltd Registered in England Wales no. 6471391 | VAT no. 934 8959 65 PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM and VARIANT types
I think this may be what you are looking for, but I don't know how much it helps: http://www.marin.clara.net/COM/variant_type_definitions.htm Andrew Thanks Andrew - it's a start! Alex -- Alex Bovey Web Developer | Alex Bovey Consultancy Ltd Registered in England Wales no. 6471391 | VAT no. 934 8959 65 PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM and VARIANT types
Hi, I am playing around with some COM interfaces and getting my head around VARIANTs. I have a method that is returning a VARIANT and using variant_get_type returns the type as 9. How do I find out what type 9 relates to? The manual page for variant_get_type isn't much... Thanks all, Alex -- Alex Bovey Web Developer | Alex Bovey Consultancy Ltd Registered in England Wales no. 6471391 | VAT no. 934 8959 65 PHP | MySQL | AJAX | XHTML | CSS | Javascript | XML | W3C Accessibility -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM and VARIANT types
On Mon, Nov 3, 2008 at 1:33 PM, Alex Bovey [EMAIL PROTECTED] wrote: Hi, I am playing around with some COM interfaces and getting my head around VARIANTs. I have a method that is returning a VARIANT and using variant_get_type returns the type as 9. How do I find out what type 9 relates to? The manual page for variant_get_type isn't much... Thanks all, Alex I think this may be what you are looking for, but I don't know how much it helps: http://www.marin.clara.net/COM/variant_type_definitions.htm Andrew -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM Objects
I am having some trouble instantiating a COM object, it seems to crash my web server every time I call the line. $tve=new COM(TVE3COM.TVE); I have downloaded a trial version of the Turbo Video Engine SDK and this was a line I got from the php examples folder. Is anyone familiar with this SDK? I ran the installer which I guess would install the files in the correct location. Or do I need to have the DLL's in the same directory? I am very new to all of this. Thanks again, Nathan
[PHP] COM object project
I am using a COM object from one of our system venders and I am having problems using an in/out variable for one function on php 4.3.11. I can load the COM interface, return the typeinfo and even call the function successfully but I can't get a return value set for the variable. Here is the code I am using: $sessionid = (int) ; $C1COM = com_load(ConceptCOM); $val1 = $C1COM-OpenSession($sessionid); echo val1: ; print_r($val1); echo br; echo session: ; print_r($sessionid); echo br; This prints: val1: 1 session: 0 If I do the same thing using php 5 (just replace 'com_load' with 'new COM'), I get the expected result with a valid sessionid. Here is the typeinfo for the function: /* DISPID=10 */ /* VT_I4 [3] */ function opensession( /* VT_PTR [26] [in][out] -- VT_I4 [3] */ $sessionid ) { } I've tried different type casts, passing a variant, and different ways of calling the method; is there anything that I need to do to handle a VT_PTR type or a variable defined as in and out? Other then updating to php 5, can php 4 handle setting a method parameter within a COM object? The vender is willing to make some updates if needed but I don't want to have to do a major rewrite. Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + COM (IE Button COM Server)
http://php.net/com But that's only going to work on the same machine where PHP is running -- It does NOT add buttons and whatnot to my browser if I surf to your website... I actually doubt that the Python one does either, if you run it server-side... On Wed, May 2, 2007 6:53 pm, Iqbal Naved wrote: Hi Richard, Thanks for replying. But, I the thing is, my intention is not server-side scripting, but to use php as a regular programming language to implement this task (just as the demo did for python). for example we can use $ie = new COM(InternetExplorer.Application); to call the ie com interfaces, such as Visible, Navigate etc. Also. we can use WSH scripting capabilities too. Check out, http://www.hudzilla.org/phpbook/read.php/14_0_0 for some info on this. My guess is that if they can do it on Python, so can we on PHP :). Thanks again for replying, -Naved On 5/3/07, Richard Lynch [EMAIL PROTECTED] wrote: On Mon, April 30, 2007 1:46 pm, Iqbal Naved wrote: Anybody has implemented a IE button COM server in PHP ? I have found a python implementation for this in pywin32 package. My objective is to add a button in ie which will on click save the url in the address bar. I am attatching the iebutton.py with this mail. Also, this is a link in msdn instructing add toolbar buttons: http://msdn2.microsoft.com/en-us/library/aa753588.aspx Any code snippet will be extremely useful. What you want to do is something that happens on the CLIENT, the browser. PHP runs on the server. By the time the user is clicking on your button, there is NO php involved. Look into JavaScript or ActiveX or something. php ain't gonna do what you want. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP + COM (IE Button COM Server)
On Mon, April 30, 2007 1:46 pm, Iqbal Naved wrote: Anybody has implemented a IE button COM server in PHP ? I have found a python implementation for this in pywin32 package. My objective is to add a button in ie which will on click save the url in the address bar. I am attatching the iebutton.py with this mail. Also, this is a link in msdn instructing add toolbar buttons: http://msdn2.microsoft.com/en-us/library/aa753588.aspx Any code snippet will be extremely useful. What you want to do is something that happens on the CLIENT, the browser. PHP runs on the server. By the time the user is clicking on your button, there is NO php involved. Look into JavaScript or ActiveX or something. php ain't gonna do what you want. -- Some people have a gift link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/browse/from/lynch Yeah, I get a buck. So? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP + COM (IE Button COM Server)
Hi, Anybody has implemented a IE button COM server in PHP ? I have found a python implementation for this in pywin32 package. My objective is to add a button in ie which will on click save the url in the address bar. I am attatching the iebutton.py with this mail. Also, this is a link in msdn instructing add toolbar buttons: http://msdn2.microsoft.com/en-us/library/aa753588.aspx Any code snippet will be extremely useful. Thanks in advance. -Iqbal Naved # encoding: latin-1 # PyWin32 Internet Explorer Button # # written by Leonard Ritter ([EMAIL PROTECTED]) # and Robert Förtsch ([EMAIL PROTECTED]) This sample implements a simple IE Button COM server with access to the IWebBrowser2 interface. To demonstrate: * Execute this script to register the server. * Open Pythonwin's Tools - Trace Collector Debugging Tool, so you can see the output of 'print' statements in this demo. * Open a new IE instance. The toolbar should have a new scissors icon, with tooltip text IE Button - this is our new button - click it. * Switch back to the Pythonwin window - you should see: IOleCommandTarget::Exec called. This is the button being clicked. Extending this to do something more useful is left as an exercise. Contribtions to this sample to make it a little friendlier welcome! # imports section import sys, os from win32com import universal from win32com.client import gencache, DispatchWithEvents, Dispatch from win32com.client import constants, getevents import win32com.server.register import win32com import pythoncom import win32api # This demo uses 'print' - use win32traceutil to see it if we have no # console. try: win32api.GetConsoleTitle() except win32api.error: import win32traceutil from win32com.axcontrol import axcontrol import array, struct # ensure we know the ms internet controls typelib so we have access to IWebBrowser2 later on win32com.client.gencache.EnsureModule('{EAB22AC0-30C1-11CF-A7EB-C05BAE0B}',0,1,1) # IObjectWithSite_methods = ['SetSite','GetSite'] IOleCommandTarget_methods = ['Exec','QueryStatus'] _iebutton_methods_ = IOleCommandTarget_methods + IObjectWithSite_methods _iebutton_com_interfaces_ = [ axcontrol.IID_IOleCommandTarget, axcontrol.IID_IObjectWithSite, # IObjectWithSite ] class Stub: this class serves as a method stub, outputting debug info whenever the object is being called. def __init__(self,name): self.name = name def __call__(self,*args): print 'STUB: ',self.name,args class IEButton: The actual COM server class _com_interfaces_ = _iebutton_com_interfaces_ _public_methods_ = _iebutton_methods_ _reg_clsctx_ = pythoncom.CLSCTX_INPROC_SERVER _button_text_ = 'IE Button' _tool_tip_ = 'An example implementation for an IE Button.' _icon_ = '' _hot_icon_ = '' def __init__( self ): # put stubs for non-implemented methods for method in self._public_methods_: if not hasattr(self,method): print 'providing default stub for %s' % method setattr(self,method,Stub(method)) def QueryStatus (self, pguidCmdGroup, prgCmds, cmdtextf): # 'cmdtextf' is the 'cmdtextf' element from the OLECMDTEXT structure, # or None if a NULL pointer was passed. result = [] for id, flags in prgCmds: flags |= axcontrol.OLECMDF_SUPPORTED | axcontrol.OLECMDF_ENABLED result.append((id, flags)) if cmdtextf is None: cmdtext = None # must return None if nothing requested. # IE never seems to want any text - this code is here for # demo purposes only elif cmdtextf == axcontrol.OLECMDTEXTF_NAME: cmdtext = IEButton Name else: cmdtext = IEButton State return result, cmdtext def Exec(self, pguidCmdGroup, nCmdID, nCmdExecOpt, pvaIn): print pguidCmdGroup, nCmdID, nCmdExecOpt, pvaIn print IOleCommandTarget::Exec called. #self.webbrowser.ShowBrowserBar(GUID_IETOOLBAR, not is_ietoolbar_visible()) def SetSite(self,unknown): if unknown: # first get a command target cmdtarget = unknown.QueryInterface(axcontrol.IID_IOleCommandTarget) # then travel over to a service provider serviceprovider = cmdtarget.QueryInterface(pythoncom.IID_IServiceProvider) # finally ask for the internet explorer application, returned as a dispatch object self.webbrowser = win32com.client.Dispatch(serviceprovider.QueryService('{0002DF05---C000-0046}',pythoncom.IID_IDispatch)) else: # lose all references self.webbrowser = None def GetClassID(self): return self._reg_clsid_ def register(classobj): import _winreg subKeyCLSID = SOFTWARE\\Microsoft\\Internet Explorer\\Extensions\\%38s % classobj._reg_clsid_
[PHP] COM Dlls not unbinding
Hi All, I am doing a lot of PHP work with COM. The system uses php 4.3.3.3 and php is being driven via FCGI from our own web server (TAG). We create an instance of an in-process COM server using the following technique: function GetFactory() { static $obj; static $objSet = 0; if($objSet==0) { $obj=new COM(TPN_Obj.JDCom_Factory); $objSet=-1; } return $obj; } The returned COM object is then used as a factory to all our other COM objects. The snag is that the binding to the COM dll is not being released at the end of script execution. This is visible using ProcessExplorer from SysInternals. If I call com_release the returned ref-count is zero. To ensure that php's garbage collector was not the culprit, I tried repeatedly calling com_release at the end of the script - no change. The upshot of this issue is that each PHP process in the FCGI process pool gradually gets bigger as more and more dlls are bound :-( Any ideas are welcome; I have gone through the php source but cannot quite figure the problem. Changing the C code is OK for our application. Thanks! Dr Alexander J Turner Project Network +44 (0) 7917 065072 Con Call: 0870 241 3425/3342654#
[PHP] COM dlls not unbinding at script end
I am doing a lot of PHP work with COM. The system uses php 4.3.3.3 and php is being driven via FCGI from our own web server (TAG). We create an instance of an in-process COM server using the following technique: function GetFactory() { static $obj; static $objSet = 0; if($objSet==0) { $obj=new COM(TPN_Obj.JDCom_Factory); $objSet=-1; } return $obj; } The returned COM object is then used as a factory to all our other COM objects. The snag is that the binding to the COM dll is not being released at the end of script execution. This is visible using ProcessExplorer from SysInternals. If I call com_release the returned ref-count is zero. To ensure that php's garbage collector was not the culprit, I tried repeatedly calling com_release at the end of the script - no change. The upshot of this issue is that each PHP process in the FCGI process pool gradually gets bigger as more and more dlls are bound :-( Any ideas are welcome, I have gone through the php source but cannot quite figure the problem. As we are going over to our own build of 4.4.1 asap, a C level fix would be great :-) Thanks! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM and MS word.
Hi all, I'm using com to acces MS word and building tables: $word-Documents-Add(); \\ Gives me a new doc $word-Selection-InsertAfter(poo, foo, you); \\ gives me one row $word-Selection-ConvertToTable(,); \\ converts the table to a row. What I can't work out is how to change the width on the first column. I've tried various ways to use SetWidth but failed. Any got any experince or examples of how to use word from PHP to generate tables and layout documents? Dave. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM integration problems
Hi all, I'm trying to interface with verisign's payflow pro on windows using the COM workaround. This code was originally taken from an example listed with the manual as a workaound for the fact that the php pfpro functions are not supported on windows. It worked for some time until the server was upgraded to windows 2003 server. Now, all calls to instantiate a COM object return the boolean value 'true' $pfpro_client = new COM('PFProCOMControl.PFProCOMControl.1'); // this line outputs 'true' echo $pfpro_client; //Connect to Verisign via COM object... // this line gives a call to a member function on a non object error $pfpro_context = $pfpro_client-CreateContext($this-getURL(), 443, 24,,0,,); I've tried other COM objects like new COM(InternetExplorer.Application) and it also returns 'true'. Other tests of the pfpro install are sucessful (asp, pfpro.exe), so i believe the payflow config is correct. It just seems like the php com integration is screwed up. Any ideas? thanks, jon -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM works on NT but fails on 2003?
On Monday 11 April 2005 12:11, Theisen, Gary wrote: if ($excel !=== FALSE) { //This is the error line?!?! I even tried FALSE. if ($excel !== FALSE) { ... } -- Jason Wong - Gremlins Associates - www.gremlins.biz Open Source Software Systems Integrators * Web Design Hosting * Internet Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- New Year Resolution: Ignore top posted posts -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM works on NT but fails on 2003?
Hi all, I currently have php 4.3.10 loaded on a windows 2003 server running apache 2.0.52. PHP and the web server work fine. I've got the code (that used to work on an old NT box running IIS and an earlier version of PHP...I think 4.1 or 4.2??) //.code $excel = new COM(Excel.Application) or Die (Did not connect); //Open the workbook that we want to use. $book = $excel-Application-Workbooks-Open($reportPath.$rptName); //more code Again...that used to work on NT, but now I can't get it to work on 2003. I believe the issue lies with the new COM() line, but it doesn't print out the or die statement. I've followed the article on this site (which is how I got this Excel COM function to work with NT in the first place: http://www.phpbuilder.net/columns/venkatesan20030501.php3]http://www.php builder.net/columns/venkatesan20030501.php3 but perhaps this doesn't apply to the new win 2003 server? I have the appropriate IUSR_MACHINE_Name user with Excel COM launch, etc. permissions. Any ideas? :idea: Thanks. EDIT: some more info... when i run this script...nothing happens. at least that i can see. I look in the O/S event logs, nothing shows up there related to this. I look in the apache logs...nothing on this. This script was run via the cmd line on the NT box ( should be run by cmd line on the 2003 box as well). When I run the script (F:\somedirtheScript.php)...it pauses for about 2 seconds then just returns to the command line. I've got the php.ini file set to display all errors turned on. still, nothing is displayed in the cmd window. So I run a basic test: parse errror: the code: ? //** //Create the spreadsheet object. //** $basePath = F:\\_jobs\\reports\\adhoc\\SomeReportDir\\; $reportPath = $basePath.report\\SomeReport.xls; $excel = new COM(Excel.Application) or Die (Did not connect); if ($excel !=== FALSE) { //This is the error line?!?! I even tried FALSE. print Testing output.\n; print $excel; } else { print Error; die(); } $book = $excel-Application-Workbooks-Open($reportPath.$rptName); ? F:\_jobs\reports\scriptsexcel.php PHP Parse error: parse error in F:\_jobs\reports\scripts\excel.php on line 10 Content-type: text/html br / bParse error/b: parse error in bF:\_jobs\reports\scripts\excel.php/b on line b10/bbr / F:\_jobs\reports\scripts Why won't this work on windows 2003 server...or at least give me an error that I can work with? Thanks.
[PHP] COM Bug in PHP 4.3.10
Hi, I need to know when will be the next PHP 4.3.x release with the fix for the COM bug which was in 4.3.10. This is CRITICAL for us, because we run our application over windows using COM object and we use earlier version of PHP which has security bugs. COM Bug URL: http://bugs.php.net/bug.php?id=31159 Thanks, Tohar Trabinovitch Software Engineer E: [EMAIL PROTECTED] T: 972-3-9008269 C: 054-777 30 43 This message is intended only for the person(s) to which it is addressed and may contain Sphera Corporation privileged, confidential and/or proprietary information. If you have received this communication in error, please notify us immediately by replying to the message and deleting it from your computer. Any disclosure, copying, distribution, or the taking of any action concerning the contents of this message and any attachment(s) by anyone other than the named recipient(s) is strictly prohibited.
[PHP] COM objects
Hi, I am running PHP 4.3.4 on Windows 2000 server with Apache 2.0.48. I am using COM objects in some of the pages. My question is, how do I release them when I'm done? Right now, I'm unsetting them, but after a few days I get COM+ Errors in the Event Viewer: The COM+ Services DLL (comsvcs.dll) was unable to load because allocation of thread local storage failed. Process Name: Apache.exe Error Code = 0x80070008 : Not enough storage is available to process this command. COM+ Services Internals Information: File: .\comsvcs.cpp, Line: 289 Anyone have any suggestions? Thanks, CC __ Do you Yahoo!? Yahoo! SiteBuilder - Free web site building tool. Try it! http://webhosting.yahoo.com/ps/sb/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM Server Object Properties
I have a COM server that exposes a read/write property with a parameter. Here is the IDL: [propget, id(5), helpstring(property Status)] HRESULT Status([in] BSTR bstrPhase, [out, retval] long *pVal); [propput, id(5), helpstring(property Status)] HRESULT Status([in] BSTR bstrPhase, [in] long newVal); PHP supports propget methods just fine as follows: $someValue = $settings-Status(R); But propput methods don't compile like this: $settings-Status(R) = 1; And the built-in com_set() looks like it can't support parameters. Am I up a creek? Anyone ever used these features? They're *very* sparsely documented. :) J -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM and PHP.ini
(PHP 4.3.0, Windows XP Pro, Office 2000 Pro) Hello, Just playing around with COM, and I got the error below. Searching on google it mentions something about a DLL error. Iv'e enabled dcom in php.ini. What have I missed! Line 2 says $excel = new COM(Excel.Application) or die(Excel could not be started); THANK! Warning: (null)(): Unable to obtain IDispatch interface for CLSID {00024500---C000-0046}: Server execution failed in c:\websites\excel.php on line 2 Fatal error: Maximum execution time of 30 seconds exceeded in c:\websites\excel.php on line 2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM(Excel.Sheet)
Hi! i'd like to use full power of Excel.Sheet COM object. Does anybody know where can I find full documentation of Excel.Sheet COM object ? thanks Jan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM(Excel.Sheet)
On 20 Aug 2003 15:11:26 +0200, you wrote: i'd like to use full power of Excel.Sheet COM object. Does anybody know where can I find full documentation of Excel.Sheet COM object ? Uh... MSDN? http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odeopg/html/deovrworkingwithofficeapplications.asp less than 30 seconds with Google. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] com obj from php
Hi all; Does anyone know if ti is possible or not to create a com object from php?? cheers :o) Steve. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] com obj from php
This is using COM in php scripts, I want to create a com obj (or anything really) that was written in php and use it in a .NET app Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] Does anyone know if ti is possible or not to create a com object from php?? [/snip] Please refer to the manual at http://www.php.net/manual/en/faq.com.php for a start. Have a pleasant and magical day! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] com obj from php
[snip] This is using COM in php scripts, I want to create a com obj (or anything really) that was written in php and use it in a .NET app [/snip] OK, I found this, which may or may not help http://www.devarticles.com/art/1/222 Got Google? Have a pleasant and resourceful day! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] com obj from php
Cheers Jay, but Ive seen this already, i'ts the wrong way round!! Steve. Jay Blanchard [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] [snip] This is using COM in php scripts, I want to create a com obj (or anything really) that was written in php and use it in a .NET app [/snip] OK, I found this, which may or may not help http://www.devarticles.com/art/1/222 Got Google? Have a pleasant and resourceful day! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] com obj from php
[snip] Does anyone know if ti is possible or not to create a com object from php?? [/snip] Please refer to the manual at http://www.php.net/manual/en/faq.com.php for a start. Have a pleasant and magical day! -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM mail merge problem!
Hi, I have a MySQL database which contains customer data. I have written a PHP script to create a CSV file and then import the data into Microsoft excel using COM, which has been saved into C:\TEMP\test.xls. I am now trying to start a mail merge in word with the following code:- com_load_typelib('Word.Application'); $word = new COM(word.application) or die(Unable to instantiate Word); $word-Visible = 1; $word-Documents-Add(); $word-ActiveDocument-MailMerge-MainDocumentType = wdFormLetters; $word-ActiveDocument-MailMerge-OpenDataSource _(c:\\temp\\test.xls); I only want to setup the mail merge up to the point where the user can start selecting fields. The problem is that after word opens it prompts me to select a table. According to the Microsoft documentation this is because the SQLStatement parameter has not been specified in the call to OpenDataSource. I have created a empty variant data type as follows:- $empty = new VARIANT(); and used it in the new call where OpenDataSource (c:\\temp\\test.xls,$empty,$empty,$empty,$empty,$empty,$empty,$empty,$empt y,$empty,$empty,$empty,SELECT * FROM test$,$empty,$empty,$empty); When I run the script I get the following error: Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in c:\program files\apache group\apache\htdocs\test6.php on line 93 I didn't think I had specified 17 arguments. I have checked want data types OpenDataSource is expecting and according to OLE/COM view it is expecting a BSTR followed by 15 optional variants. I apologise if this seems like a stupid question but I've only been programming in php for a couple of months. Any advice would be appreciated. Thanks Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM mail merge problem!
Hi, I have a MySQL database which contains customer data. I have written a PHP script to create a CSV file and then import the data into Microsoft excel using COM, which has been saved into C:\TEMP\test.xls. I am now trying to start a mail merge in word with the following code:- com_load_typelib('Word.Application'); $word = new COM(word.application) or die(Unable to instantiate Word); $word-Visible = 1; $word-Documents-Add(); $word-ActiveDocument-MailMerge-MainDocumentType = wdFormLetters; $word-ActiveDocument-MailMerge-OpenDataSource _(c:\\temp\\test.xls); I only want to setup the mail merge up to the point where the user can start selecting fields. The problem is that after word opens it prompts me to select a table. According to the Microsoft documentation this is because the SQLStatement parameter has not been specified in the call to OpenDataSource. I have created a empty variant data type as follows:- $empty = new VARIANT(); and used it in the new call where OpenDataSource (c:\\temp\\test.xls,$empty,$empty,$empty,$empty,$empty,$empty,$empty,$empt y,$empty,$empty,$empty,SELECT * FROM test$,$empty,$empty,$empty); When I run the script I get the following error: Warning: (null)(): Invoke() failed: Type mismatch. Argument: 17 in c:\program files\apache group\apache\htdocs\test6.php on line 93 I didn't think I had specified 17 arguments. I have checked want data types OpenDataSource is expecting and according to OLE/COM view it is expecting a BSTR followed by 15 optional variants. I apologise if this seems like a stupid question but I've only been programming in php for a couple of months. Any advice would be appreciated. Thanks Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] COM
Is there some reason you want to access it through com? I'm assuming that you've added the access db as an odbc data source? I'm not sure, but it seems like you might be using the wrong syntax. You might want to check out this: http://www.php.net/manual/en/ref.odbc.php ... or... this, which is a good example of how to use odbc in php: http://php.weblogs.com/odbc Also, is it giving you an error or just not returning results? -- jon - jon roig senior manager, online production epilepsy foundation http://jonroig.com -Original Message- From: Kiswa [mailto:[EMAIL PROTECTED] Sent: Saturday, March 29, 2003 4:17 AM To: [EMAIL PROTECTED] Subject: [PHP] COM Server Win2000 +ISS5 +PHP Trying to get access to an access DB through COM but i wont work. there is no results generated. Can anyone help me Here is the code $rownum =0; $conn = ADONewConnection('access'); $conn-PConnect('webdb.mdb'); $result = $conn-Execute('SELECT Produkt, Artikelnr, Pris, Lagerstatus, Beskrivning, Kategori, Bild FROM Data'); while(odbc_fetch_row($result)){ $Produkt = odbc_result($result, Produkt); $Artikelnr = odbc_result($result, Artikelnr); $Pris = odbc_result($result, Pris); $Lagerstatus = odbc_result($result, Lagerstatus); $Beskrivning = odbc_result($result, Beskrivning); $Kategori = odbc_result($result, Kategori); $Bild = odbc_result($result, Bild); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM
Server Win2000 +ISS5 +PHP Trying to get access to an access DB through COM but i wont work. there is no results generated. Can anyone help me Here is the code $rownum =0; $conn = ADONewConnection('access'); $conn-PConnect('webdb.mdb'); $result = $conn-Execute('SELECT Produkt, Artikelnr, Pris, Lagerstatus, Beskrivning, Kategori, Bild FROM Data'); while(odbc_fetch_row($result)){ $Produkt = odbc_result($result, Produkt); $Artikelnr = odbc_result($result, Artikelnr); $Pris = odbc_result($result, Pris); $Lagerstatus = odbc_result($result, Lagerstatus); $Beskrivning = odbc_result($result, Beskrivning); $Kategori = odbc_result($result, Kategori); $Bild = odbc_result($result, Bild); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP+COM (formating excel)
thanx for no response. forget it. It was realy so simple. Hi, All, I would be very appreciated if you could help me to find information about formating excel cells (like merge cells, Autofit columns, etc.). I am using excel from php like com object. Thanks in advance. gytis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] + com (formating excel cells)
thanks for no response. forget it please. Dj Gj [EMAIL PROTECTED] wrote in message news:[EMAIL PROTECTED] hi, all, does anybody know: how to merge excel cells from php code? how to make excel columns autofited from php code? where to find the information about all of this kind tricks? appreciated for any useful answer. gytis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Re: PHP+COM (formating excel)
thanx for no response. forget it. It was realy so simple. You're welcome. Really, it was nothing. How about sharing the solution with the group that way you help other people? ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ Hi, All, I would be very appreciated if you could help me to find information about formating excel cells (like merge cells, Autofit columns, etc.). I am using excel from php like com object. Thanks in advance. gytis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] + com (formating excel cells)
hi, all, does anybody know: how to merge excel cells from php code? how to make excel columns autofited from php code? where to find the information about all of this kind tricks? appreciated for any useful answer. gytis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP+COM (formating excel)
Hi, All, I would be very appreciated if you could help me to find information about formating excel cells (like merge cells, Autofit columns, etc.). I am using excel from php like com object. Thanks in advance. gytis -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM object
How I can create a Word document through PHP? Must I modify php.ini? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM question
How I can manage Word through PHP? I have tried with the code indicated on PHP-guide (chm format) but it does not work. ?php //test04.php $word = new COM(word.application) or die(Non sono riuscito ad eseguire Word); $word-Visible = 1; $word-Documents-Add(); $word-Selection-TypeText(Questa è una prova...); $word-Documents[1]-SaveAs(Prova inutile.doc); $word-Quit(); $word-Release(); $word = null; ? Warning: Invoke() failed: Eccezione. Source: Microsoft Word Description: Impossibile aprire la memoria macro. in C:\PHP\ENZO\test04.php on line 7 Warning: Invoke() failed: Eccezione. Source: Microsoft Word Description: Il membro richiesto dell'insieme non esiste. in C:\PHP\ENZO\test04.php on line 10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] COM question
Sorry, either translates the error messages or post to a italian php mailing list [EMAIL PROTECTED] wrote: How I can manage Word through PHP? I have tried with the code indicated on PHP-guide (chm format) but it does not work. ?php //test04.php $word = new COM(word.application) or die(Non sono riuscito ad eseguire Word); $word-Visible = 1; $word-Documents-Add(); $word-Selection-TypeText(Questa è una prova...); $word-Documents[1]-SaveAs(Prova inutile.doc); $word-Quit(); $word-Release(); $word = null; ? Warning: Invoke() failed: Eccezione. Source: Microsoft Word Description: Impossibile aprire la memoria macro. in C:\PHP\ENZO\test04.php on line 7 Warning: Invoke() failed: Eccezione. Source: Microsoft Word Description: Il membro richiesto dell'insieme non esiste. in C:\PHP\ENZO\test04.php on line 10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM and Word, how?
I am new to COM and tried an example today (See bottom of post) When I execute the code, I get is an error message and if I look in the Task Manager, there is a WINWORD.EXE process running, which I can't end. Every time I reload the page, a new winword is started... How should PHP.ini be set for me to use COM Objects? - Error message: Warning: Unable to obtain IDispatch interface for CLSID {000209FF---C000-0046}: The message filter indicated that the application is busy. in d:\inetpub\wwwroot\incmill\ver2\readfile.php on line 2 Unable to instantiate word Setup: Windows 2000 Professional PHP 4.2.1 Office 2000 PHP.ini COM values: Directive, Local Value, Master Value com.allow_dcom, Off, Off com.autoregister_casesensitive, On, On com.autoregister_typelib, Off, Off com.autoregister_verbose, Off, Off com.typelib_file, no value, no value Code: $word = new COM(word.application) or die(Unable to instantiate Word); print Loaded Word, version {$word-Version}BR; $word-Visible = 1; $word-Documents-Add(); $word-Selection-TypeText(This is a test...); $word-Documents[1]-SaveAs(Useless test.doc); $word-Quit(); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM and php.... Several issues....
I've read through most of the documentation on how to use COM to create MS Word documents via PHP, but I'm still having some issues that I can't seem to find any help on. CODE: ? $word=new COM(word.application) or die(Cannot start MS Word); print Loaded word version ($word-Version)\n; $word-visible = 1 ; $word-Documents-Add(); $word-Selection-Typetext(This is a test); ? RETURNS: Loaded word version (9.0) Warning: Invoke() failed: Exception occurred. Source: Microsoft Word Description: Could not open macro storage. in C:\Inetpub\wwwroot\php\word.php on line 6 I've looked on MS's website and have adjusted the DCOMCNFG.cfg as below: 1. Microsoft Word Document 2. Default Access Permission (INTERACTIVE / IUSR_NT-BOX) 2.Default Launch Permissions (INTERACTIVE / IUSR_NT-BOX) 3. Default Config. Permissions (INTERACITVE /IUSR_NT-BOX) I really don't know what else I'm doing wrong...I've been trying to get this to work for the last two days and it seems like and endless loop!! Any help would be appreciated.. Jeremy -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] HELP: PHP COM with Distiller
Hi All, Installed Apache, PHP, Office and Adobe Distiller on Win2000 Professional. By using $pdf = new COM(pdfdistiller.pdfdistiller.1); $pdf-FileToPdf($psfile, , ); I am able to convert PS to PDF. In the same fashion I want to convert DOC, XLS and PPT to PDF format. Is that possible, please explain in detail. Thanks in advance, Regards, Kumar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Re: PHP COM with Distiller
Don't have sample code handy, but you'd create a new Word, Excel or Powerpoint object (depending), and use the print methods of those objects to send it to Distiller. Kumar [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All, Installed Apache, PHP, Office and Adobe Distiller on Win2000 Professional. By using $pdf = new COM(pdfdistiller.pdfdistiller.1); $pdf-FileToPdf($psfile, , ); I am able to convert PS to PDF. In the same fashion I want to convert DOC, XLS and PPT to PDF format. Is that possible, please explain in detail. Thanks in advance, Regards, Kumar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Re: PHP COM with Distiller
Hi, Good to see u'r reply. My problem is where can I get those methods documentation. Can anybody experts in Windows can help me out !! Thanking You, Kumar. On Wed, 27 Feb 2002 J Wynia wrote : Don't have sample code handy, but you'd create a new Word, Excel or Powerpoint object (depending), and use the print methods of those objects to send it to Distiller. Kumar [EMAIL PROTECTED] wrote in message [EMAIL PROTECTED]">news:[EMAIL PROTECTED]... Hi All, Installed Apache, PHP, Office and Adobe Distiller on Win2000 Professional. By using $pdf = new COM(pdfdistiller.pdfdistiller.1); $pdf-FileToPdf($psfile, , ); I am able to convert PS to PDF. In the same fashion I want to convert DOC, XLS and PPT to PDF format. Is that possible, please explain in detail. Thanks in advance, Regards, Kumar. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] COM
is anyone out there familiar with COM built into Php? This is my code: $sheet = Range(B6:B9)-Select; $sheet-Selection-Borders(xlEdgeBottom); $sheet-Selection-LineStyle = 9; //xlContinuous $sheet-Selection-Weight = 2; //xlThin I get an error everytime I use the Range method and some other methods, the major things work, but the formatting seems to be a little funny with its syntax Any help would be greatly appreciated, Thanks in advance __ Joseph D. Mainolfi Jr. IT Specialist American Bridge Company 1000 American Bridge Way Coraopolis, PA 15108 (412) 631-1018 phone (412) 631-2000 fax [EMAIL PROTECTED] http://www.americanbridge.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM Question- Please Help
This is what I am trying to do. I am trying to add a border to the bottom edge of a cell. The Range and some other methods seem to not work with the syntax that the VB editor in excel says. Like Range in the vb editor is Range(A1:B9).Select. When I try this in php it gives me and error. I found that some of the functions are not recognized also. Do I have to use some other syntax? Do you know where I can get a list of the available objects that are available in php? I want to select the range A1:E5 $sheet = Range( ??? ); $sheet-Select; Thanks, __ Joseph D. Mainolfi Jr. IT Specialist American Bridge Company 1000 American Bridge Way Coraopolis, PA 15108 (412) 631-1018 phone (412) 631-2000 fax [EMAIL PROTECTED] http://www.americanbridge.net -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM
Hi everybody, When i run the following script in a dos box it works fine. If i run it in a browser window i receive a Dr Watson. Anybody has an idea ? My config is Apache 1.3.20 PHP 4.0.5 Windows NT4 SP5 French The script is inspired of the following url http://www.phpbuilder.net/columns/alain20001003.php3 ? $workbook = D:\CAC40.XLS; $sheet = Feuil1; #Instantiate the spreadsheet component. $ex = new COM(Excel.application) or Die (Did not connect); #Open the workbook that we want to use. $wkb = $ex-application-Workbooks-Open($workbook,3) or Die (Did not open); $sheets = $wkb-Worksheets($sheet);#Select the sheet $sheets-Calculate; $sheets-activate; #Activate it $cell = $sheets-Cells(2,2) ;#Select the cell (Row Column number) $cell-activate;#Activate the cell $oldcell=$cell-value; print Cac40 = {$cell-value} BR;#Print the value of the cell:1 $cell = $sheets-Cells(1,2) ;#Select the cell (Row Column number) $cell-activate;#Activate the cell $oldcell=$cell-value; print DowJones = {$cell-value} BR;#Print the value of the cell:1 #Close all workbooks without questioning $ex-application-ActiveWorkbook-Close(False); unset ($ex); ? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM
Hi All Where is some good info on useing COM or DCOM with PHP? Both of my scripts bellow fail and I cannot seem to find why. ?php $Instance = new COM (string Word.Application, string 216.0.0.0); ? or ? $word = new COM(word.application) or die(Unable to instanciate Word); print Loaded Word, version {$word-Version}\n; $word-Visible = 1; $word-Documents-Add(); $word-Selection-TypeText(This is a test...); $word-Documents[1]-SaveAs(Useless test.doc); $word-Quit(); ? Running on Win2K PHP 4.0.6 Sorry if it bugs anyone that I posted here and the WinDoze as well but no seemed home thereGBusy rebooting I guess -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM
I heard refs on using the COM interface to access MS Word files. Is this a procedure an interface that only works on Windows systems (as that is where Word runs)? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM and type mismatch
Does anyone know the reason for the type mismatch error which often seems to happen when using COM objects? The only piece of info I've seen suggested that a COM object can't be passed as a variable to a second COM object. Is this true, and if it is how might this be worked around. Thanks for any suggestions. Skipsey. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM objects
Can anyone tell me how this asp code would be rewritten in PHP, I'm having trouble getting it to work. Don't worry about the variable names and stuff, it's just the actual connection to the application that's causing me the grief. Thanks for any suggestions, Skipsey. begin 666 createservername.asp M/5 ($QA;F=U86=E/594V-R:7!T(4^#0H-CPA+2T@(VEN8VQU94@9FEL M93TB97)R;W(N87-P(B M+3X-@T*/4-D]N($5RF]R(%)EW5M92!.97AT M#0I%G(N0VQE87(@#0H-DEF(%)E75EW0N1F]R;2@BV5R=F5R7VYA;64B M*2 \/B B(B!4:5N#0H)4V5T($-L:65N=%-EG9I8V4@/2!#F5A=5/8FIE M8W0H(E1E'1M;%-EG9EBY#;EE;G1397)V:6-ER(I#0H)268@17)R+FYU M;6)EB ](# @5AE;@T*0E3970@4V5R=F5R4V5R=FEC92 ]($-L:65N=%-E MG9I8V4N0V]N;F5C=%-EG9EBA#W1R*%)E75EW0N1F]R;2@BV5R=F5R M7VYA;64B*2DI#0H)4EF($5RBYN=6UB97(@/2 P(%1H96X-@D)5-E=!F MV\@/2!#F5A=5/8FIE8W0H(E-CFEP=EN9RY:6QE4WES=5M3V)J96-T M(BD-@D)5-E=!TR ](9S;RY#F5A=5497AT1FEL92A397-S:6]N*)A M'!0871H(BD@)B BV5R=F5R;F%M92YT'0B+!4G5E+!86QS92D-@D) M4EF($5RBYN=6UB97(@/2 P(%1H96X-@D)0ETRY7FET94QI;F4@0U-T MBA297%U97-T+D9OFTH(G-EG9EE]N86UE(BDI#0H)0D)=',N0VQOV4- M@D)0E297-P;VYS92Y2961IF5C= B;]G:6XN87-P(@T*0D)16QS90T* M0D)5=R:71E17)R;W(@17)R+ B8W)E871E('1H92 \0CYS97)V97)N86UE M+G1X=#PO0CX@9FEL92(-@D)45N9!)9@T*0D)4V5T('1S(#T@3F]T:EN M9PT*0D)4V5T(9S;R ]($YO=AI;F-@D)16QS90T*0D)5W)I=5%G)O MB!%G(L()C;VYN96-T('1O('1H92!S97)V97(@/$(^(B F(%)E75EW0N M1F]R;2@BV5R=F5R7VYA;64B*2 F((\+T(^(@T*0E%;F0@268-@E%;'-E M#0H)5=R:71E17)R;W(@17)R+ B8W)E871E('1H92!#;EE;G0@4V5R=FEC M92(-@E%;F0@268-D5LV4-@E297-P;VYS92Y2961IF5C= B95F875L 2=YH=TB#0I%;F0@268-B4^ ` end -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM in PHP
Hi, here my problem with COM in PHP. ? echo J-Server in der dynamischen PHP-Web-Site. brbr; $jServer = new COM(jexeserver) or DIE (Connect zum J Server ist nicht möglich); $jServer-Show(1); $jServer-Log(1); $jServer-Do(0!:0 (1!:40''),'system\extras\config\profile.ijs'); $jServer-Do(load'd:\\j_tm1dll\\j\\tm1api.ijs'); $jServer-Do(load'd:\\j_tm1dll\\j\\tm1con.ijs'); $jServer-Do(load'd:\\j_tm1dll\\j\\tm1prop.ijs'); $jServer-Do(load'd:\\j_tm1dll\\j\\tm1view.ijs'); $jServer-Do(Tm1On''); $jServer-Do(Tm1AdmSet'OLAPLINE01'); $jServer-Do(SrvCon'zeiterf';'Admin';''); #$jServer-Do(NN=:'XXX'); $Var = xxx; $jServer-SetB(NN, $Var); // In the COM server: NN = $Var $jServer-Do(NN); // Display NN in the COM server $jServer-Do(NN=:'yyy'); // In the COM server: NN = yyy $jServer-GetB(NN, $Var);// === There is my problem: ( is a refernce) // In the COM server $Var = NN echo $Var; // echo $Var Output: xxx and not yyy ?!? $jServer-Quit(); ? Is there a bug in my code or is this a bug in COM ??? Wolf Schoemann [EMAIL PROTECTED]
RE: [PHP] COM
Thanks !!! I will try... -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -Original Message- From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 02, 2001 8:31 AM To: Hassan Arteaga Subject: Re: [PHP] COM Hi Arteaga, Instead of using that functions, use the new one shown bellow: For instantiate an COM object in PHP: $obj = new COM(ApplicationName.ClassApplicationName); For properties and methods access: $obj-property_name; $obj-method_name; I have used and tested this function and I have obtained success (using PHP on Windows 2000 Server). It work very fine. Regards, Iriton Jonath. - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: Php (E-mail) [EMAIL PROTECTED] Sent: Monday, April 30, 2001 2:57 PM Subject: [PHP] COM Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] COM
Hi Iriton !! I tested but with errors.. 9 ? php 10 $obj = new COM(Has.HasClass); 11 echo $obj-Hello(Hi Hassan); 12 ? This is only VB component Hello return the string entered as var...I receive this error.. Parse error: parse error in C:\Inetpub\wwwroot\myphp\com.php on line 10 Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -Original Message- From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 02, 2001 8:31 AM To: Hassan Arteaga Subject: Re: [PHP] COM Hi Arteaga, Instead of using that functions, use the new one shown bellow: For instantiate an COM object in PHP: $obj = new COM(ApplicationName.ClassApplicationName); For properties and methods access: $obj-property_name; $obj-method_name; I have used and tested this function and I have obtained success (using PHP on Windows 2000 Server). It work very fine. Regards, Iriton Jonath. - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: Php (E-mail) [EMAIL PROTECTED] Sent: Monday, April 30, 2001 2:57 PM Subject: [PHP] COM Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] COM
Hi Arteaga, I have tested COM objects using PHP Version 4.0.4pl1 on Windows 2000 Server. The COM function mentioned here were implemented recently in PHP engine, so use this version of PHP or later. Of course, your VB COM component must be registered, so Has.HasClass must be a valid OLE programmatic identifier. Regards, Iriton. - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: 'Iriton Jonath P. Andrade' [EMAIL PROTECTED] Sent: Wednesday, May 02, 2001 8:51 AM Subject: RE: [PHP] COM Hi Iriton !! I tested but with errors.. 9 ? php 10 $obj = new COM(Has.HasClass); 11 echo $obj-Hello(Hi Hassan); 12 ? This is only VB component Hello return the string entered as var...I receive this error.. Parse error: parse error in C:\Inetpub\wwwroot\myphp\com.php on line 10 Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -Original Message- From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 02, 2001 8:31 AM To: Hassan Arteaga Subject: Re: [PHP] COM Hi Arteaga, Instead of using that functions, use the new one shown bellow: For instantiate an COM object in PHP: $obj = new COM(ApplicationName.ClassApplicationName); For properties and methods access: $obj-property_name; $obj-method_name; I have used and tested this function and I have obtained success (using PHP on Windows 2000 Server). It work very fine. Regards, Iriton Jonath. - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: Php (E-mail) [EMAIL PROTECTED] Sent: Monday, April 30, 2001 2:57 PM Subject: [PHP] COM Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] COM
Hi Arteaga, Instead of using that functions, use the new one shown bellow: For instantiate an COM object in PHP: $obj = new COM(ApplicationName.ClassApplicationName); For properties and methods access: $obj-property_name; $obj-method_name; I have used and tested this function and I have obtained success (using PHP on Windows 2000 Server). It work very fine. Regards, Iriton Jonath. - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: Php (E-mail) [EMAIL PROTECTED] Sent: Monday, April 30, 2001 2:57 PM Subject: [PHP] COM Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] COM
Ohhh!!!I installed the last version..and now ..this simple code ?php $cad=Hassan; echo $cad; ? I can't see nothing... -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -Original Message- From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 02, 2001 10:50 AM To: Hassan Arteaga Cc: [EMAIL PROTECTED] Subject: Re: [PHP] COM Hi Arteaga, I have tested COM objects using PHP Version 4.0.4pl1 on Windows 2000 Server. The COM function mentioned here were implemented recently in PHP engine, so use this version of PHP or later. Of course, your VB COM component must be registered, so Has.HasClass must be a valid OLE programmatic identifier. Regards, Iriton. - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: 'Iriton Jonath P. Andrade' [EMAIL PROTECTED] Sent: Wednesday, May 02, 2001 8:51 AM Subject: RE: [PHP] COM Hi Iriton !! I tested but with errors.. 9 ? php 10 $obj = new COM(Has.HasClass); 11 echo $obj-Hello(Hi Hassan); 12 ? This is only VB component Hello return the string entered as var...I receive this error.. Parse error: parse error in C:\Inetpub\wwwroot\myphp\com.php on line 10 Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -Original Message- From: Iriton Jonath P. Andrade [mailto:[EMAIL PROTECTED]] Sent: Wednesday, May 02, 2001 8:31 AM To: Hassan Arteaga Subject: Re: [PHP] COM Hi Arteaga, Instead of using that functions, use the new one shown bellow: For instantiate an COM object in PHP: $obj = new COM(ApplicationName.ClassApplicationName); For properties and methods access: $obj-property_name; $obj-method_name; I have used and tested this function and I have obtained success (using PHP on Windows 2000 Server). It work very fine. Regards, Iriton Jonath. - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: Php (E-mail) [EMAIL PROTECTED] Sent: Monday, April 30, 2001 2:57 PM Subject: [PHP] COM Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM
Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] COM
Unfortunately VB 6.0 com components do not like to work outside of their ASP and VB bases. I've heard of a few people trying it, but I heard it was very difficult. I'd help more, but I've never used PHP with com, only with ASP Chris Anderson aka Null PHP Developer / Nulltech PHP-GTK Grunt / gtk.php.net STA-DoD, TO and DDay Administrator / www.stronger.org DOD Co-Owner / www.dayofdefeat.com Zeroping Staff Member / www.zeroping.com Volition Programmer / www.Volition-net.com - Original Message - From: Hassan Arteaga [EMAIL PROTECTED] To: Php (E-mail) [EMAIL PROTECTED] Sent: Monday, April 30, 2001 1:57 PM Subject: [PHP] COM Hi all !! I have components i made in Visual Basic 6.0 and I would like to use with PHP. I need examples how to create intance from VB COM component... What function I have to use ? com_load - ??? com_invoke - ??? com_propget - ??? com_get - ??? com_propput - ??? com_propset - ??? com_set - ??? Thanks in advanced !!! -- M. Sc. Hassan Arteaga Rodríguez Microsoft Certified System Engineer Network Admin, WEB Programmer FUNDYCS, Ltd [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM-Functions
Hello list! Does anybody know some sources to read about the COM-Functions in PHP? We wan't to develop some tools to generate INCOMES out of a web application? Only found some lines on phpbuilder, but that's not really enough to get started! Thanx -- Jochen Kaechelin - Ihr WEBberater Stuttgarter Str.3, D-73033 Goeppingen Tel. 07161-92 95 94, Fax 07161-92 95 98 http://www.wa-p.de, mailto:[EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Revised [PHP] COM and PHP
On Mon, Feb 05, 2001 at 03:05:24PM -0500, Conover, Ryan wrote: I have been trying the following example from the PHP developer's cookbook and it keeps giving me the following error. Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5 ? //line 1 $excel_handle = new COM("excel.application"); //line2 $excel_handle-Visible = false; //line3 $worksheet = $excel_handle-workbooks-add(); //line4 $worksheet-Cells(1,1)-value = "Name"; //line5 $worksheet-SaveAs("temp.xls"); //line6 $excel_handle-quit(); //line7 //line8 ? //line9 Anyone that has Com and PHP experience help please I didn't test it in PHP (only in wscript.exe), but it seems the example is wrong. It should be (line 4 - 4a, 4b): excel_handle = new COM("Excel.Application"); //line2 excel_handle.Visible = true; //line3 workbook = excel_handle.Workbooks.Add(); //4a worksheet=workbook.WorkSheets.Add(); //4b worksheet.Cells(1,1).Value = "Name"; //line5 worksheet.SaveAs("temp.xls"); //line6 excel_handle.quit(); //line7 This seems to work. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Re: [PHP-WIN] Re: [PHP] Revised [PHP] COM and PHP
Among other articles, look at the COM functions in PHP4 article: http://www.phpbuilder.com/columns/ Alain On Wed, Feb 28, 2001 at 11:35:15AM +0100, Daniel Tryba wrote: On Mon, Feb 05, 2001 at 03:05:24PM -0500, Conover, Ryan wrote: I have been trying the following example from the PHP developer's cookbook and it keeps giving me the following error. Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5 ? //line 1 $excel_handle = new COM("excel.application"); //line2 $excel_handle-Visible = false; //line3 $worksheet = $excel_handle-workbooks-add(); //line4 $worksheet-Cells(1,1)-value = "Name"; //line5 $worksheet-SaveAs("temp.xls"); //line6 $excel_handle-quit(); //line7 //line8 ? //line9 Anyone that has Com and PHP experience help please I didn't test it in PHP (only in wscript.exe), but it seems the example is wrong. It should be (line 4 - 4a, 4b): excel_handle = new COM("Excel.Application"); //line2 excel_handle.Visible = true; //line3 workbook = excel_handle.Workbooks.Add(); //4a worksheet=workbook.WorkSheets.Add(); //4b worksheet.Cells(1,1).Value = "Name"; //line5 worksheet.SaveAs("temp.xls"); //line6 excel_handle.quit(); //line7 This seems to work. -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] COM vs ???
I would like make some componnent on linux wich I can use on php. Like I create a COM object on Windows and use it with a asp pages and reuse it in a vb application without code duplicate, I would like install PHP on a linux and not on a Windows. Things you need to search for and read up on: PEAR http://conf.php.net has samples at the end of some of Rasmus' talks about how to do this. But these will only integrate to PHP, not to other software. DSO -- This is the Un*x moral equivalent of DLLs, so if you want your Library available to PHP *and* other programs, you'll need to use this. PS Don't ask me for more details -- This is pretty much the full extent of my knowledge. I know which way to point you, but I've never been down that road. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM vs ???
Hello, I would like make some componnent on linux wich I can use on php. Like I create a COM object on Windows and use it with a asp pages and reuse it in a vb application without code duplicate, I would like install PHP on a linux and not on a Windows. Thanks Have a nice day Ghislain
Re: [PHP] COM?
Does Anyone know what needs to be installed on the server other than php 4.0.4 and IIS to instantiate COM Objects like Excel and word. If Excel and Word are COM objects, that's pretty much it, I should think... What magical incantation you have to type into: $word = new COM("C:/path/to/word.exe???"); to make it work, I dunno. PS Posting the same message multiple times doesn't help you much... Just makes more noise. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] COM?
The magical incantations: "Word.Application" etc.. - Original Message - From: "Richard Lynch" [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Thursday, February 08, 2001 10:31 AM Subject: Re: [PHP] COM? Does Anyone know what needs to be installed on the server other than php 4.0.4 and IIS to instantiate COM Objects like Excel and word. If Excel and Word are COM objects, that's pretty much it, I should think... What magical incantation you have to type into: $word = new COM("C:/path/to/word.exe???"); to make it work, I dunno. PS Posting the same message multiple times doesn't help you much... Just makes more noise. -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM - get existing instance?
Is it possible to grab a running instance of for example Word? In VisualBasic-words: can you use 'GetObject' instead of 'CreateObject'? The latter is done by : $word = new Com("Word.Application") this creates a NEW instance, however i want to get an already running instance. Possible? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Com
On Wednesday 07 February 2001 11:52, Pavel Kalian wrote: COM of course comes with PHP (but is available on Win only), RTFM on calling COM support... Yes, but there ain't no class "COM". Read the manual section about COM support. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Com
The COM construct was introduced in PHP4 as a replacement for com_* functions to provide something looking similar to MS's syntax AFAIK and it exists and works at least for me and many others. And it behaves more or less like a normal class. Cheers Pavel - Original Message - From: "Christian Reiniger" [EMAIL PROTECTED] To: "php" [EMAIL PROTECTED] Sent: Wednesday, February 07, 2001 12:20 PM Subject: Re: [PHP] Com On Wednesday 07 February 2001 11:52, Pavel Kalian wrote: COM of course comes with PHP (but is available on Win only), RTFM on calling COM support... Yes, but there ain't no class "COM". Read the manual section about COM support. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Com
On Wednesday 07 February 2001 12:40, Pavel Kalian wrote: The COM construct was introduced in PHP4 as a replacement for com_* functions to provide something looking similar to MS's syntax AFAIK and it exists and works at least for me and many others. And it behaves more or less like a normal class. Hmm, it's at least not mentioned in the manual. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] Com
Anyone has good examples for COM usage? D. -Original Message- From: Christian Reiniger [mailto:[EMAIL PROTECTED]] Sent: woensdag 7 februari 2001 12:48 To: php Subject: Re: [PHP] Com On Wednesday 07 February 2001 12:40, Pavel Kalian wrote: The COM construct was introduced in PHP4 as a replacement for com_* functions to provide something looking similar to MS's syntax AFAIK and it exists and works at least for me and many others. And it behaves more or less like a normal class. Hmm, it's at least not mentioned in the manual. -- Christian Reiniger LGDC Webmaster (http://sunsite.dk/lgdc/) "Software is like sex: the best is for free" -- Linus Torvalds -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED] -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] Com
yes. it is all very clear to me now. however self-evident it appears to me now, imagine my disconcertation when i was in ignorance! this is so self-evident, it didn't need to be documented. Com shows up in searches about launching external apps on the client, thus i was nefariously misled by my eagerness and general enslavement to impending authorities. vora - Original Message - From: "Jonathan Sharp" [EMAIL PROTECTED] To: "Vora Vor" [EMAIL PROTECTED] Sent: Tuesday, February 06, 2001 6:17 PM Subject: RE: [PHP] Com Are you trying to access a Windows COM object on a Linux box? -codeboy -Original Message- From: Vora Vor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, February 06, 2001 10:08 AM To: php Subject: [PHP] Com "Fatal error: Cannot instantiate non-existent class: com in /var/www/html/version2/file.php on line 8" is the result of running the following code: ? $word=new COM("word.application") or die("Cannot start word"); print "Loaded word version ($word-Version)\n"; $word-visible =1 ; ? Why? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Com
"Fatal error: Cannot instantiate non-existent class: com in /var/www/html/version2/file.php on line 8" is the result of running the following code: ? $word=new COM("word.application") or die("Cannot start word"); print "Loaded word version ($word-Version)\n"; $word-visible =1 ; ? Why?
[PHP] COM?
Does Anyone know what needs to be installed on the server other than php 4.0.4 and IIS to instantiate COM Objects like Excel and word. Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM and PHP
I have been trying the following example from the PHP developer's cookbook and it keeps giving me the following error. Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 4 ? //line 1 $excel_handle = new COM("excel.application"); //line2 $excel_handle-Visible = false; //line3 $worksheet-Cells(1,1)-value = "Name"; //line4 $worksheet-SaveAs("temp.xls"); //line5 $excel_handle-quit(); //line6 //line7 ? //line8 Anyone that has Com and PHP experience help please Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] Revised [PHP] COM and PHP
I have been trying the following example from the PHP developer's cookbook and it keeps giving me the following error. Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5 ? //line 1 $excel_handle = new COM("excel.application"); //line2 $excel_handle-Visible = false; //line3 $worksheet = $excel_handle-workbooks-add(); //line4 $worksheet-Cells(1,1)-value = "Name"; //line5 $worksheet-SaveAs("temp.xls"); //line6 $excel_handle-quit(); //line7 //line8 ? //line9 Anyone that has Com and PHP experience help please Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] RE: [PHP-WIN] Revised [PHP] COM and PHP
I tried with FALSE same error. I also tried the following word example ? $word = new COM("word.application") or die("Unable to instanciate Word"); print "Loaded Word, version {$word-Version}\n"; $word-Visible = 0; $word-Documents-Add(); $word-Selection-TypeText("Testing, testing... 1,2,3"); $word-Documents[1]-SaveAs("Some.doc"); $word-Quit(); ? I get the following error Loaded Word, version 9.0 Warning: Invoke() failed: No description available in c:\Inetpub\wwwroot/temp2.php on line 5 Warning: Invoke() failed: Exception occurred. in c:\Inetpub\wwwroot/temp2.php on line 7 That means that you don't have the com component installed on your machine correctly... I have been trying the following example from the PHP developer's cookbook and it keeps giving me the following error. Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5 ? file://line 1 $excel_handle = new COM("excel.application"); file://line2 $excel_handle-Visible = false; file://line3 $worksheet = $excel_handle-workbooks-add(); file://line4 $worksheet-Cells(1,1)-value = "Name"; file://line5 This should be: $cell = $worksheet-Cells(1, 1); $cell-value = 1; And it should work.. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] COM Question
Do I need to have anything special installed on the server (IIS) to call excel and word with COM. Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
[PHP] RE: [PHP-WIN] Revised [PHP] COM and PHP
I tried with FALSE same error. I also tried the following word example ? $word = new COM("word.application") or die("Unable to instanciate Word"); print "Loaded Word, version {$word-Version}\n"; $word-Visible = 0; $word-Documents-Add(); $word-Selection-TypeText("Testing, testing... 1,2,3"); $word-Documents[1]-SaveAs("Some.doc"); $word-Quit(); ? I get the following error Loaded Word, version 9.0 Warning: Invoke() failed: No description available in c:\Inetpub\wwwroot/temp2.php on line 5 Warning: Invoke() failed: Exception occurred. in c:\Inetpub\wwwroot/temp2.php on line 7 Ryan -Original Message- From: Andris Jancevskis [mailto:[EMAIL PROTECTED]] Sent: Monday, February 05, 2001 3:01 PM To: Conover, Ryan Subject: Re: [PHP-WIN] Revised [PHP] COM and PHP Try "FALSE" instead of "false" Andris mailto:[EMAIL PROTECTED] +--- Monday, February 05, 2001, 10:05:24 PM, you wrote: I have been trying the following example from the PHP developer's cookbook and it keeps giving me the following error. Parse error: parse error in c:\Inetpub\wwwroot/temp.php on line 5 ? //line 1 $excel_handle = new COM("excel.application"); //line2 $excel_handle-Visible = false; //line3 $worksheet = $excel_handle-workbooks-add(); //line4 $worksheet-Cells(1,1)-value = "Name"; //line5 $worksheet-SaveAs("temp.xls"); //line6 $excel_handle-quit(); //line7 //line8 ? //line9 Anyone that has Com and PHP experience help please Ryan -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]