Wednesday 15 June 2011

PHP DOTNET Interop with C# Windows Form Application? -



PHP DOTNET Interop with C# Windows Form Application? -

is possible have php interact running c# windows form application?

i've created com exposed dlls before , called them php using dotnet object didn't seem work me "windows form application". need create com dll , have somehow interact windows form application?

edit:

i decided write quick exe in .net3.5 client framework , see if methods available php then. appears run methods now, bizzare! guess possible v3.5 client , not v4.5.

this c# , php code:

c#

using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace example.interop.formtext { public partial class form1 : form { public form1() { initializecomponent(); } public int sum(int a, int b) { homecoming + b; } public int minus(int a, int b) { homecoming - b; } } }

php

<?php $app = new dotnet("example.interop.formtext", "example.interop.formtext.form1"); echo $app->minus(19, 20); ?>

i haven't tested see if can run function interacts ui though. test next, unfortunately don't think can fallback on v3.5 project.

what want this:

out-of-process com component

i did vb6 programme 15 years ago , worked say! had main form, nail asp 3.0 site. had guts of site's app in , served admin, had no problem updating ui either com methods fired.

description link below (this reply useless without due complexity of problem; link includes download sample app. maybe can google text if link dies).

in microsoft windows operating systems, microsoft com technology enables software components communicate other software components. can utilize microsoft com technology create reusable software components. can develop applications linking these components , take advantage of windows services. out-of-process server objects implemented in executable file , run in separate process space.

http://support.microsoft.com/kb/977996

c# php com interop

No comments:

Post a Comment