Hypetia,
I'm trying to use the following code and everything was going very well untill I tried to put it on a timer and load the picture every five seconds. Nothing happens after the first load. Is there anyway to fix this?
Option Explicit
Private Declare Function CLSIDFromString Lib "ole32" (ByVal lpstrCLSID As Long, lpCLSID As Any) As Long
Private Declare Function OleLoadPicturePath Lib "oleaut32" (ByVal szURLorPath As Long, ByVal punkCaller As Long, ByVal dwReserved As Long, ByVal clrReserved As OLE_COLOR, ByRef riid As Any, ByRef ppvRet As Any) As Long
Public Function LoadPictureFromURL(ByVal url As String) As Picture
Dim IPic(15) As Byte 'holds the IPicture interface
CLSIDFromString StrPtr("{7BF80980-BF32-101A-8BBB-00AA00300CAB}"), IPic(0)
OleLoadPicturePath StrPtr(url), 0&, 0&, 0&, IPic(0), LoadPictureFromURL
End Function
Private Sub Timer1_Timer()
Picture1.Picture = LoadPictureFromURL("
End Sub
the picture i'm using is just a friends webcam so I can see if the picture actually changes.