Attach event to dynamic object

前端 未结 3 502
情深已故
情深已故 2021-01-12 08:41

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

dynamic pdfCreator = Activator.CreateInstance(
                       Type.GetTypeFromProg         


        
3条回答
  •  余生分开走
    2021-01-12 09:31

    I ended up using following as other options did not work. You might have to use generic of < T > if your EventHandler is a generic

    pdfCreator.eReady += new System.EventHandler(_PDFCreator_eReady);
    

提交回复
热议问题