The next code

[vba]
Option Explicit


Type tm
tm_sec As Integer
tm_min As Integer
tm_hour As Integer
tm_mday As Integer
tm_mon As Integer
tm_year As Integer
tm_wday As Integer
tm_yday As Integer
tm_isdst As Integer
End Type

Private Declare Function gmtime Lib "crtdll" (ByVal val&) As tm

Public Sub R()
Dim T As tm
Dim v As Long
v = 0
T = gmtime(v)
MsgBox T.tm_year
End Sub
[/vba]

generates Error 49= "Bad DLL calling convention" on line with gmtime call

Does anybody know the reason?

With regards,
Marlog.