Error when calling InternetDial function:

ALX

Well-known member
Joined
Nov 16, 2005
Messages
253
Location
Columbia, SC
Programming Experience
10+
Now I'm in over my head !!!
My app uses a procedure to download a file from the internet using code from this link:
http://www.dnzone.com/forum/topic.asp?topic_id=134

This stuff works great as long as the user does not click on the "Settings" button and then the "OK" button in the dial-up dialog box. If they do, the app hangs briefly and then ends in the error state described below.
...If the "Settings" button were not in the dial-up dialog, this would not be an issue, so if there were a way to bring up the dial-up dialog without that button or with the button disabled, that would be a suitable fix for me.
Below are just a few pieces of my code to describe the variables being used here.

Declared at class level...
Private Enum DialUpOptions As Integer
INTERNET_DIAL_UNATTENDED = &H8000
INTERNET_DIAL_SHOW_OFFLINE = &H4000
INTERNET_DIAL_FORCE_PROMPT = &H2000
End Enum

Private mlConnection As Int32
------------------------------------------------------------------------
...Code from sub where error occurs...
Dim DResult As Int32

DResult = InternetDial(Me.Handle, "sdsds", DialUpOptions.INTERNET_DIAL_FORCE_PROMPT, mlConnection, 0)
------------------------------------------------------------------------
The code above (red) generates the error below (blue) if the user clicks on the "Settings" button and then the "OK" button in the dial-up dialog box.

LoaderLock was detected
Message: Attempting managed execution inside OS Loader lock.
Do not attempt to run managed code inside a DllMain or image initialization function since doing so can cause the application to hang.

...'Anybody have a clue how I can avoid this ?
 
Back
Top