简体   繁体   中英

PHP & Delphi COM+ DLL & Serial port

That's my most recent problem...

I have here some legacy COM+ DLLs that were developed using Delphi 5. One of those DLLs has a method to write stuff on COM Serial ports using the following code:

AssignFile(fport,'COM1');
Rewrite(fport);
Write(fport,'some command');
CloseFile(fport);

When we started coding the front end to use PHP, we used a WebService on IIS to access the COM+ DLL. I didn't know then that I could use the COM class in PHP to do it. But it was working fine.

So today I changed the php to use the COM class and got rid of the IIS. The DLL is called, the function is executed, but the serial port communication does not work at all. I tried to put some try..except on Delphi code but no exception is thrown.

Maybe is something related to privileges that php process doesn't have to access the serial port?

Thanks in advance for any clue!

The DLL was registered on the machine using regsvr32 and there was the error. I installed it into the Component Services and everything is OK now.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM