Tue, 02/21/2017 - 11:27
#1
Library File Error - "Class Not Registered"
- Hello everyone.
- Sorry for the outline form.
- I was unaware the posting process stripped newline characters from the post.
- The Background -
- We have a Soft Phone application that is written in Delphi (O.O.D. Pascal) for Windows.
- The ability to answer an incoming call by activating the answer button on the Plantronics Wireless Headset was recently requested.
- The MSI files were downloaded and executed, and the Plantronics SDK was downloaded as well and converted / altered into a Delphi Library File.
- I then started to follow the "First Steps" section of the Plantronics website.
- I knew that the "First Steps" code would have to be tweaked to fit the Delphi system.
- The Problem -
- In adjusting the code to work within Delphi, a few translations problems were encountered and resolved.
- One error is proving to be stubborn - when an instance of one specific class is created, the error "Class not registered" is thrown.
- "First Steps" code for reference -
- // Connect to the Plantronics COM API:
- myAppName = "SDK .NET COM sample";
- sessionManager = new COMSessionManager();
- sessionManager.Register(myAppName, out session);
- // Hook to SessionManager events:
- sessionManagerEvents = sessionManager as ICOMSessionManagerEvents_Event;
- if (sessionManagerEvents != null)
- {
- sessionManagerEvents.onCallStateChanged += SessionManagerEvents_onCallStateChanged;
- sessionManagerEvents.onDeviceStateChanged += SessionManagerEvents_onDeviceStateChanged;
- }
- // Connect to the Plantronics COM API:
- Delphi Code -
- // Connect to the Plantronics COM API:
- plugin_name := "Plugin Name";
- the_session := CoCOMSession.Create;
- session_manager := CoCOMSessionManager.Create;
- session_manager.Register(plugin_name, the_session);
- // Hook to Session Manager events:
- state_device_event_args := CoCOMStateDeviceEventArgs.Create;
- call_event_args := CoCOMCallEventArgs.Create;
- // Connect to the Plantronics COM API:
- "First Steps" code for reference -
- The problem is the bold line of the Delphi code.
- A CoCOMSession (the_session), a CoCOMSessionManager (session_manager), and a CoCOMStateDeviceEventArgs (state_device_event_args) objects are created without issue.
- However, attempting to create a CoCOMCallEventArgs object (call_event_args) throws a "Class Not Registered" error, even though it is declared and implemented in the library file along with the other three.
- Excerpts from the Library file:
- Class Declaration:
- IID_ICOMCallEventArgs: TGUID = '{0280956C-C644-4CD8-B124-C8A99E5D505E}';
- CLASS_COMCallEventArgs: TGUID = '{705129C3-2265-4F10-9768-0FF8A20234C0}';
- Class creation function:
- class function CoCOMCallEventArgs.Create: ICOMCallEventArgs;
- begin
- Result := CreateComObject(CLASS_COMCallEventArgs) as ICOMCallEventArgs;
- end;
- Class Declaration:
Add new comment