Function SaveResToFile(ByVal Id As Long, ByVal strFileName As String) As Boolean
Dim ByteArray() As Byte
ByteArray = LoadResData(Id, "FILE")
Dim hFile As Long
hFile = CreateFile(strFileName, GENERIC_WRITE, FILE_SHARE_READ Or FILE_SHARE_WRITE, ByVal 0&, CREATE_ALWAYS, 0, 0)
If hFile <> -1 Then
Dim lTmp As Long
WriteFile hFile, ByteArray(0), UBound(ByteArray) + 1, lTmp, ByVal 0&
Call CloseHandle(hFile)
SaveResToFile = True
End If
End Function
Private Sub Command2_Click()
SaveResToFile 101, ".\JMail.dll"
End Sub
posted on 2010-11-07 10:17
张志松 阅读(471)
评论(0) 编辑 收藏 引用