PR# 5445 Cannot create delegate for Excel interop callback
Problem Report Summary
Submitter: peter_gummer
Category: EiffelStudio
Priority: High
Date: 2005/08/16
Class: Bug
Severity: Critical
Number: 5445
Release: 5.6.1204
Confidential: No
Status: Open
Responsible: manus_eiffel
Environment: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.10) Gecko/20050716 Firefox/1.0.6
Synopsis: Cannot create delegate for Excel interop callback
Description
This is a follow-up to problem report 5444. It appears to be a separate bug, so I'm submitting a new report. I've tried to get around Eiffel's inability to create a delegate for Excel interop callbacks by creating the delegate via reflection. I can't get this to work either. The code below fails with "Object reference not set to an instance of an object" on the indicated line. Given that $added_new_workbook is not Void, I don't know why this would think there is a null reference.
To Reproduce
added_new_workbook (wb: EXCEL_WORKBOOK) is do {WINFORMS_MESSAGE_BOX}.show ("Added workbook", "Hello").do_nothing end listen_for_added_new_workbook is -- Add an event handler for adding a workbook. local type: SYSTEM_TYPE constructors: NATIVE_ARRAY [CONSTRUCTOR_INFO] constructor: CONSTRUCTOR_INFO args: NATIVE_ARRAY [SYSTEM_OBJECT] event: EXCEL_APP_EVENTS_NEW_WORKBOOK_EVENT_HANDLER do type := {EXCEL_APP_EVENTS_NEW_WORKBOOK_EVENT_HANDLER} constructors := type.get_constructors check constructors.count = 1 end constructor := constructors.item (0) check constructor.is_public and not constructor.is_static end create args.make (2) args.put (0, Current) *EXCEPTION --> args.put (1, $added_new_workbook) event ?= constructor.invoke (args) excel.add_new_workbook (event) end
Problem Report Interactions