Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / January 2007

Tip: Looking for answers? Try searching our database.

OLE/COM Object Viewer (oleview.exe) Errors

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
JerryWEC - 25 Jan 2007 20:00 GMT
Hi everyone,

I'm getting the following messages while trying to open a .tlb file I'm
generating from VS2005...

Msg1:
MkParseDisplayName(...
""I:\DEV\CLA_Logging\CLA_Logging\bin\Release\CLA_Logging.tlb""...) failed.
Invalid syntax
MK_E_SYNTAX($800401E4)

Msg2:
The command line
("I:\DEV\CLA_Logging\CLA_Logging\bin\Release\CLA_Logging.tlb") does not
contain a valid
persistent OLE object, ProgID, or Type Library file.
Error loading type library /DLL.
TYPE_E_CANTLOADLIBRARY ($80029C4A)

I have added a program id using the following attribute...

<ProgId("CLA_Logging.ComLogging")> _

This attribute is above my ComLogging class that inherits from Logging
class.

Can anyone help me with this issue?

TIA JerryM
Walter Wang [MSFT] - 26 Jan 2007 05:12 GMT
Hi Jerry,

Do you mean that after you added the ProgId attribute, the oleview is no
longer able to view the type library? Does the type library work when
referenced by VB6 project?

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
JerryWEC - 26 Jan 2007 17:08 GMT
Walter,

Yes, I'm still getting this error after I added the prog id.  I was getting
errors before and after adding the prog id.  My current code is below...

<Guid("26014480-5D35-49ed-B83C-1B862BF92517")> _

<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _

Public Interface ILoggingEvents

   <DispId(1)> _

   Sub LogExitDisplayLoggingWindow()

   <DispId(2)> _

   Sub LogErrorOccurred(ByVal outEx As Exception)

End Interface

<Guid("542FA6CF-F2C8-46d3-8601-EF370BBEF146")> _

<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _

Public Interface ILogging

   Property LogToFile() As Boolean

   Property LogToScreen() As Boolean

End Interface

#End Region

<Guid("64439B0F-D1BF-43d7-BCD9-BA908BF2CCF6")> _

<ClassInterface(ClassInterfaceType.None)> _

<ProgId("CLA_Logging.Logging")> _

<ComSourceInterfaces(GetType(ILoggingEvents))> _

Public Class Logging

   Implements IDisposable

   Implements ILogging

   Public Delegate Sub LogExitDisplayLoggingWindowHandler()

   Public Delegate Sub LogErrorOccurredHandler(ByVal outEx As Exception)

   Public Event LogExitDisplayLoggingWindow As
LogExitDisplayLoggingWindowHandler

   Public Event LogErrorOccurred As LogErrorOccurredHandler

   Public Sub New()

       Try

           If m_formInstance Is Nothing Then

               m_formInstance = New frmLogDisplay()

               m_formInstance.ParentLogging = Me

           End If

       Catch ex As Exception

           ProcessException(ex)

       End Try

   End Sub

   Public Property LogToFile() As Boolean Implements ILogging.LogToFile

       Private Get

           Try

               Return m_LogToFile

           Catch ex As Exception

               ProcessException(ex)

           End Try

       End Get

       Set(ByVal value As Boolean)

           Try

               m_LogToFile = value

           Catch ex As Exception

               ProcessException(ex)

           End Try

       End Set

   End Property

   Public Property LogToScreen() As Boolean Implements ILogging.LogToScreen

       Private Get

           Try

               Return m_LogToScreen

           Catch ex As Exception

               ProcessException(ex)

           End Try

       End Get

       Set(ByVal value As Boolean)

           Try

               m_LogToScreen = value

           Catch ex As Exception

               ProcessException(ex)

           End Try

       End Set

   End Property

'*** Other code not shown.

End Class

Great Links:

(Part 1)

http://www.15seconds.com/issue/040721.htm

(Part 2)...

http://www.15seconds.com/issue/060309.htm

http://www.codeproject.com/dotnet/cominterop.asp

...(See Part 2)

Yes Walter I am all over the place on this COM InterOp topic.  It would be
nice to have one good source of docuemntation and code examples of how to
use these attributes and when and where each one is needed, etc...  It still
blows my mind that I can't inherit from a base class and for my derived
class see my public methods, properties and event when exposed via COM
Attributes.  Maybe after I have a working module of the proper and best way
to do COM InterOp I a can explore the "Inheritance Option".

* See newest post named: "COM InterOp - Interace ?s" for continued
descussion's on this topic.

Thanks! JerryM
Walter Wang [MSFT] - 29 Jan 2007 09:24 GMT
Hi Jerry,

Using your code from your other post:

Imports System
Imports System.Runtime.InteropServices
Imports System.Runtime

<Guid("26014480-5D35-49ed-B83C-1B862BF92517")> _
<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface ILoggingEvents
   <DispId(1)> _
   Sub LogExitDisplayLoggingWindow()
   <DispId(2)> _
   Sub LogErrorOccurred(ByVal outEx As Exception)
End Interface

<Guid("542FA6CF-F2C8-46d3-8601-EF370BBEF146")> _
<InterfaceType(ComInterfaceType.InterfaceIsIDispatch)> _
Public Interface ILogging
   Property LogToFile() As Boolean
   Sub Log(ByVal text As String)
End Interface

<Guid("64439B0F-D1BF-43d7-BCD9-BA908BF2CCF6")> _
<ClassInterface(ClassInterfaceType.None)> _
<ProgId("CLA_Logging.Logging")> _
<ComSourceInterfaces(GetType(ILoggingEvents))> _
Public Class Logging
   Implements ILogging
   Implements IDisposable

   Public Delegate Sub LogExitDisplayLoggingWindowHandler()
   Public Delegate Sub LogErrorOccurredHandler(ByVal outEx As Exception)

   Public Event LogExitDisplayLoggingWindow As
LogExitDisplayLoggingWindowHandler
   Public Event LogErrorOccurred As LogErrorOccurredHandler

   Private m_LogToFile As Boolean

   Public Sub New()

   End Sub

   Public Property LogToFile() As Boolean Implements ILogging.LogToFile
       Private Get
           Return m_LogToFile
       End Get

       Set(ByVal value As Boolean)
           m_LogToFile = value
       End Set
   End Property

   Public Sub Log(ByVal text As String) Implements ILogging.Log
       If String.IsNullOrEmpty(text) Then
           Throw New ArgumentException("text cannot be empty")
       End If
   End Sub

   Public Sub Dispose() Implements IDisposable.Dispose

   End Sub
End Class

The generated .tlb file loads correctly by OleView.

Regards,
Walter Wang (wawang@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
JerryWEC - 31 Jan 2007 18:56 GMT
Walter, yes I understand that you have this working. I may have some thing
missing on my workstation.  I'm still getting the same errors.

If anyone else has seen these errors please let me know so I can fix this on
my machine.

TIA, JerryM

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.