Re: Program fails to start using WinInet.dll via type library.

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



That's an interesting delima. I've only used wininet api using declares,
never a tlb. If you think the type library is the problem, can you change
the calls over to api declares in your app and test it that way? Would that
not give an error since it's doing the exact same thing, just in a different
way? It looks like wininet.dll is dependent on advapi32.dll, crypt32.dll,
kernel32.dll, msvcrt.dll, oleaut32.dll, shlwapi.dll and user32.dll. Maybe
one of its dependencies doesn't export/have the function you are calling.
Have you tried creating an installer and installing it on that machine or
just running the already compiled .exe?

"Mark Alexander Bertenshaw" <mark.bertenshaw@xxxxxxxxxx> wrote in message
news:uE7LnqCwFHA.3800@xxxxxxxxxxxxxxxxxxxxxxx
>> "Mark Alexander Bertenshaw" <mark.bertenshaw@xxxxxxxxxx> wrote in message
>> news:u$UpAY3vFHA.460@xxxxxxxxxxxxxxxxxxxxxxx
>> > Hi -
>> >
>> > I have recently replaced code using the Internet Transfer control with
>> > code
>> > which directly uses the WinInet.dll API. My compiled EXE works fine on
> my
>> > Win2000 SP4, Internet Explorer 6 machine. However, after installing
> this
>> > on
>> > a machine with Win2000 SP4 Internet Explorer 5, the executable doesn't
>> > even
>> > start running my code (I just here a sound, with no accompanying
>> > message
>> > box).
>> >
>> > I thought that versions of WinInet.dll were backwards compatible, and
> all
>> > the functions I am using are in IE 5 and above. Can anyone tell me
>> > what
>> > is
>> > going wrong, here?
>
> "Matt Williamson" <ih8spam@xxxxxxxxxxx> wrote in message
> news:%23HMgkd4vFHA.664@xxxxxxxxxxxxxxxxxxxxxxx
>> Mark-
>>
>> You didn't mention it, but I'd assume you made sure there was no firewall
>> blocking anything? I'd probably add a log file that just writes a line
>> for
>> each sub/function of your program. Re-compile and run it on that machine
> to
>> see what call the breakdown is occuring on or install VB and step through
>> the code on that machine.
>>
>> HTH
>>
>> Matt
>
> Hi Matt -
>
> Thanks for the reply. Yes, I did turn off the firewall on the target
> machine. But as I said, none of my code ever starts running (I've put
> MsgBox() in the Sub Main to prove this). It is falling over on the EXE
> loader, which makes me think that there is something wrong with my type
> library. To explain: there are two mechanisms you can use in Windows to
> make calls to DLLs. One mechanism is to put the names of the DLLs you
> will
> be referencing into the executable's header, so it automatically loads the
> DLLs, if they aren't already, when your executable is loaded. All your
> API
> calls are compiled as ordinal entries to the DLL, and are fixed up to
> function pointers after your executable is loaded.
> The other mechanism is to use LoadLibrary() to dynamically load the DLL
> during your program's execution, and then use GetProcOfAddress() to obtain
> a
> function pointer to the DLL's function, and then call the function via its
> pointer.
> Visual Basic can actually use both mechanisms behind the scenes. When you
> use a type library to call a function you are using the former mechanis,
> and
> when you use a Declare statement, you are using the latter mechanism.
>
> There are advantages and disadvantages using to using either mechanism.
> However the principal disadvantageof using a type library for API calls is
> that if the DLL you want to call doesn't exist, then your program doesn't
> get past the executable loader sequence. You may have probably run an
> executable that hadn't been installed properly with its attendant DLLs,
> and
> got an error message about the inavailability of a DLL. Unfortunately, VB
> doesn't even give you this message: it just gives up. And I think this is
> what is happening in my case. The problem is that I can't work out why it
> is complaining, especially since I have now upgraded the target machine to
> Internet Explorer 6!!
>
> --
> Mark
>
>


.



Relevant Pages

  • Re: [RELEASE] Userspace RCU 0.3.0
    ... I released userspace RCU 0.3.0, which includes a small API change for ... at the call_rcuexecution site. ... time period if within an RCU read-side critical section. ...
    (Linux-Kernel)
  • Re: finding out application dependencies;
    ... Ok now I know what you were talking about - API hooking. ... It can trace execution of a program, ... executable's binary and look at its imports and exports. ... will also not appear in this dependency list since only the executable ...
    (microsoft.public.development.device.drivers)
  • Re: Programmatically replacing an API for another module
    ... be really handy if when testing I could supply replacement ... API is appropriately called. ... Using win32com, I might then use win32file.CopyFile, but from testing ... will actually do the execution (and I don't yet understand Python's ...
    (comp.lang.python)
  • Re: Polymorphism using DLL Declares?
    ... same API. ... MustOverride prototypes for the DLL calls, ... SecondDll, and ThirdDll, and have the Declares override the DLL api ... Public MustInherit Class PublicApi ...
    (microsoft.public.dotnet.languages.vb)
  • Re: Program fails to start using WinInet.dll via type library.
    ... I've only used wininet api using declares, ... > Have you tried creating an installer and installing it on that machine or ... it munges up your nice VB Unicode strings into ASCII ...
    (microsoft.public.vb.winapi)