en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en en eu en en en en nl en en en en en en en en en en en en en en de sl en en en en nl en en en en en en en de en en en fr en en en en en en en en en pt en en en en en en
By logging into your account, you agree to our Privacy Policy, personal data processing and storage practices as described therein.
Forgot password or user name?
Search in titles only Search in Working with Objects only
You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
MS Office COM Addin Port
All Time Today Last Week Last Month
All Discussions only Photos only Videos only Links only Polls only Events only
Join Date: Sep 2007
MS Office COM Addin Port
18 Nov 2008, 12:06 PM
I am about to port a VB COM addin for MS Office to PB. I'm developing on Windows XP with Office 2002/XP.
In VB, you create an ActiveX DLL. It has 1 public class, which implements the IDTExtensibility2 interface in MSADDNDR.DLL. When the Office app starts, it instantiates an instance of the class (based on Registry info). The class has 5 events, from which it receives notice of app startup, new documents, etc. You're working within the Office thread without the security and other hassles of macros.
PB 9's new object compabilities seemed like the answer. Except... Word doesn't seem to like anyway I code it. Just a vague message about a run-time error occurred while loading the COM addin.
I'm wondering if anyone else has tried this. Here's the key addin designer code from COM Browser:
' Interface Name : Int__IDTExtensibility2 ' ClassID : $CLSID_AddInDesignerObjects_Event__IDTExtensibility2 ' ProgID : $PROGID_AddInDesignerObjects_AddinInstance ' Version ProgID : $PROGID_AddInDesignerObjects_AddinInstance1 CLASS Class_Int__IDTExtensibility2 $CLSID_AddInDesignerObjects_Event__IDTExtensibility2 AS EVENT INTERFACE Int__IDTExtensibility2 $IID_AddInDesignerObjects_Int__IDTExtensibility2 INHERIT IDISPATCH METHOD OnConnection   (BYVAL Application AS IDISPATCH, BYVAL ConnectMode AS LONG, BYVAL AddInInst AS IDISPATCH, BYVAL _ custom AS DWORD) ' Insert your code here END METHOD METHOD OnDisconnection   (BYVAL RemoveMode AS LONG, BYVAL custom AS DWORD) ' Insert your code here END METHOD METHOD OnAddInsUpdate   (BYVAL custom AS DWORD) ' Insert your code here END METHOD METHOD OnStartupComplete   (BYVAL custom AS DWORD) ' Insert your code here END METHOD METHOD OnBeginShutdown   (BYVAL custom AS DWORD) ' Insert your code here END METHOD END INTERFACE END CLASS
From my PB DLL, here's the skeleton code for the class which Office instantiates:
I've tried variations on the interface inheritance, with no better results. Any suggestions would be appreciated. Sample code would be manna.
Join Date: Nov 2008
20 Dec 2008, 03:25 PM
Your class does not receiveinterface IDTExtensibility2with operatorINHERIT. I checked.Defineinterface IDTExtensibility2directly in classMyClassName.
Copyright © 1998-2022 PowerBASIC Tools, LLC - All Rights Reserved.
Powered by vBulletin® Version 5.7.0
Copyright © 2022 vBulletin Solutions, Inc. All rights reserved.
All times are GMT-5. This page was generated at 04:40 AM.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.