5

I need pass data (in this case just a single id) to a custom dll using php. Can you work directly with a dll in php? Having never worked with a dll before I'm not really sure how it works. Is it similar in nature to a web service or rpc?

Ronn
  • 1,723
  • 4
  • 27
  • 37

2 Answers2

7

Since this is a custom DLL, perhaps you'd consider making a PHP extension?

Alternatively, PHP supports COM. If you can make a COM DLL, you're in good shape: http://us.php.net/COM

Finally, is it something that can be used with rundll32? If so, you could call it with exec().

user187291
  • 50,823
  • 18
  • 89
  • 127
Brad
  • 146,404
  • 44
  • 300
  • 476
  • It's not my dll, should i suggest that the dll be exposed as a com object? not sure if that's the right terminology – Ronn Jun 14 '11 at 14:26
3

There is a number of windows specific extensions in PHP (COM, .NET, …). See the Manual for

One likely candidate might be the w32Api pecl extension:

This extension is a generic extension API to DLLs. This was originally written to allow access to the Win32 API from PHP, although you can also access other functions exported via other DLLs.

Most of them are marked as experimental though.

Gordon
  • 296,205
  • 68
  • 508
  • 534