jjmusicpro Posted March 19, 2008 Share Posted March 19, 2008 How to use a dll. COM object in php? I dont know the correct syntax... Never used one before.. so if the dll was somedll.dll and how do i create a new instance of that dll? thanks again everyone. Quote Link to comment Share on other sites More sharing options...
lemmin Posted March 19, 2008 Share Posted March 19, 2008 $c = new COM("somedll.dll") or die("Cannot start DLL"); There is a lot of information about the COM object here: http://www.php.net/manual/en/ref.com.php Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted March 19, 2008 Author Share Posted March 19, 2008 Does the DLL have to be in the same folder as the index.php file? Quote Link to comment Share on other sites More sharing options...
trq Posted March 19, 2008 Share Posted March 19, 2008 Does the DLL have to be in the same folder as the index.php file? No, it must be registered on your system. Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted March 19, 2008 Author Share Posted March 19, 2008 ok so now im confused, i called the dll, and i cant figure out how to create a new instance of it, and run a method. here is what i have in asp.net c#, it works UMRAcomLib.Umra _UMRA = new UMRAcomLib.Umra(); _UMRA.SetVariableText("%Customer_First_Name%", firstname); _UMRA.SetVariableText("%Customer_Last_Name%", lastname); _UMRA.SetVariableText("%Customer_Description%", description); _UMRA.ExecuteProjectScript("COM_Add_User"); but how do i do that in php ? here is what i have so far. <?php // UMRA Variables $Your_UMRA_Server = "xxxxx"; // UMRA Server Name $Your_UMRA_Port = "xxxx"; // Default is 56814 $Your_UMRA_DLL_Path = "dll/xxxxxx" //Path to your UMRA DLL $Connection_Status = ""; // Connection to UMRA Status ?> <?php $UMRA_Object =new COM("$Your_UMRA_DLL_Path") or die("Cannot start word for you"); print "Loaded word version ($UMRA_Object->Version)\n"; $UMRA_Object->Umra->Connect("$Your_UMRA_Server",Your_UMRA_Port); if($UMRA_Object->Umra->Connect != 0) { $Connection_Status = "Not Connected"; } else { $Connection_Status = "Connected"; } ?> Quote Link to comment Share on other sites More sharing options...
trq Posted March 19, 2008 Share Posted March 19, 2008 Is the dll registered on the system? Quote Link to comment Share on other sites More sharing options...
jjmusicpro Posted March 19, 2008 Author Share Posted March 19, 2008 yes Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.