Re: [PHP] COM - Assigning to method.

2013-07-24 Thread Richard Quadling
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.

2013-07-15 Thread Adam Nicholls
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.

2013-07-15 Thread Přemysl Fiala

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.

2013-07-15 Thread Andrew Ballard
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.

2013-07-14 Thread Adam Nicholls
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.

2013-07-14 Thread Andrew Ballard
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.

2013-07-13 Thread Richard Quadling
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


Re: [PHP] COM - Assigning to method.

2013-07-12 Thread Andrew Ballard
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


Re: [PHP] COM and the PHP equivalent of ASP Currency data type

2008-12-04 Thread Jochem Maas
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



Re: [PHP] COM and VARIANT types

2008-11-04 Thread Alex Bovey
 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



Re: [PHP] COM and VARIANT types

2008-11-03 Thread Andrew Ballard
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



Re: [PHP] COM works on NT but fails on 2003?

2005-04-11 Thread Jason Wong
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



Re: [PHP] COM(Excel.Sheet)

2003-08-20 Thread David Otton
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



Re: [PHP] com obj from php

2003-08-14 Thread Stephen Holly
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

2003-08-14 Thread Jay Blanchard
[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

2003-08-10 Thread Stephen Holly
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

2003-08-09 Thread Jay Blanchard
[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

2003-03-31 Thread jon roig
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] Re: PHP+COM (formating excel)

2003-02-28 Thread DJ GJ
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)

2003-02-28 Thread DJ GJ
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)

2003-02-28 Thread John W. Holmes
 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



Re: [PHP] COM question

2003-01-10 Thread Marek Kilimajer
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] Re: PHP COM with Distiller

2002-02-26 Thread J Wynia

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

2002-02-26 Thread Kumar


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




RE: [PHP] COM

2001-05-02 Thread Hassan Arteaga


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

2001-05-02 Thread Hassan Arteaga

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

2001-05-02 Thread Iriton Jonath P. Andrade

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

2001-05-02 Thread Iriton Jonath P. Andrade

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

2001-05-02 Thread Hassan Arteaga


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]




Re: [PHP] COM

2001-04-30 Thread Chris Anderson

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]




Re: [PHP] COM vs ???

2001-02-15 Thread Richard Lynch

 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]




Re: [PHP] COM?

2001-02-08 Thread Richard Lynch

 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?

2001-02-08 Thread Tim Knip

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]




Re: [PHP] Com

2001-02-07 Thread Christian Reiniger

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

2001-02-07 Thread Pavel Kalian

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

2001-02-07 Thread Christian Reiniger

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

2001-02-07 Thread Dominick Vansevenant

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

2001-02-07 Thread Vora Vor

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]