Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7021333
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:26:09+00:00 2026-05-27T23:26:09+00:00

I create a c# dynamic object of a COM-Object on the fallowing way: dynamic

  • 0

I create a c# dynamic object of a COM-Object on the fallowing way:

dynamic pdfCreator = Activator.CreateInstance(
                       Type.GetTypeFromProgID("PDFCreator.clsPDFCreator"));

The class clsPDFCreator is defining an event calling eReady. But when I try to register an Eventhandler like

pdfCreator.eReady += _PDFCreator_eReady;

I get the error message “Operator ‘+=’ cannot be applied to operands of type ‘dynamic’ and ‘method group'”.

How can i register an EventHandler to an Event which is declared of a dynamic object?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:26:10+00:00Added an answer on May 27, 2026 at 11:26 pm

    How about this:

    public delegate void eReadyHandler();
    
    static void Main(string[] args)
    {
        var comType = Type.GetTypeFromProgID("PDFCreator.clsPDFCreator");
        dynamic pdfCreator = Activator.CreateInstance(comType);
        //dynamic pdfCreator = new PDFCreator.clsPDFCreator();
    
        //pdfCreator.eReady = null;
        pdfCreator.eReady += new eReadyHandler(_PDFCreator_eReady);
    }
    
    public static void _PDFCreator_eReady()
    {
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How do I create a dynamic COM/OLE/ActiveX object in C# 4.0 from a program
Microsoft shows how to create a dynamic class here: http://msdn.microsoft.com/en-us/library/system.reflection.emit.modulebuilder(v=vs.71).aspx This defines a custom
I just wanna ask if there's a way in C#/ASP.NET to create 'dynamic' tables/fields
can any body have idea for create dynamic class at run time.i have one
How can I create a new List<T> where the T is a dynamic Type
I'd like to be able to create dynamic menus associated with certain object. Let’s
I create dynamic LinkButton and I add LinkButton's Click Trigger to UpdatePanel. Now, When
I want to create dynamic content based on this. I know it's somewhere, as
How to create dynamic label and button in flex 3?
How does one create Dynamic CSS and JavaScript On-The-Fly (using PHP). This needs to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.