Facing Error in using COM with PHP

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
psmshankar
Forum Commoner
Posts: 96
Joined: Tue Aug 06, 2002 4:25 am
Location: India

Facing Error in using COM with PHP

Post by psmshankar »

Hi,

I have created one COM DLL using VB and tried to access it in PHP. I am getting error in that.

The following is the coding in the class module in VB:

Public Function ReadSMSMessage()
On Error GoTo ErrorHandler

Call puISMSMemory.Read(SIM_MEMORY, 1, objMsg, 1)

msSMSText = objMsg.UserDataText

Exit Function

ErrorHandler:
AdapterError = puISMSMemory.GetLastError
End Function


The following are the 2 properties to read the value:
Public Property Get SMSMessage() As String
SMSMessage = msSMSText
End Property

Public Property Get ErrorMessage() As String
ErrorMessage = AdapterError
End Property


Following is the php code:
<?
//SMSServer is the dll name and clsReadSMS
//is the class name
1. $objSMS = new COM("SMSServer.clsReadSMS") or die("Unable to instantiate SMS Server component");

2. echo "<br>Successfully loaded the SMS Server component";

3. $objSMS->ReadSMSMessage;
4. $strMsg = $objSMS->SMSMessage";
5. $strErr = $objSMS->ErrorMessage;
6. echo "<br> The message is\n $strMsg";
7. echo "<br> The error is\n $strErr";
?>


Till line number 3 (i commented the rest), no problem. But when i uncommented 4th line it says 'php error'(the normal popup window that says this program has performed an illegal action..blah..blah.. the caption of that pop-up box is 'php') and then it leads to a error page which contains the following:
QUOTE
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, admin@firepages.com.au and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
UNQUOTE


So i checked the apache error log and found only the following as the last error:
QUOTE
[Tue Aug 06 15:57:09 2002] [error] [client 10.100.107.49] File does not exist: c:/phpdev3/www/scripts/..%2f/winnt/system32/cmd.exe
UNQUOTE


I do not know what is the problem.
Please help me in this issue.

Thanks for your time.
Regards
Shankar
Post Reply