AVI Files in Visual Basic - Bug in Win98?

gatsbythegreat
01-25-2005, 10:19 PM
Hi,

I'm trying to run .avi files from Visual Basic 6.0. I have succeeded in doing so when VB is running on WinXP (see my script below). However, when I try running exactly the same script on Win98, the .avi files fail to load. Specifically, the program stops running when I try to open the relevant avi file. Can anyone please help?

Thanks,
Jim

The relevant code in my form is quite simply:

Declare Function mciSendString Lib "winmm.dll" Alias _
"mciSendStringA" (ByVal lpstrCommand As String, ByVal _
lpstrReturnString As Any, ByVal uReturnLength As Long, ByVal _
hwndCallback As Long) As Long

Private Sub Form_Load()
Video
End Sub

Function Video(c as Integer)

Const WS_CHILD = &H40000000

XLSHwnd = GetActiveWindow()

CmdStr(c) = ("open " & AVIFile(c) " type AVIVideo alias animation parent " & LTrim$(Str$(XLSHwnd)) & " style " & LTrim$(Str$(WS_CHILD)))

'VB runs to this point and is then unable to execute the following line
Ret = mciSendString(CmdStr(c), 0&, 0, 0)

Ret = mciSendString("put animation window at 152 184 720 400", 0&, 0, 0)

Ret = mciSendString("pause animation", 0&, 0, 0)

Ret = mciSendString("play animation wait", 0&, 0, 0)

Ret = mciSendString("close animation", 0&, 0, 0)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum