note 23552 deleted from function.dotnet-load by sobak

From: Date: Tue, 22 Nov 2016 03:45:39 +0000
Subject: note 23552 deleted from function.dotnet-load by sobak
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-207438@lists.php.net to get a copy of this message
Note Submitter: Thomas dot Weidner at voxtronic dot com ---- I`ve found an workaround to use the Microsoft.NET within PHP but without the need of compiling the DOTNET.DLL of PHP. At first write the functions you want to need within PHP in the Microsoft.NET Languages (I`m working in CSharp). Then make your FunctionsLibrary StrongNamed. Read about how to do this in the SDK-Help. (Key, Version...) Then you have to register your DLL in GAC. For this you have to do REGASM /tlb:your.tlb your.dll Then you have to do GACUTIL /if your.dll After this your DLL will be recognised with in the whole .NET. Now... to use your DLL within PHP you just have to use an ordinary COM Object. $MyObj = new COM ("NameSpace.Class"); $ReturnValue = $MyObj -> MyFunction($MyParams); $MyObj = NULL; $MyParams could be any type. For example an Array. I tested this with PHP 4.2.1, RDK-Framework, SDK-Frwamework, Visual Studio and SharpDevelop. You have not to recompile PHP because you don´t need the DOTNET.DLL . The only negative aspect within this way due to COMRestrictions is, that REF or OUT Values are not returned. So you have only one return value. But for an good written function this should be no great restriction. If you have any further question dont be afraid and write to me... Bye Thomas

« previous php.notes (#207438) next »