VB DLL

VB DLL

Anonymous
Not applicable
355 Views
5 Replies
Message 1 of 6

VB DLL

Anonymous
Not applicable
I'm currently compiling my AutoCAD VB code into a DLL. I'm using the default
value for the projects base address. (&H11000000). I've been informed that
changing this value can cause it to load faster. Does anyone if this is tru
and possibly a value that would be better?

Dale
0 Likes
356 Views
5 Replies
Replies (5)
Message 2 of 6

Anonymous
Not applicable
If another component is already loaded at that address
changing the value would make it load faster.

But then you would need to know which components
are loaded in which address in order to load yours
somewhere else.

That might work in your computer but maybe not
in someone else's.
--
Saludos, Ing. Jorge Jimenez, SICAD S.A., Costa Rica

"Dale Levesque" wrote in message
news:4932856@discussion.autodesk.com...
I'm currently compiling my AutoCAD VB code into a DLL. I'm using the default
value for the projects base address. (&H11000000). I've been informed that
changing this value can cause it to load faster. Does anyone if this is tru
and possibly a value that would be better?

Dale
0 Likes
Message 3 of 6

Anonymous
Not applicable
Dale,

You can use Dependency Walker to find out what address your DLL is being
loaded at. It is in the Support Tools on the XP CD or available to download
on Microsoft's website. It can tell you whether your DLL is actually being
loaded at the base address you specified, or if it is getting relocated to a
different address, which takes time.

-Rick Francken



"Dale Levesque" wrote in message
news:4932856@discussion.autodesk.com...
I'm currently compiling my AutoCAD VB code into a DLL. I'm using the default
value for the projects base address. (&H11000000). I've been informed that
changing this value can cause it to load faster. Does anyone if this is tru
and possibly a value that would be better?

Dale
0 Likes
Message 4 of 6

Anonymous
Not applicable
I actually have the application broken into 3 seperate components that are
all DLL's. I've just used the default address for all so I'm sure there is
some relocation going on. How does one go about specifying a new address
when he doesn't understand the hex stuff?

Dale

"Rick Francken" wrote in message
news:4933139@discussion.autodesk.com...
Dale,

You can use Dependency Walker to find out what address your DLL is being
loaded at. It is in the Support Tools on the XP CD or available to download
on Microsoft's website. It can tell you whether your DLL is actually being
loaded at the base address you specified, or if it is getting relocated to a
different address, which takes time.

-Rick Francken



"Dale Levesque" wrote in message
news:4932856@discussion.autodesk.com...
I'm currently compiling my AutoCAD VB code into a DLL. I'm using the default
value for the projects base address. (&H11000000). I've been informed that
changing this value can cause it to load faster. Does anyone if this is tru
and possibly a value that would be better?

Dale
0 Likes
Message 5 of 6

Anonymous
Not applicable
Dale,

The way I did it was to load the Acad.exe in Dependency Walker, and Start
Profiling. In the Log Window of Dependency Walker, look for log entries
that show your DLLs being loaded, like this:

Loaded "MyVBDll1.dll" at address 0x11000000 by thread 1.

That "0x" prefix would correspond to the "&H" that you use in your project
Base Address setting. Whatever value is shown in the Dependency Walker, try
using that value as the Base Address. Rebuild your DLL and try profiling
again. When the address shown in Dependency Walker statys the same as the
Base Address in your project settings, then Windows is not relocating the
DLL to a different address.

A word of caution though. I had tested an automation DLL in AutoCAD 2004
and set the image base address so that it was not being relocated, but found
that was relocating in AutoCAD 2005 or 2006. I suppose you could try
testing for all 3 versions, and find a base address for your DLL at which it
would not get relocated, but if somebody else's third-party DLL loads at
that same address, then your DLL could still get relocated. I'm just not
sure how tightly you can control the current environment without creating
worse problems.

Good luck,


--
-Rick Francken
www.franckensoft.com

By the way, nice website.

"Dale Levesque" wrote in message
news:4933324@discussion.autodesk.com...
I actually have the application broken into 3 seperate components that are
all DLL's. I've just used the default address for all so I'm sure there is
some relocation going on. How does one go about specifying a new address
when he doesn't understand the hex stuff?

Dale

"Rick Francken" wrote in message
news:4933139@discussion.autodesk.com...
Dale,

You can use Dependency Walker to find out what address your DLL is being
loaded at. It is in the Support Tools on the XP CD or available to download
on Microsoft's website. It can tell you whether your DLL is actually being
loaded at the base address you specified, or if it is getting relocated to a
different address, which takes time.

-Rick Francken



"Dale Levesque" wrote in message
news:4932856@discussion.autodesk.com...
I'm currently compiling my AutoCAD VB code into a DLL. I'm using the default
value for the projects base address. (&H11000000). I've been informed that
changing this value can cause it to load faster. Does anyone if this is tru
and possibly a value that would be better?

Dale
0 Likes
Message 6 of 6

Anonymous
Not applicable
Thanks very much Rick.

"Rick Francken" wrote in message
news:4933478@discussion.autodesk.com...
Dale,

The way I did it was to load the Acad.exe in Dependency Walker, and Start
Profiling. In the Log Window of Dependency Walker, look for log entries
that show your DLLs being loaded, like this:

Loaded "MyVBDll1.dll" at address 0x11000000 by thread 1.

That "0x" prefix would correspond to the "&H" that you use in your project
Base Address setting. Whatever value is shown in the Dependency Walker, try
using that value as the Base Address. Rebuild your DLL and try profiling
again. When the address shown in Dependency Walker statys the same as the
Base Address in your project settings, then Windows is not relocating the
DLL to a different address.

A word of caution though. I had tested an automation DLL in AutoCAD 2004
and set the image base address so that it was not being relocated, but found
that was relocating in AutoCAD 2005 or 2006. I suppose you could try
testing for all 3 versions, and find a base address for your DLL at which it
would not get relocated, but if somebody else's third-party DLL loads at
that same address, then your DLL could still get relocated. I'm just not
sure how tightly you can control the current environment without creating
worse problems.

Good luck,


--
-Rick Francken
www.franckensoft.com

By the way, nice website.

"Dale Levesque" wrote in message
news:4933324@discussion.autodesk.com...
I actually have the application broken into 3 seperate components that are
all DLL's. I've just used the default address for all so I'm sure there is
some relocation going on. How does one go about specifying a new address
when he doesn't understand the hex stuff?

Dale

"Rick Francken" wrote in message
news:4933139@discussion.autodesk.com...
Dale,

You can use Dependency Walker to find out what address your DLL is being
loaded at. It is in the Support Tools on the XP CD or available to download
on Microsoft's website. It can tell you whether your DLL is actually being
loaded at the base address you specified, or if it is getting relocated to a
different address, which takes time.

-Rick Francken



"Dale Levesque" wrote in message
news:4932856@discussion.autodesk.com...
I'm currently compiling my AutoCAD VB code into a DLL. I'm using the default
value for the projects base address. (&H11000000). I've been informed that
changing this value can cause it to load faster. Does anyone if this is tru
and possibly a value that would be better?

Dale
0 Likes