"Bad DLL Calling Convention" 
Author Message
 "Bad DLL Calling Convention"

HELP!
I get a runtime error 49 (Bad DLL Calling Convention) when this code is run,
but I don't know how to fix it:

Private Type SystemTime
    wYear As Integer
    wMonth As Integer
    wDayofWeek As Integer
    wDay As Integer
    wHour As Integer
    wMinute As Integer
    wSecond As Integer
    wMilliseconds As Integer
End Type
Private Type TZI
    Bias As Long
    StandardName As String * 32
    StandardDate As SystemTime
    StandardBias As Long
    DaylightName As String * 32
    DaylightDate As SystemTime
    DaylightBias As Long
End Type

Public Declare Function GetTimeZoneInformation Lib "Kernel32.dll"
(LPTIMEZONEINFORMATION As TZI) As Long

Public Function SmtpSend() As Boolean
    MainForm.Winsock.LocalPort = 0
    Retn = GetTimeZoneInformation(TimeZone)
    Bias = " -" & Replace(Right(Str(Int(TimeZone.Bias / 60)), 2), " ", "0")
_
          & Replace(Right(Str(TimeZone.Bias - (Int(TimeZone.Bias / 60) *
60)), 2), " ", "0")
    Dim CurDate As String
    CurDate = Format(Date, "Ddd") & ", " & Format(Date, "dd Mmm YYYY") _
           & " " & Format(Time, "hh:mm:ss") & Bias
    Retn = MsgBox(CurDate)
    SmtpSend = True
 End Function                                ' <------ERROR OCCURS HERE



Thu, 03 Feb 2005 01:04:47 GMT  
 "Bad DLL Calling Convention"
I fixed it myself, dont worry about replying...


Quote:
> HELP!
> I get a runtime error 49 (Bad DLL Calling Convention) when this code is
run,
> but I don't know how to fix it:

> Private Type SystemTime
>     wYear As Integer
>     wMonth As Integer
>     wDayofWeek As Integer
>     wDay As Integer
>     wHour As Integer
>     wMinute As Integer
>     wSecond As Integer
>     wMilliseconds As Integer
> End Type
> Private Type TZI
>     Bias As Long
>     StandardName As String * 32    ' should be * 64
>     StandardDate As SystemTime
>     StandardBias As Long
>     DaylightName As String * 32    ' should be * 64
>     DaylightDate As SystemTime
>     DaylightBias As Long
> End Type

> Public Declare Function GetTimeZoneInformation Lib "Kernel32.dll"
> (LPTIMEZONEINFORMATION As TZI) As Long

> Public Function SmtpSend() As Boolean
>     MainForm.Winsock.LocalPort = 0
>     Retn = GetTimeZoneInformation(TimeZone)
>     Bias = " -" & Replace(Right(Str(Int(TimeZone.Bias / 60)), 2), " ",
"0")
> _
>           & Replace(Right(Str(TimeZone.Bias - (Int(TimeZone.Bias / 60) *
> 60)), 2), " ", "0")
>     Dim CurDate As String
>     CurDate = Format(Date, "Ddd") & ", " & Format(Date, "dd Mmm YYYY") _
>            & " " & Format(Time, "hh:mm:ss") & Bias
>     Retn = MsgBox(CurDate)
>     SmtpSend = True
>  End Function                                ' <------ERROR OCCURS HERE



Thu, 03 Feb 2005 01:13:10 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. VB Error: "Bad DLL Calling Convention"

2. help with "bad dll calling convention"

3. "Bad DLL Calling Convention" using PtInRect

4. Error "Bad DLL calling convention" when calling function from a DLL

5. "Bad DLL Calling Convention" error / VB5 / DLL in C

6. Help with "Bad DLL Calling Convention" error

7. VB to C: runs as EXE, but "bad dll calling convention" in IDE?

8. win32 internet API "bad DLL calling convention"

9. DLL "calling conventions"...

10. Access200 - Error 49: "Bad DLL calling..."

11. PtInRect "Bad DLL calling convension"

12. 2 PRBS: Calling 16 bit DLL from VB5 and Bad DLL Calling Convention

 

 
Powered by phpBB® Forum Software