Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
A

aymen Tn

@aymen Tn
About
Posts
9
Topics
4
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Subscribe to an event through COM GetEvent return null
    A aymen Tn

    Hi Thanks for the answer. I already tried that but it's not working :(

    C# help com json

  • Subscribe to an event through COM GetEvent return null
    A aymen Tn

    Hi I'm having a source code of an Api, but since we don't have to change it. I'm creating a windows service that register it as a COM component then it could be used from the client. I'll try to simplify my issue. I started with the creation of an interface having the function and an event (that uses delegate)

    [Guid(ApiServices.InterfaceId), ComVisible(true)]
    public interface IApiServices
    {
    [DispId(1)]
    ApiResult Function1();

     \[DispId(2)\]
     event TestEvent event1;
    

    }

    Then I created a class that implements this inteface

     \[
     Guid(ClassId), ComVisible(true)
     ClassInterface(ClassInterfaceType.None)
     ProgId("ApiService")   
     \]
    

    public class ImplApiServices : MarshalByRefObject, IApiServices
    {
    private ApiObject _apiObject;

    public ImplApiServices ()
    {
    _apiObject= new ApiObject();
    _apiObject.TestEvent += OnEvent1;
    }

    ApiResult Function1()
    {
    return _apiObject.Function1();
    }

    public event TestEvent event1;

    private void OnEvent1(object e)
    {
    if (event1 != null)
    event1(e);
    }
    }

    And then I did all the other steps to register it as a COM component and launch use it through a service. when I call it using a client, it is recognized and the function returns the result perfectly

    var _apiServiceObjType= Type.GetTypeFromProgID("ApiService");
    var _apiServiceObj= Activator.CreateInstance(_apiServiceObjType);

    var result = (ApiResult )_apiServiceObjType.InvokeMember("Function1",
    BindingFlags.InvokeMethod, null, _apiServiceObj, null);

    But when I want to subscribe a method to the event, I get a null eventInfo in the following instruction and can't go further

    EventInfo eventInfo = _apiServiceObjType.GetEvent(event1);

    Any link or recommendation that helps with this kind of problem is welcome. Thanks

    C# help com json

  • Disable Windows Navigation
    A aymen Tn

    Hello Thanks for your reply. but with this solution the windows expolorer still work, for example when I push the keybord start button it still works, What I want to do is to diable all windows fonctionnality (like Windows +E ....) Thanks

    C# csharp visual-studio wpf security question

  • Disable Windows Navigation
    A aymen Tn

    Hi I'm developing a wpf application using visual studio 2010 in c#. for security reason, the navigation in the operating system is not allowed while running the application. That means once it is launched, all Windows menu, icons, toolbars ... must be hidden, and only the application must appear. (it's a kind of that the PC becomes only dedicated to it). Any suggestion or Idea ? Thanks in advance

    C# csharp visual-studio wpf security question

  • Windows Mobile
    A aymen Tn

    Hi Sorry I reposted because I found that I did the first in the wrong place

    Hardware & Devices help question

  • Windows Mobile
    A aymen Tn

    Hi thanks for the answer,apparently this is for windows phone, I'm using a smart device, windows mobile version 6

    C# help question

  • Windows Mobile
    A aymen Tn

    Hi I'm using the mobile 6 version, visual studio 2008, .NEt 3.5

    C# help question

  • Windows Mobile
    A aymen Tn

    Hi I'm working on improving a GUI on an application, I have a tabconrol with many pages, I want to put a background Image instead of the unique color which appear behind, I didn't find any property to do it .. Is there any way ?? your help is really appreciated, thanks

    C# help question

  • Windows Mobile
    A aymen Tn

    Hi I'm working on improving a GUI on an application, I have a tabconrol with many pages, I want to put a background Image instead of the unique color which appear behind, I didn't find any property to do it .. Is there any way ?? your help is really appreciated, thanks

    Hardware & Devices help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups