المساعد الشخصي الرقمي

مشاهدة النسخة كاملة : C# ActiveX DLL, ********** run EXE



C# Programming
11-24-2012, 02:26 AM
Hi,
I've been trying to figure out why this doesn't work but without luck. I've done this based on this tutorial.

Create ActiveX in .NET Step by Step (http://www.codeproject.com/Articles/24089/Create-ActiveX-in-NET-Step-by-Step)[^ (http://www.codeproject.com/Articles/24089/Create-ActiveX-in-NET-Step-by-Step)]

My HTML page with ********** loads all methods from the dll fine but when I try to add a method to execute Windows Calculator for example, nothing happens. Am I missing something that is required to launch executables?

Here's the calculator part from PlayerLoader.cs:

namespace Player.Loader.ActiveXTest { [ProgId("MPC.Loader")] [ClassInterface(ClassInterfaceType.AutoDual), ComSourceInterfaces(typeof(ControlEvents))] [Guid("69F90018-C4AD-456C-A9D1-6E317A5E8AD2")] [ComVisible(true)] public class PlayerLoader { private string myParam = "Empty"; public PlayerLoader() { } ... [ComVisible(true)] public static void LoadPlayer() { Process.Start("calc"); } ...
And the Js.
function LaunchPlayer() { try { var OurActiveX = new ActiveXObject("MPC.Loader"); delete OurActiveX; document.body.innerHTML = '<span class="code-string">