.NET

Reply
*T.Willey
Message 11 of 13 (99 Views)

Re: How to tell if a .dll is loaded?

10-10-2006 08:06 AM in reply to: *T.Willey
Thanks Tony. I think I will have to do some research to better understand
.Net.

--

Tim
"A blind man lets nothing block his vision."


"Tony Tanzillo" wrote in message
news:5355859@discussion.autodesk.com...
No, if you load it on startup, then it's loaded.

If it implements commands, it can be demand-loaded
via the registry. If it implements LISP-callable functions
then it must be explicitly loaded (and there is no other
way to do that from LISP other than NETLOAD, or if the
DLL is a COM server, using vlax-get-interface-object).

What I described earlier is a referenced assembly (e.g.,
an assemtly that you add to your project references),
not the main assembly/DLL that your project compiles
into.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"T.Willey" wrote in message
news:5355698@discussion.autodesk.com...
So if I load it on start-up, but it never gets called, then it never really
got loaded? Is there any way to load a .dll besides the registry way, and
the command 'netload'? I haven't found a way yet.

I would guess my '.dll' is a managed assembly. I don't know enough of the
termology yet.

Thanks Tony.

--

Tim
"A blind man lets nothing block his vision."


"Tony Tanzillo" wrote in message
news:5355704@discussion.autodesk.com...
Assuming your '.DLL' is a managed assembly, you don't
need to do anything :-)

In .NET, managed assemblies are not actually loaded until
they are required (e.g., you create/use something in them,
like a class or static data).

Hence, if your assembly references another assembly, but
the code in your assembly that uses a class exported by the
referenced assembly never executeds, then the referenced
assembly is never loaded.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"T.Willey" wrote in message
news:5355259@discussion.autodesk.com...
How can you tell if a .dll is loaded into Acad, from Acad? Or does it
matter? I have one routine right now that I want to use, but I only want to
load it when I need it, so I was looking for a way to tell if it's already
loaded, so I don't have to load it again.

Thanks in advance.

--

Tim
"A blind man lets nothing block his vision."
*CB
Message 12 of 13 (99 Views)

Re: How to tell if a .dll is loaded?

10-10-2006 08:12 AM in reply to: *T.Willey
The odd thing about the code that I reference is that I do not have to load
the dll into autocad at all. It is not in the registry to autoload. It is
also not being autoloaded by any other means. It is completely not loaded
before the first call to the color dialog box. Once the first call to the
dialog box is made via any com call , I used VBA, then the dll is loaded and
made useable. I have no idea if this is a glitch but it blows my mind as to
how it can do this. It is as if any code that uses the autocad namespace or
managed wrappers is automaticaly loaded and useable by autocad once it is
initialized. Is this true? I can't explain it anyother way. I have not
been taking advantage of this fact in any of my code yet.... as I still do
not understand what is actually taking place that allows this behavior.

For the record I am using the 1.1 framework with acad2006 and compiling the
sample project with sharpdevelop 1.2. After compiling I am using the .net
command line for creating the TLB and registering the com enabled .DLL .
Once that is done... I make sure that my vba code is referencing the correct
TLB. When I run the code, which basically pops up the truecolor dialog box,
everything works. Maybe autocad automatically netloads the referenced dll
after the first call is made through VBA.... I don't know..... but using a
.net dll through VBA seems autoload a dll.
--
CB





"Tony Tanzillo" wrote in message
news:5355859@discussion.autodesk.com...
No, if you load it on startup, then it's loaded.

If it implements commands, it can be demand-loaded
via the registry. If it implements LISP-callable functions
then it must be explicitly loaded (and there is no other
way to do that from LISP other than NETLOAD, or if the
DLL is a COM server, using vlax-get-interface-object).

What I described earlier is a referenced assembly (e.g.,
an assemtly that you add to your project references),
not the main assembly/DLL that your project compiles
into.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"T.Willey" wrote in message
news:5355698@discussion.autodesk.com...
So if I load it on start-up, but it never gets called, then it never really
got loaded? Is there any way to load a .dll besides the registry way, and
the command 'netload'? I haven't found a way yet.

I would guess my '.dll' is a managed assembly. I don't know enough of the
termology yet.

Thanks Tony.

--

Tim
"A blind man lets nothing block his vision."


