.NET

Reply
*Matthew
Message 1 of 11 (139 Views)

Strong name

139 Views, 10 Replies
07-22-2005 01:18 PM
I am a beginner to VB, so this may be a dumb question. I have no strong name
selection. I am trying to be able to run this from autolisp.

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dndotnet/html/callcomcomp.asp
under "Create a Key Pair and Sign the Assembly" Step # 3. I have no Strong
name property page.
how do I get one? Is there another way?

Thnaks
Matthew
Distinguished Contributor
thenrich
Posts: 267
Registered: ‎12-03-2003
Message 2 of 11 (139 Views)

Re: Strong name

07-25-2005 06:24 AM in reply to: *Matthew
What are you trying to call from LISP and why are you trying to put a COM wrapper around a .NET solution?
*Matthew
Message 3 of 11 (139 Views)

Re: Strong name

07-25-2005 07:42 AM in reply to: *Matthew
I am working with a pre net enabled release of AutoCAD. I am good with lisp,
just trying to make the transition slowly. or see how the two can work
together? I suppose I could purchase a downgrade to a previous version of
VB. I thought it would be easier to focus on the .net version rather than
try to figure out how to do it the old way as well.


Matthew


wrote in message news:4909930@discussion.autodesk.com...
What are you trying to call from LISP and why are you trying to put a COM
wrapper around a .NET solution?
Distinguished Contributor
thenrich
Posts: 267
Registered: ‎12-03-2003
Message 4 of 11 (139 Views)

Re: Strong name

07-25-2005 07:46 AM in reply to: *Matthew
You can just compile your .NET app and call a shell. You don't need to convert it to a COM app to use it.
*Matthew
Message 5 of 11 (139 Views)

Re: Strong name

07-25-2005 08:04 AM in reply to: *Matthew
if you could also read the above post vla-object with no properties or
methods. Compiling that same class library would work if I used it from
VBA. It will not work from lisp.

How do I call a shell?

Thanks.
Matthew

wrote in message news:4910050@discussion.autodesk.com...
You can just compile your .NET app and call a shell. You don't need to
convert it to a COM app to use it.
Distinguished Contributor
thenrich
Posts: 267
Registered: ‎12-03-2003
Message 6 of 11 (139 Views)

Re: Strong name

07-25-2005 08:19 AM in reply to: *Matthew
If you actaully want to access a .NET class then yes you will have to put a COM wrapper around it which does need a Strongly typed key
*Matthew
Message 7 of 11 (139 Views)

Re: Strong name

07-25-2005 09:28 AM in reply to: *Matthew
I'm just working through that file I posted from the msdn help file. that is
about all I know about the subject. I have been working with .net since
june. is there something else I can do? I can try to do it withoout the
other functions from the bat file.

thanks.
Matthew
wrote in message news:4910075@discussion.autodesk.com...
If you actaully want to access a .NET class then yes you will have to put a
COM wrapper around it which does need a Strongly typed key
Distinguished Contributor
thenrich
Posts: 267
Registered: ‎12-03-2003
Message 8 of 11 (139 Views)

Re: Strong name

07-25-2005 09:31 AM in reply to: *Matthew
not really
sorry.
Distinguished Contributor
ChrisArps
Posts: 311
Registered: ‎07-29-2004
Message 9 of 11 (139 Views)

Re: Strong name

07-26-2005 06:03 AM in reply to: *Matthew
To strongly name your assembly see http://andrewconnell.com/blog/archive/2004/12/15/772.aspx

You can wrap com around dotnet and use it from lisp, it works just fine. It beats the heck out of using DCL or VBA for forms.

I used it from lisp to kick a splash screen and get the CLR up and running.

Here is some VB.net code created as a new class and called AmerXSplashScreen. I have blanked out the GUID's so they don't conflict with my com object, so you will have to generate your own in the dotnet UI. Be sure you have "Register for COM Interop" checked on the build tab.

You can strongly name the assembly and install it to the GAC so Autocad can find it, or you can copy the assembly to the Autocad Program directory (good for quick development).

Option Strict On
Option Explicit On

Imports System.Runtime.InteropServices

_
Public Class AmerXSplashScreen
Implements IDisposable
' Track whether Dispose has been called.
Private mDisposed As Boolean = False

Private mFSplash As FSplashScreen


#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
' NOTE: I have blanked these out, get your own id's from the UI
Public Const ClassId As String = "********-9B28-4A2C-BBCF-0B18F857A791"
Public Const InterfaceId As String = "********-42EC-49FD-875C-91072BE5B18A"
Public Const EventsId As String = "********-A458-48AD-83C8-36B6FE589DF7"
#End Region

' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub

' Show the splash screen to the world. Will kick the CLR as a side benifit
Public Sub Show()
Try
mFSplash = New FSplashScreen()
With mFSplash
.ShowDialog()
End With
Catch ex As Exception
Trace.Fail(ex.Message, ex.StackTrace)
End Try
End Sub


' Implement IDisposable.
' Do not make this method virtual.
' A derived class should not be able to override this method.
Public Overloads Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
' This object will be cleaned up by the Dispose method.
' Therefore, you should call GC.SupressFinalize to
' take this object off the finalization queue
' and prevent finalization code for this object
' from executing a second time.
GC.SuppressFinalize(Me)
End Sub

