Re: VB6 app cannot copy dll to system32
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Wed, 2 May 2007 16:25:54 -0700
Michael J. Wheeler <MichaelJWheeler@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
"Karl E. Peterson" wrote:
No need to apologize or rationalize. Using VFred for such a trivial little
applet would be silly. Use the appropriate tool. No need for 20+ MB of
runtimes to do this.
VFred?
Yeah, go to www.google.com, type VFred in the search box, and press "I'm Feeling
Lucky" (if you like irony, you're in for a real treat).
VB uses LoadLibrary for external DLLs, so it uses those semantics. See the docs
for the (new) SetDllDirectory call, for the explicit search order:
http://msdn2.microsoft.com/en-us/library/ms686203.aspx
I don't think I can use this because there is still the possibility of
having a Windows 2000 client out there. It's a "90% of the programming for
10% of the people" type of thing.
I didn't suggest you use that call. LoadLibrary uses the very same semantics, and
has since Windows 3.0 (at least, probably longer). I'm fairly certain that's the
case, at any rate. Given this new API, the "safest" route (given MSFT's penchant
for breaking stuff) might be to test the OS and use SetDllDirectory if XP/SP1+ and
just skip it if not.
We'll disallow 2000 in the dorms for next year,
Why on Earth would you want to do something so barbaric as that?
but we're stuck with the
possibility of having them this year.
Use that opportunity to become comfortable with that which disturbs you.
By far, the easiest method is (still) to install the DLL into the same folder as
your EXE.
My application did not seem to be able to find the DLL if it was in the same
directory as the executable. If it helps any, my DLL requires msi.dll . I
have verified that msi.dll exists in the system32 directory.
In that case, I'd suggest you try my suggestion above, and branch based on OS. Your
EXE will find the DLL in earlier OSes, if it's in the app-path.
--
..NET: It's About Trust!
http://vfred.mvps.org
.
- References:
- Re: VB6 app cannot copy dll to system32
- From: Karl E. Peterson
- Re: VB6 app cannot copy dll to system32
- Prev by Date: Re: Notating out old code in Access Database
- Next by Date: Re: VB6 app cannot copy dll to system32
- Previous by thread: Re: VB6 app cannot copy dll to system32
- Next by thread: Re: VB6 app cannot copy dll to system32
- Index(es):
Relevant Pages
|