I get this error when trying to Run with Full Compile or compile my project:
http://209.120.143.185/attachment.php?s=&postid=1067281
What...the...hell.
Project attached in next post.
Printable View
I get this error when trying to Run with Full Compile or compile my project:
http://209.120.143.185/attachment.php?s=&postid=1067281
What...the...hell.
Project attached in next post.
Project:
I opened your project and I got the same error :( gawd knows what it is but its obviously the project, not your installation of VB.
I removed the module and tried it and it ran okay, I assume its somethng in there?
It's something wrong with this:
So, what's wrong with that?VB Code:
Public Function MakeURL(Suffix As String, Optional Hostname As String = ServerSettings.Address, _ Optional Port As Integer = ServerSettings.Port, _ Optional Path As String = ServerSettings.Path) As String MakeURL = "http://" & Hostname.Address & IIf(Port = "80", "", ":" & Port) & Path & Suffix End Function
sure it's from the code?! try running it by F8, it wont even run a single line of code to get that error
:confused:
Something's wrong with your ServerSettings delcaration I guess... If your try debug.print ServerSettings.Port (or any member of ServerSettings) it does the same error.
Quote:
Visual Basic searches backward in the calls list to execute the first enabled error handler it finds. If not, it presents a default unexpected error message and halts execution.
It's something wrong with it. I took out references to it in that function and it ran at least, so the investigation continues...Quote:
Originally posted by Hampster
Something's wrong with your ServerSettings delcaration I guess... If your try debug.print ServerSettings.Port (or any member of ServerSettings) it does the same error.
Why are you using HostName.Address, where the Hostname is a string?Quote:
Originally posted by filburt1
It's something wrong with this:
So, what's wrong with that?VB Code:
Public Function MakeURL(Suffix As String, Optional Hostname As String = ServerSettings.Address, _ Optional Port As Integer = ServerSettings.Port, _ Optional Path As String = ServerSettings.Path) As String MakeURL = "http://" & Hostname.Address & IIf(Port = "80", "", ":" & Port) & Path & Suffix End Function
.
I saw that as I posted it and fixed it, but it didn't make a difference.
This seems to work but I like the original function much better:
VB Code:
Public Function MakeURL(Suffix As String, Optional hostname As String, Optional port As Long, _ Optional path As String) As String If hostname = Empty Then hostname = ServerSettings.Address If port = 0 Then port = ServerSettings.port If path = Empty Then path = ServerSettings.path MakeURL = "http://" & hostname & IIf(port = "80", "", ":" & port) & path & Suffix End Function
When I try to open your project, I get an error about some ActiveX control not registered.
When I open the BAS file alone and press F5, I get an Unexpected error. When I comment out the MakeURL function, VB proceeds correctly to tell me there's no startup object.
.
Here you go:
In the declaration of the MakeURL, simply declare the optional arguments as optional, and don't assign them any values.
VB Code:
Public Function MakeURL(Suffix As String, Optional Hostname As String, _ Optional Port As Long, _ Optional Path As String) As String MakeURL = "http://" & Hostname & IIf(Port = "80", "", ":" & Port) & Path & Suffix End Function
.