' Dispose(bool disposing) executes in two distinct scenarios.
' If disposing equals true, the method has been called directly
' or indirectly by a user's code. Managed and unmanaged resources
' can be disposed.
' If disposing equals false, the method has been called by the
' runtime from inside the finalizer and you should not reference
' other objects. Only unmanaged resources can be disposed.
Private Overloads Sub Dispose(ByVal disposing As Boolean)
' Check to see if Dispose has already been called.
If Not Me.mDisposed Then
' If disposing equals true, dispose all managed
' and unmanaged resources.
If disposing Then
'Dispose of all child .NET objects here
If Not mFSplash Is Nothing Then
mFSplash.Dispose()
End If

End If
' Call the appropriate methods to clean up
' unmanaged resources here.
' If disposing is false,
' only the following code is executed.
' Release any memory held outside of the CLR


'Because the CLR is not always running when called from an ARX,
'Force a GC, will not get another chance later.
'NOTE!! only call this from the main dispose method of the COM object. DO NOT call
'in the child dispose methods.
GC.Collect()

End If
'Mark disposed to indicate that we are done, prevent us from disposing twice.
mDisposed = True

End Sub
' This finalizer will run only if the Dispose method
' does not get called.
' It gives your base class the opportunity to finalize.
' Do not provide finalize methods in types derived from this class.
Protected Overrides Sub Finalize()
' Do not re-create Dispose clean-up code here.
' Calling Dispose(false) is optimal in terms of
' readability and maintainability.
Dispose(False)
MyBase.Finalize()
End Sub
End Class
*Matthew
Message 10 of 11 (139 Views)

Re: Strong name

07-26-2005 05:06 PM in reply to: *Matthew
Thanks guys, I got it to work. But now how do I release the dll from memory?

Matthew

wrote in message news:4910970@discussion.autodesk.com...
To strongly name your assembly see
http://andrewconnell.com/blog/archive/2004/12/15/772.aspx

You can wrap com around dotnet and use it from lisp, it works just fine. It
beats the heck out of using DCL or VBA for forms.

I used it from lisp to kick a splash screen and get the CLR up and running.

Here is some VB.net code created as a new class and called
AmerXSplashScreen. I have blanked out the GUID's so they don't conflict
with my com object, so you will have to generate your own in the dotnet UI.
Be sure you have "Register for COM Interop" checked on the build tab.

You can strongly name the assembly and install it to the GAC so Autocad can
find it, or you can copy the assembly to the Autocad Program directory (good
for quick development).

Option Strict On
Option Explicit On

Imports System.Runtime.InteropServices

AmerXSplashScreen.EventsId)> _
Public Class AmerXSplashScreen
Implements IDisposable
' Track whether Dispose has been called.
Private mDisposed As Boolean = False

Private mFSplash As FSplashScreen


#Region "COM GUIDs"
' These GUIDs provide the COM identity for this class
' and its COM interfaces. If you change them, existing
' clients will no longer be able to access the class.
' NOTE: I have blanked these out, get your own id's from the UI
Public Const ClassId As String = "********-9B28-4A2C-BBCF-0B18F857A791"
Public Const InterfaceId As String =
"********-42EC-49FD-875C-91072BE5B18A"
Public Const EventsId As String = "********-A458-48AD-83C8-36B6FE589DF7"
#End Region

' A creatable COM class must have a Public Sub New()
' with no parameters, otherwise, the class will not be
' registered in the COM registry and cannot be created
' via CreateObject.
Public Sub New()
MyBase.New()
End Sub

' Show the splash screen to the world. Will kick the CLR as a side
benifit
Public Sub Show()
Try
mFSplash = New FSplashScreen()
With mFSplash
.ShowDialog()
End With
Catch ex As Exception
Trace.Fail(ex.Message, ex.StackTrace)
End Try
End Sub


' Implement IDisposable.
' Do not make this method virtual.
' A derived class should not be able to override this method.
Public Overloads Sub Dispose() Implements IDisposable.Dispose
Dispose(True)
' This object will be cleaned up by the Dispose method.
' Therefore, you should call GC.SupressFinalize to
' take this object off the finalization queue
' and prevent finalization code for this object
' from executing a second time.
GC.SuppressFinalize(Me)
End Sub

' Dispose(bool disposing) executes in two distinct scenarios.
' If disposing equals true, the method has been called directly
' or indirectly by a user's code. Managed and unmanaged resources
' can be disposed.
' If disposing equals false, the method has been called by the
' runtime from inside the finalizer and you should not reference
' other objects. Only unmanaged resources can be disposed.
Private Overloads Sub Dispose(ByVal disposing As Boolean)
' Check to see if Dispose has already been called.
If Not Me.mDisposed Then
' If disposing equals true, dispose all managed
' and unmanaged resources.
If disposing Then
'Dispose of all child .NET objects here
If Not mFSplash Is Nothing Then
mFSplash.Dispose()
End If

End If
' Call the appropriate methods to clean up
' unmanaged resources here.
' If disposing is false,
' only the following code is executed.
' Release any memory held outside of the CLR


'Because the CLR is not always running when called from an ARX,
'Force a GC, will not get another chance later.
'NOTE!! only call this from the main dispose method of the COM
object. DO NOT call
'in the child dispose methods.
GC.Collect()

End If
'Mark disposed to indicate that we are done, prevent us from
disposing twice.
mDisposed = True

End Sub
' This finalizer will run only if the Dispose method
' does not get called.
' It gives your base class the opportunity to finalize.
' Do not provide finalize methods in types derived from this class.
Protected Overrides Sub Finalize()
' Do not re-create Dispose clean-up code here.
' Calling Dispose(false) is optimal in terms of
' readability and maintainability.
Dispose(False)
MyBase.Finalize()
End Sub
End Class

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community