P
Peter Karlström
ComDefaultInterface in VB.NET for Word 2007 Addin
Hi
I'm in the middle of my first VB.NET Addin-project for Word 2007.
I tried to create a test-deployment using Publish.
When I did that, a set of Warnings came up talking about ClassInterfaceType
and ComDefaultInterface when processing my databound listboxes.
I have looked around on the net a couple of hours, without finding exactly
what I should add to my project.
The setup-files is created, and the installation of the Addin in a client PC
runs fine.
The Addin is loaded when Word is started, but when I open the the form with
the databound items, the app gets reeeealy slow.
The databound items is located in a Windows form, and the top of the
form-code looks like this:
Imports System.Data.OleDb
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Text
Public Class frmNewdoc
Private Sub frmNewdoc_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.TblWSecClassesTableAdapter.Fill(Me.SKBOfficeDBDataSet.tblWSecClasses)
Me.QryDOCplanTableAdapter1.Fill(Me.LangList.qryDOCplan)
Me.QryDOCplanTableAdapter.Fill(Me.MOBList.qryDOCplan)
Me.TblDTPTableAdapter.Fill(Me.DTPList.tblDTP)
Me.TblIHGTableAdapter.Fill(Me.IHGList.tblIHG)
Me.TblIHPTableAdapter.Fill(Me.IHPList.tblIHP)
......
......
......
I know I should put some sort of ClassInterface code to the line with Public
Class frmNewdoc, but I get confused about the syntax and how I should point
my reference to the required items.
The complete warning message looks like this:
Type library exporter warning processing
'SKBMall.MOBList+qryDOCplanDataTable, SKBMall'. Warning: Type library
exporter encountered a type that derives from a generic class and is not
marked as [ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot
be exposed for such types. Consider marking the type with
[ClassInterface(ClassInterfaceType.None)] and exposing an explicit interface
as the default interface to COM using the ComDefaultInterface attribute.
The database is a Access 2007 accdb-file which I connect to with
System.Data.OleDb.
The development environment is Visual Studio 2008 with VB.
Hope anyone have some input on this.
Hi
I'm in the middle of my first VB.NET Addin-project for Word 2007.
I tried to create a test-deployment using Publish.
When I did that, a set of Warnings came up talking about ClassInterfaceType
and ComDefaultInterface when processing my databound listboxes.
I have looked around on the net a couple of hours, without finding exactly
what I should add to my project.
The setup-files is created, and the installation of the Addin in a client PC
runs fine.
The Addin is loaded when Word is started, but when I open the the form with
the databound items, the app gets reeeealy slow.
The databound items is located in a Windows form, and the top of the
form-code looks like this:
Imports System.Data.OleDb
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Text
Public Class frmNewdoc
Private Sub frmNewdoc_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Me.TblWSecClassesTableAdapter.Fill(Me.SKBOfficeDBDataSet.tblWSecClasses)
Me.QryDOCplanTableAdapter1.Fill(Me.LangList.qryDOCplan)
Me.QryDOCplanTableAdapter.Fill(Me.MOBList.qryDOCplan)
Me.TblDTPTableAdapter.Fill(Me.DTPList.tblDTP)
Me.TblIHGTableAdapter.Fill(Me.IHGList.tblIHG)
Me.TblIHPTableAdapter.Fill(Me.IHPList.tblIHP)
......
......
......
I know I should put some sort of ClassInterface code to the line with Public
Class frmNewdoc, but I get confused about the syntax and how I should point
my reference to the required items.
The complete warning message looks like this:
Type library exporter warning processing
'SKBMall.MOBList+qryDOCplanDataTable, SKBMall'. Warning: Type library
exporter encountered a type that derives from a generic class and is not
marked as [ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot
be exposed for such types. Consider marking the type with
[ClassInterface(ClassInterfaceType.None)] and exposing an explicit interface
as the default interface to COM using the ComDefaultInterface attribute.
The database is a Access 2007 accdb-file which I connect to with
System.Data.OleDb.
The development environment is Visual Studio 2008 with VB.
Hope anyone have some input on this.