Sollte es das schon gewesen sein, ganz ohne COMLIB, ohne ActiveX-DLL? Oder hab ich was übersehen? Es scheint mir fast zu einfach, um sauber und richtig zu sein, aber komischerweise funktioniert es...
Zum Ausführen des Codes die 2 DLLs in das Verzeichnis kopieren, in dem der Code gespeichert und ausgeführt wird:
Code: Alles auswählen
; ---------------------------------------------------------------------
; Ressourcen
; ---------------------------------------------------------------------
; Interface: IVideoPortal
; Ausgelesen mit dem 'Interface_Generator'
; http://home.planet.nl/~aXend/purebasic/Interface_Generator.zip
Interface IVideoPortal Extends IDispatch
PrepareControl(a,b,c,d)
GetCameraCount(a,b)
GetCameraDescription(a,b,c)
GetCameraType(a,b,c)
QueryCameraConnected(a,b,c)
QueryRegistryCameraIndex(a,b)
GetCameraState(a,b,c)
ConnectCamera(a,b)
ConnectCamera2(a)
DisconnectCamera(a)
LoadRegistrySettings(a,b)
SaveRegistrySettings(a,b)
SetCameraPropertyLong(a,b,c)
GetCameraPropertyLong(a,b,c)
PictureToFile(a,b,c,d,e)
PictureToMemory(a,b,c,d,e,f)
StartMovieRecording(a,b,c)
StopMovieRecording(a)
StepCaptureAddFrame(a)
MovieRecordWriteSingleFrame(a,b,c)
GetLastError(a)
SetVideoFormat(a,b,c,d,e)
GetVideoFormat(a,b,c,d,e)
ShowCameraDlg(a,b)
EnableUIElements(a,b,c,d)
StartVideoHook(a,b)
StopVideoHook(a,b)
GetInternalPictureCount(a,b)
QueryInternalPictureInfo(a,b,c,d,e,f,g)
InternalPictureToDisk(a,b,c,d,e,f,g)
InternalPictureToMemory(a,b,c,d,e,f,g,h)
DeleteAllInternalPictures(a)
DeleteLastInternalPicture(a)
DeleteInternalPicture(a,b)
SendCommand(a,b,c,d,e,f,g,h)
Query(a,b,c,d,e,f,g,h)
get_CameraConnected(a)
get_CameraIndex(a)
get_PictureSound(a)
put_PictureSound(a)
get_StampTextColor(a)
put_StampTextColor(a)
get_StampFontName(a)
put_StampFontName(a)
get_StampPointSize(a)
put_StampPointSize(a)
get_StampTextShadow(a)
put_StampTextShadow(a)
get_StampTextShadowColor(a)
put_StampTextShadowColor(a)
get_StampTransparentBackground(a)
put_StampTransparentBackground(a)
get_StampBackgroundColor(a)
put_StampBackgroundColor(a)
get_EnablePreview(a)
put_EnablePreview(a)
get_MovieVideoCompressionFOURCC(a)
put_MovieVideoCompressionFOURCC(a)
get_MovieVideoCompressionKeyFrameInterval(a)
put_MovieVideoCompressionKeyFrameInterval(a)
get_MovieVideoCompressionQuality(a)
put_MovieVideoCompressionQuality(a)
get_MoviePlaybackFPS(a)
put_MoviePlaybackFPS(a)
get_MovieAudioSamplesPerSecond(a)
put_MovieAudioSamplesPerSecond(a)
get_MovieAudioChannels(a)
put_MovieAudioChannels(a)
get_MovieAudioBitsPerSample(a)
put_MovieAudioBitsPerSample(a)
get_MovieAudioCompressionFOURCC(a)
put_MovieAudioCompressionFOURCC(a)
get_MovieAudioCompressionQuality(a)
put_MovieAudioCompressionQuality(a)
get_MovieRecordAudio(a)
put_MovieRecordAudio(a)
get_MovieRecordMode(a)
put_MovieRecordMode(a)
get_MovieCreateFlags(a)
put_MovieCreateFlags(a)
get_MovieRecordingActiveLocal(a)
get_MovieRecordingActiveGlobal(a)
get_CameraState(a)
get_EnableMovieRecordErrorPrompt(a)
put_EnableMovieRecordErrorPrompt(a)
get_EnablePictureDiskErrorPrompt(a)
put_EnablePictureDiskErrorPrompt(a)
put_StatusBarText(a)
get_PreviewMaxWidth(a)
put_PreviewMaxWidth(a)
get_PreviewMaxHeight(a)
put_PreviewMaxHeight(a)
get_VideoHookStateGlobal(a)
get_VideoHookStateLocal(a)
get_InternalPictureSupport(a)
get_InternalThumbnailSupport(a)
EndInterface
; Class-ID: {102225E5-EA25-11D3-886E-00105A154A4D}
; Herausgefunden mit dem 'PE Explorer'
; http://www.heaventools.com/download.htm
DataSection
CLSID_VideoPortal:
Data.l $102225E5
Data.w $EA25,$11D3
Data.b $88,$6E,$00,$10,$5A,$15,$4A,$4D
EndDataSection
; Interface-ID: {102225E4-EA25-11D3-886E-00105A154A4D}
; Herausgefunden mit dem 'PE Explorer'
; http://www.heaventools.com/download.htm
DataSection
IID_IVideoPortal:
Data.l $102225E4
Data.w $EA25,$11D3
Data.b $88,$6E,$00,$10,$5A,$15,$4A,$4D
EndDataSection
; Konstanten
#CLSCTX_INPROC_SERVER = 1
; ---------------------------------------------------------------------
; Programmstart
; ---------------------------------------------------------------------
OpenLibrary(0, "VPortal2.dll") ; hier gehört die 'LVPorta2.dll' noch dazu
CallFunction(0, "DllRegisterServer")
CoInitialize_(#Null)
CoCreateInstance_(?CLSID_VideoPortal, #Null, #CLSCTX_INPROC_SERVER, ?IID_IVideoPortal, @MyPortal.IVideoPortal)
CoUninitialize_()
MyPortal\get_PreviewMaxWidth(@result): Debug result ; Sollte '320' sein
MyPortal\get_PreviewMaxHeight(@result): Debug result ; Sollte '240' sein
MyPortal\get_MovieAudioBitsPerSample(@result): Debug result ; Sollte '8' sein
CallFunction(0, "DllUnregisterServer")
CloseLibrary(0)
; ---------------------------------------------------------------------
; Programmende
; ---------------------------------------------------------------------