views:

156

answers:

3

Hi!

10 years have ellapsed since I used COM/OLE, and I forget 90% of them. Now we need to make a COM object to access some data from PHP/Python (this is specific thing, the php ODBC don't access the output params of a DataBase - like stored proc output), and my idea the I realize a minimal object with one method, and PHP/Python can call this to get the output...

procedure ExecSQL(Config, IP, Port, DBName, SQL, IDFieldName : variant) : output
output is [IDValue, ErrorMsg, HResult] 

Please help me a very little example, how to start it? I need only this, but I'm confused by many ActiveX/COM in the palette. What I need to use to make a simple COM DLL, and how to register my COM object with this DLL?

Thanks: dd

+2  A: 

For COM related applications in Delphi this link is usefull http://www.techvanguards.com/

Bharat
+4  A: 
  1. Select File\New\ActiveX Library - this creates ActiveX DLL project
  2. Select File\New\Automation Object - this creates the type library and implementation
  3. Using the type library editor, add methods/properties to the interface
  4. Write implementation code
  5. Select Run\Register ActiveX Server - this registers the COM server DLL
TOndrej
I would use Regsvr32 to register the COM server, that works on every machine. `regsvr32.exe "path and filename of my com-server"` (add /u to uninstall).
The_Fox
regsvr32 does exactly the same thing as the IDE: loads the dll and calls its exported DllRegisterServer function.On Vista and higher, however, you may need to run this from an elevated process which the IDE is probably not.
TOndrej
I know, but to install the COM server with the IDE you have to have the IDE installed. That's why I recommend regsvr32, because I don't think the development machine = webserver.
The_Fox
It's not hard to make a 'regsvr32' of your own: http://yoy.be/item.asp?i92
Stijn Sanders
A: 

I would also suggest the examples in '..\Demos\DelphiWin32\VCLWin32\ActiveX'.

Sertac Akyuz