UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Wininet.dll Missing On Server 2016, Access 2016    
 
   
MrSiezen
post Feb 16 2017, 10:15 AM
Post#1



Posts: 2,334
Joined: 15-February 05
From: Den Bosch - Netherlands


Hi,

I have a FTP module which uses some declarations like:

' Declare wininet.dll API Functions
Public Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA"

But when I open this db on a Server 2016 machine with 2016 runtime, it causes runtime errors for all code.
I'm sorry, I cannot give more exact error descriptions as Runtime doesn't give me more either.

But if quote out all these declarations, all other code in other modules works fine.

Is wininet.dll no longer supported, or can I copy this DLL file from my windows 7 machine to the server to fix it?

--------------------
UA Rulez!
Go to the top of the page
 
MrSiezen
post Feb 22 2017, 05:58 AM
Post#2



Posts: 2,334
Joined: 15-February 05
From: Den Bosch - Netherlands


I think I need to add info:

The current version of Office I'm using is 32 bit.
The new server is 64 bit...

I think it has something to do with this?

--------------------
UA Rulez!
Go to the top of the page
 
MrSiezen
post Feb 22 2017, 07:34 AM
Post#3



Posts: 2,334
Joined: 15-February 05
From: Den Bosch - Netherlands


I got it:

You need to change the way you declare for 64-bit. Like below you can program simulatniously for both 32bit as 64bit:

CODE
#If VBA7 And Win64 Then
    Public Declare PtrSafe Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" (ByVal hFtpSession As LongPtr, ByVal lpszDirectory As String) As Boolean
#Else
    Public Declare Function FtpSetCurrentDirectory Lib "wininet.dll" Alias "FtpSetCurrentDirectoryA" (ByVal hFtpSession As Long, ByVal lpszDirectory As String) As Boolean
#End If


Note the added PtrSafe and LongPtr instead of Long in the 64 bit version.
This post has been edited by MrSiezen: Feb 22 2017, 07:34 AM

--------------------
UA Rulez!
Go to the top of the page
 


Custom Search
RSSSearch   Top   Lo-Fi    26th March 2017 - 11:44 PM