"Tony Tanzillo" wrote in message
news:5355704@discussion.autodesk.com...
Assuming your '.DLL' is a managed assembly, you don't
need to do anything :-)

In .NET, managed assemblies are not actually loaded until
they are required (e.g., you create/use something in them,
like a class or static data).

Hence, if your assembly references another assembly, but
the code in your assembly that uses a class exported by the
referenced assembly never executeds, then the referenced
assembly is never loaded.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"T.Willey" wrote in message
news:5355259@discussion.autodesk.com...
How can you tell if a .dll is loaded into Acad, from Acad? Or does it
matter? I have one routine right now that I want to use, but I only want to
load it when I need it, so I was looking for a way to tell if it's already
loaded, so I don't have to load it again.

Thanks in advance.

--

Tim
"A blind man lets nothing block his vision."
*Tony Tanzillo
Message 13 of 13 (99 Views)

Re: How to tell if a .dll is loaded?

10-11-2006 09:36 AM in reply to: *T.Willey
The .NET runtime manages loading of referenced assemblies,
when they're needed. Since every type contains a reference
to the assembly that contains it, the runtime can find out what
assembly is needed on a type-by-type basis.

If you examine the System.Type class you'll see it has a property
named 'Assembly', which is how the runtime knows what it must
load.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"CB" wrote in message news:5356498@discussion.autodesk.com...
The odd thing about the code that I reference is that I do not have to load
the dll into autocad at all. It is not in the registry to autoload. It is
also not being autoloaded by any other means. It is completely not loaded
before the first call to the color dialog box. Once the first call to the
dialog box is made via any com call , I used VBA, then the dll is loaded and
made useable. I have no idea if this is a glitch but it blows my mind as to
how it can do this. It is as if any code that uses the autocad namespace or
managed wrappers is automaticaly loaded and useable by autocad once it is
initialized. Is this true? I can't explain it anyother way. I have not
been taking advantage of this fact in any of my code yet.... as I still do
not understand what is actually taking place that allows this behavior.

For the record I am using the 1.1 framework with acad2006 and compiling the
sample project with sharpdevelop 1.2. After compiling I am using the .net
command line for creating the TLB and registering the com enabled .DLL .
Once that is done... I make sure that my vba code is referencing the correct
TLB. When I run the code, which basically pops up the truecolor dialog box,
everything works. Maybe autocad automatically netloads the referenced dll
after the first call is made through VBA.... I don't know..... but using a
.net dll through VBA seems autoload a dll.
--
CB





"Tony Tanzillo" wrote in message
news:5355859@discussion.autodesk.com...
No, if you load it on startup, then it's loaded.

If it implements commands, it can be demand-loaded
via the registry. If it implements LISP-callable functions
then it must be explicitly loaded (and there is no other
way to do that from LISP other than NETLOAD, or if the
DLL is a COM server, using vlax-get-interface-object).

What I described earlier is a referenced assembly (e.g.,
an assemtly that you add to your project references),
not the main assembly/DLL that your project compiles
into.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"T.Willey" wrote in message
news:5355698@discussion.autodesk.com...
So if I load it on start-up, but it never gets called, then it never really
got loaded? Is there any way to load a .dll besides the registry way, and
the command 'netload'? I haven't found a way yet.

I would guess my '.dll' is a managed assembly. I don't know enough of the
termology yet.

Thanks Tony.

--

Tim
"A blind man lets nothing block his vision."


"Tony Tanzillo" wrote in message
news:5355704@discussion.autodesk.com...
Assuming your '.DLL' is a managed assembly, you don't
need to do anything :-)

In .NET, managed assemblies are not actually loaded until
they are required (e.g., you create/use something in them,
like a class or static data).

Hence, if your assembly references another assembly, but
the code in your assembly that uses a class exported by the
referenced assembly never executeds, then the referenced
assembly is never loaded.

--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006/2007
http://www.acadxtabs.com

"T.Willey" wrote in message
news:5355259@discussion.autodesk.com...
How can you tell if a .dll is loaded into Acad, from Acad? Or does it
matter? I have one routine right now that I want to use, but I only want to
load it when I need it, so I was looking for a way to tell if it's already
loaded, so I don't have to load it again.

Thanks in advance.

--

Tim
"A blind man lets nothing block his vision."

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