Jump to content
Fivewin Brasil

WEBCAM EM 64 BITS NÃO CONECTA


PauloPJ

Recommended Posts

Ola Pessoal

Estou novamente pedindo ajuda.

Eu uso uma classe para webcam que peguei aqui "webcam32.prg", a bastante tempo e sempre funcionou.

Porém de um tempo para ca com o windows 64 bits. a webcam conecta a primeira vez, e se sair da classe e entrar novamente não conecta , só se reiniciar o sistema operacional.

Procedimentos feitos

A Dll "avicap32.dll" esta atualizada para 64 bits.

se carregar a webcam pelo windows e chamar a classe volta a funcionar, mas se sair e entrar novamente para.

não sei o que fazer .

Se alguém souber como resolver , agradeço muito.

Paulo Junior

PJ Informatica

Link to comment
Share on other sites

Primeiro, onde você conseguiu esta .DLL para 64 bits? Não localizei em lugar nenhum, nem o autor disponibilizou.
E a avicap32.dll, deveria funcionar corretamente no windows de 64 bits, não funcionará no windows de 128 bits.
Volte a .DLL para avicap32.dll(original), e tente novamente, tem que funcionar.
DLL32 STATIC FUNCTION wCamCreaWnd;
(cTitle AS STRING,;
nStyle AS LONG,;
x AS LONG, y AS LONG, nWidth AS LONG, nHeight AS LONG,;
hWndParent AS LONG, nID AS LONG) AS LONG PASCAL;
FROM "capCreateCaptureWindowA" LIB "avicap32.dll"

http://forums.fivetechsupport.com/viewtopic.php?f=3&t=27547

Link to comment
Share on other sites

Ola Kapiaba, Valeu pela resposta.

Eu não mudei nada a avicap32.dll vem no windows, tem ela na pasta system32 para 32bits e na syswow64 a mesma dll com tamanho diferente pesquisando, vi que ela é para 64 bits. o windows 8 que eu uso, não deixa nem manipular ela.

A função que eu uso é idêntica a que você postou, a diferença é que o nome da dll estou chamando via loadlib32().

Mas já testei das duas formas e da o mesmo problema.

Vi uma postagem em um forum americano um programador de C# reclamando do mesmo problema, e o pessoal respondeu que o problema era no Sendmessage(),

que congestiona e fica como se a web ainda estivesse ativa quando sai da função , mesmo desconectando. Mas até aonde eu vi não tinham resolvido o problema.

Para forcar o uso da versao 64bits tive que renomear e mover para a pasta do sistema, mas vi que a dllque baixei para 64bits tinha o mesmo tamanho que a da pasta do windows syswow64 só a data que era de 2014. e deu o mesmo erro.

Por isso que disse que a dll estava para 64bits.

Link to comment
Share on other sites

Vamos por partes, que nem Jack, em FWH, usa-se: DllWebCam:=LoadLibrary("avicap32.dll") , loadlib32() é para fivewin 16 bits.

Acho mais aconselhável, que você crie um tópico no forum inter mostrando como fazes e o que ocorre, para ouvir a opinião, inclusive de autor.

Você está usando esta versão?

https://code.google.com/p/fivewin-contributions/downloads/detail?name=webcam.rar

abs,

Link to comment
Share on other sites

Ok Kapiaba, eu uso esta versão mesmo , inclusive o exemplo .exe que está no pacote da o mesmo problema, carrega uma vez, se eu sair e entrar novamente nao conecta na web. Só se eu reiniciar o sistema operacional. e já testei em três outros computadores. Pois pensei que podia ser virus ou um problema no windows.

Veja o Meu código abaixo

Function WEBCAM(obj)
private oWnd1, oMenu, oImg
private oWC
DEFAULT obj :=oWnd
cfile:='FOTO_CAM.JPG'
* cWebCamDriver := "Logitech QuickCam Express #2"
cWebCamDriver := "Microsoft WDM Image Capture"
_oWebcam_ := nil
oWC:=tWebCamPhoto():New()
webdll:=LoadLibrary("avicap32.dll")
* webdll:=LoadLib32("avicap32.dll")
SET KEY VK_F6 TO CAPTURA1()
SET KEY VK_F7 TO FONTE()
SET KEY VK_F8 TO FORMATA()
XRETWEB:=.f.
DEFINE DIALOG oWnd1 FROM 0,0 TO 27,45 TITLE "Captura de fotos com Webcam"
@ 0,200 IMAGE oImg OF oWnd1 SIZE 160,120 ADJUST
oImg:nProgress:=0
@ 8,0.2 BUTTON PADC('[F6] CAPTURAR',15) OF oWnd1 SIZE 55, 20 ACTION (CAPTURA1()) //(oWC:Clipboard(oImg),oWC:Save(oImg,cfile),oWnd1:End())
@ 8,10.2 BUTTON PADC('[F7] Fonte',15) OF oWnd1 SIZE 55, 20 ACTION (FONTE()) //(oWC:Clipboard(oImg),oWC:Save(oImg,cfile),oWnd1:End())
@ 8,20.2 BUTTON PADC('[F8] Formata',15) OF oWnd1 SIZE 55, 20 ACTION (FORMATA()) //(oWC:Clipboard(oImg),oWC:Save(oImg,cfile),oWnd1:End())
@ 9.5,8 BUTTON "[&Esc] -"+padc("Cancela",15) OF oWnd1 SIZE 80, 20 ACTION (oWnd1:End())
ACTIVATE DIALOG oWnd1 ON INIT;
(oWnd1:Center(),oWnd1:setfocus(),oWC:CreateWnd(oWnd1,0,0,160,120),oWC:Connect() )
oWC:End()
SET KEY VK_F6 TO
SET KEY VK_F7 TO
SET KEY VK_F8 TO
FreeLibrary(webdll)
return(XRETWEB)
**********************************************************
STATIC FUNC CAPTURA1
XRETWEB:=.T.
oWC:Clipboard(oImg)
oWC:Save(oImg,cfile)
oWnd1:End()
RETURN
**********************************************************
STATIC FUNC FORMATA
oWC:Format()
RETURN
**********************************************************
STATIC FUNC FONTE
oWC:Source()
RETURN
**********************************************************
*
*
* Clase tWebCamPhoto (Sólo para FWH)
* Objetivo: Capturar fotos con una Webcam
*
* César E. Lozada, cesarlozada@hotmail.com
* Los Teques, Venezuela - 22/06/2003
*
*
***********************************************************
#define WM_CAP_START WM_USER
#define WM_CAP_DRIVER_CONNECT WM_CAP_START + 10
#define WM_CAP_DRIVER_DISCONNECT WM_CAP_START + 11
#define WM_CAP_SET_PREVIEW WM_CAP_START + 50
#define WM_CAP_SET_PREVIEWRATE WM_CAP_START + 52
#define WM_CAP_SET_SCALE WM_CAP_START + 53
#define WM_CAP_EDIT_COPY WM_CAP_START + 30
#define WM_CAP_FILE_SAVEDIB WM_CAP_START + 25
#define WM_CAP_DLG_VIDEOFORMAT WM_CAP_START + 41
#define WM_CAP_DLG_VIDEOSOURCE WM_CAP_START + 42
#define WM_CAP_GET_STATUS WM_CAP_START + 54
*********************************************************
* EXIT Procedure WebcamDisconnect()
* Asegura la desconexión de la cámara.
*********************************************************
*EXIT Procedure WebcamDisconnect()
* if _oWebcam_<>nil
* _oWebcam_:Disconnect()
* _owebcam_:=nil
* endif
*return
****************************************************************************
CREATE CLASS tWebCamPhoto
DATA nFrameRate INIT 66 //Velocidad de actualización de la WebCam
DATA nJpgQuality INIT 75 //Calidad de los JPG
DATA hWnd //Handle de la centana de la imagen
DATA aDrivers //Drivers de captura disponibles
DATA nDriver //número del driver instalado + 1
DATA lConnected INIT .F. //¿Está conectada>
METHOD New(cDriver,lSelect) CONSTRUCTOR // Construye el objeto. cDriver es el nombre
// del driver a usar, recomendado guardar en ini.
// Si lSelect=.T. muestra la lista para escogerlo
METHOD CreateWnd(oWnd1,nLeft,nTop,nWidth,nHeight,nStyle,cTitle)
// Crea la ventana para la cámara en oWnd.
METHOD Connect // Conecta la cámara
METHOD Disconnect // Desconecta la cámara
METHOD Clipboard(oImg) //Captura la imagen en clipboard. Opcionalmente
//actualiza a oImg con la imagen capturada
METHOD Save(oImg,cFile,nQuality) //Captura la imagen y guarda en archivo (BMP/JPG).
//Opcionalmente actualiza a oImg con la imagen capturada
METHOD Source() //Configura la fuente de la webcam
METHOD Format() //Configura el formato de la imagen
METHOD GetStatus() //Status de la imagen
METHOD Resize() //Redimensiona la ventana de la imagen
METHOD End() INLINE ::Disconnect() // Finaliza el objeto
ENDCLASS
*===========================================================================
METHOD New(cDriver,lSelect)
DEFAULT cDriver:=cWebCamDriver
DEFAULT lSelect:=.F.
::aDrivers:=WebCamList()
::nDriver:=aScan(::aDrivers,{|u| Upper(StrTran(cDriver,' '))==Upper(StrTran(u,' '))})
IF ::nDriver=0 .or. lSelect
::nDriver:=WebCamSelect(::nDriver,::aDrivers)
ENDIF
_oWebCam_:=Self
return Self
*===========================================================================
METHOD CreateWnd(oWnd1,nTop,nLeft,nWidth,nHeight,nStyle,cTitle)
DEFAULT nTop:=0, nLeft:=0, nWidth:=160, nHeight:=120
DEFAULT nStyle:=nOr(WS_VISIBLE,WS_CHILD,WS_BORDER)
IF ::nDriver>0
::hWnd:=wCamCreaWnd(::aDrivers[::nDriver], nStyle,;
nLeft, nTop, nWidth, nHeight, oWnd1:hWnd, 0)
end
return ::hWnd
*===========================================================================
METHOD Connect()
if ::hWnd<>nil
if SendMessage(::hWnd, WM_CAP_DRIVER_CONNECT, ::nDriver-1, 0)=1
cWebCamDriver:=::aDrivers[::nDriver]
SendMessage(::hWnd, WM_CAP_SET_SCALE, 1, 0)
SendMessage(::hWnd, WM_CAP_SET_PREVIEWRATE, ::nFrameRate, 0)
SendMessage(::hWnd, WM_CAP_SET_PREVIEW, 1, 0)
::lConnected:=.T.
::Resize()
else
::lConnected:=.F.
::hWnd:=nil
endif
endif
return ::lConnected
*===========================================================================
METHOD Disconnect
IF ::hWnd<>Nil .and. ::lConnected
if SendMessage(::hWnd, WM_CAP_DRIVER_DISCONNECT, 0, 0)=1
::lConnected:=.F.
_oWebCam_:=nil
endif
ENDIF
return nil
*===========================================================================
METHOD Clipboard(oImg)
Local lSucc:=.F.
if ::hWnd<>nil
lSucc:=(SendMessage(::hWnd, WM_CAP_EDIT_COPY, 0, 0)=1)
IF lSucc .and. oImg<>nil
oImg:LoadFromClipboard()
oImg:Refresh()
ENDIF
endif
return lSucc
*===========================================================================
METHOD Save(oImg,cFile,nQuality)
Local lSucc:=.F.
Local cFileExt:=Upper(cFileExt(cFile))
Local cFileName:=cFileNoExt(cFile)
Local cExec:='BMPtoJPG.EXE'
if file(CFILE)
DELE FILE &CFILE
END
if ::hWnd<>nil
CursorWait()
IF (cFileExt=="JPG" .or. cFileExt=="JPEG")
IF ::Clipboard()
CursorWait()
DEFAULT nQuality:=::nJpgQuality
::nJpgQuality:=Max(Min(Int(nQuality),100),10)
WaitRun(cExec+' -q'+LTrim(Str(::nJpgQuality,3,0))+' -c'+cFileName+' -o -s',0)
ENDIF
ELSEIF cFileExt=='BMP'
SendMessage(::hWnd, WM_CAP_FILE_SAVEDIB, 0, cFile)
ENDIF
CursorArrow()
SysRefresh()
IF !(lSucc:=File(cFile))
MsgAlert('Não Foi possivel gravar o Arquivo '+cFile)
ELSEIF oImg<>nil
XRETWEB:=.T.
oImg:LoadImage(nil,cFile)
oImg:Refresh()
ENDIF
endif
return lSucc
*===========================================================================
METHOD Source()
if ::hWnd<>nil .and. ::lConnected
SendMessage(::hWnd, WM_CAP_DLG_VIDEOSOURCE, 0, 0)
endif
return nil
*===========================================================================
METHOD Format()
if ::hWnd<>nil .and. ::lConnected
SendMessage(::hWnd, WM_CAP_DLG_VIDEOFORMAT, 0, 0)
::Resize()
endif
return nil
*===========================================================================
#include "Struct.ch"
METHOD GetStatus()
Local oPoint, oStatus, cBuffer
STRUCT oPoint
MEMBER X AS LONG
MEMBER Y AS LONG
ENDSTRUCT
STRUCT oStatus
MEMBER nWidth AS LONG // Width of the image
MEMBER nHeight AS LONG // Height of the image
MEMBER lLive AS LONG // Now Previewing video?
MEMBER lOverlay AS LONG // Now Overlaying video?
MEMBER lScale AS LONG // Scale image to client?
MEMBER oXYScroll AS STRING LEN 8 //AS POINTAPI // Scroll position
MEMBER lDefPalette AS LONG // Using default driver palette?
MEMBER lAudHardware AS LONG // Audio hardware present?
MEMBER lCapFile AS LONG // Does capture file exist?
MEMBER nCurVidFrm AS LONG // # of video frames cap'td
MEMBER nCurVidDropped AS LONG // # of video frames dropped
MEMBER nCurWavSamples AS LONG // # of wave samples cap'td
MEMBER nCurTimeEl AS LONG // Elapsed capture duration
MEMBER hPalCur AS LONG // Current palette in use
MEMBER lCapturing AS LONG // Capture in progress?
MEMBER nReturn AS LONG // Error value after any operation
MEMBER nVidAlloc AS LONG // Actual number of video buffers
MEMBER wAudAlloc AS LONG // Actual number of audio buffers
ENDSTRUCT
oPoint:x:=0; oPoint:y:=0
oStatus:oXYScroll:=oPoint:cBuffer
cBuffer:= oStatus:cBuffer
SendMessage(::hWnd, WM_CAP_GET_STATUS, Len(cBuffer), @cBuffer)
oStatus:cBuffer:= cBuffer
return oStatus
*===========================================================================
#define HWND_BOTTOM 1
#define SWP_NOMOVE 2
#define SWP_NOSIZE 1
#define SWP_NOZORDER 4
METHOD Resize()
Local oStatus
if ::hWnd<>nil .and. ::lConnected
SysRefresh()
oStatus := ::GetStatus()
SetWindowPos(::hWnd,HWND_BOTTOM,0,0,oStatus:nWidth,oStatus:nHeight,;
nOr(SWP_NOMOVE,SWP_NOZORDER ) )
SysRefresh()
endif
return nil
****************************************************************************
Function WebcamList()
Local aDrivers:={}, nDriver:=0
Local cName, cVersion, nLen:=255
DO WHILE .T.
cName:=space(nLen); cVersion:=space(nLen)
IF !wCamGetDrvDesc(nDriver, @cName, nLen, @cVersion, nLen)
EXIT
ENDIF
if chr(0)$cName
cName:=Left(cName,At(chr(0),cName)-1)
endif
if chr(0)$cVersion
cVersion:=Left(cVersion,At(chr(0),cVersion)-1)
endif
aAdd(aDrivers,cName)
nDriver++
ENDDO
return aDrivers
****************************************************************************
Function WebcamSelect(nDriver,aDrivers)
Local oDlg, oCbx
Local cDriver
Local lSelect:=.F.
DEFAULT nDriver:=0, aDrivers:=WebcamList()
IF Empty(aDrivers)
MsgAlert('Não foi encontrado Webcam conectada')
return 0
ELSE
cDriver:=aDrivers[Max(1,nDriver)]
if nDriver>0
DEFINE DIALOG oDlg FROM 0,0 to 6,40 TITLE "Selecione a webcam"
@ 0,0 COMBOBOX oCbx VAR cDriver OF oDlg ITEMS aDrivers;
SIZE 160,50 PIXEL
@ 1.5, 4 BUTTON "Selecionar" OF oDlg SIZE 40,12;
ACTION (nDriver:=oCbx:nAt ,oDlg:End())
@ 1.5,16 BUTTON "Cancela" OF oDlg SIZE 40,12;
ACTION oDlg:End()
ACTIVATE DIALOG oDlg CENTERED
else
nDriver:=1
End
ENDIF
return nDriver
****************************************************************************
Function WebCamVersion(nDriver)
Local cName, cVersion, nLen:=255
DEFAULT nDriver:=0
IF nDriver>0
cName:=space(nLen); cVersion:=space(nLen)
IF wCamGetDrvDesc(nDriver-1, @cName, nLen, @cVersion, nLen)
if chr(0)$cVersion
cVersion:=Left(cVersion,At(chr(0),cVersion)-1)
endif
ELSE
cVersion:=nil
ENDIF
ENDIF
return cVersion
****************************************************************************
DLL32 FUNCTION wCamGetDrvDesc;
(nDriver AS _INT,;
cName AS STRING,;
nName AS LONG,;
cVersion AS STRING,;
nVersion AS LONG) AS BOOL PASCAL;
FROM "capGetDriverDescriptionA" LIB webdll
************************************************************************
DLL32 FUNCTION wCamCreaWnd;
(cTitle AS STRING,;
nStyle AS LONG,;
x AS LONG, y AS LONG, nWidth AS LONG, nHeight AS LONG,;
hWndParent AS LONG, nID AS LONG) AS LONG PASCAL;
FROM "capCreateCaptureWindowA" LIB webdll
************************************************************************
Link to comment
Share on other sites

Tente:



Function WEBCAM(obj)

private oWnd1, oMenu, oImg
private oWC

DEFAULT obj :=oWnd
cfile:='FOTO_CAM.JPG'
* cWebCamDriver := "Logitech QuickCam Express #2"
cWebCamDriver := "Microsoft WDM Image Capture"
_oWebcam_ := nil
oWC:=tWebCamPhoto():New()

webdll:=LoadLibrary("avicap32.dll")

SET KEY VK_F6 TO CAPTURA1()
SET KEY VK_F7 TO FONTE()
SET KEY VK_F8 TO FORMATA()

XRETWEB:=.f.

DEFINE DIALOG oWnd1 FROM 0,0 TO 27,45 TITLE "Captura de fotos com Webcam"

@ 0,200 IMAGE oImg OF oWnd1 SIZE 160,120 ADJUST
oImg:nProgress:=0

@ 8,0.2 BUTTON PADC('[F6] CAPTURAR',15) OF oWnd1 SIZE 55, 20 ACTION (CAPTURA1()) //(oWC:Clipboard(oImg),oWC:Save(oImg,cfile),oWnd1:End())
@ 8,10.2 BUTTON PADC('[F7] Fonte',15) OF oWnd1 SIZE 55, 20 ACTION (FONTE()) //(oWC:Clipboard(oImg),oWC:Save(oImg,cfile),oWnd1:End())
@ 8,20.2 BUTTON PADC('[F8] Formata',15) OF oWnd1 SIZE 55, 20 ACTION (FORMATA()) //(oWC:Clipboard(oImg),oWC:Save(oImg,cfile),oWnd1:End())
@ 9.5,8 BUTTON "[&Esc] -"+padc("Cancela",15) OF oWnd1 SIZE 80, 20 ACTION (oWnd1:End())

ACTIVATE DIALOG oWnd1 ON INIT;
(oWnd1:Center(),oWnd1:setfocus(),oWC:CreateWnd(oWnd1,0,0,160,120),oWC:Connect() )
oWC:End()

SET KEY VK_F6 TO
SET KEY VK_F7 TO
SET KEY VK_F8 TO

FreeLibrary(webdll)

//FreeResources() // Set Resources To

Release All
SysRefresh()

/*limpia arreglo y llama al colecor de basura de xharbour*/ //-> Lixeira
HB_GCALL( .T. )

PostQuitMessage( 0 )

__QUIT()

return(XRETWEB)


Link to comment
Share on other sites

Obrigado pela resposta

Coloquei o os comandos no final mas não resolveu, e deu outros efeitos colaterais rsrs

PostQuitMessage( 0 ) // quanto coloco o sistema fica alternando a tela entre a tela do cliente e a area de trabalho

__QUIT() // não coloquei porque o sistema ira sair, e não é o objetivo.

O que percebi é que de vez em quando volta a funcionar sem eu reiniciar, mas não tem uma ordem lógica, totalmente aleatório, mas quando entro e saio, para novamente, muito louco.

Link to comment
Share on other sites

Entendi, você usa junto com o seu sistema, não usa independente, mas ele não entra mais, quando você sai do seu sistema ou mesmo estando nele, ele não entra mais?

Se for quando você sai do seu sistema, coloque os comandos que postei na saida do seu sistema, para que não fique nenhum processo preso no gerenciador de tarefas do rWindows.

abs,

Link to comment
Share on other sites

Desculpe a demora na resposta.

Tive que ir a outra cidade dar suporte.

O problema é quando entro na funcao webcam

Eu uso dentro do cadastro do cliente, para capturar a foto do cliente no balcao.

Quando estou no processo de vendas.

Na versao windows 32 , funciona perfeitamente, eu entro na funcao conecto tiro a foto e deconecto, sem problemas , mas no 64Bits eu entro e conecto na boa, tiro a foto e quando desconecto , parece que não desconecta, e quando entro novamente, a funcao entra para eu escolher a web cam e não conecta, só se eu desligar o computador e ligar novamente.

Fiz um teste usando o webcam32.exe que vem no exemplo e da o mesmo problema. Só conecta a primeira vez.

Link to comment
Share on other sites

Bem, respondendo ao Alessandro.

Obrigado pela resposta, eu já tentei monitorar no gerenciador de tarefas, mas não consegui ver nenhuma tarefa que gerencia a web. Pode ser ignorância minha.

E como usar o taskkill?

Respondendo ao Sergio

Obrigado pela resposta, eu usei o mesmo exemplo que você mandou, ele conecta, mas só a primeira vez, se sair e entrar novamente não acha a webcam. Eu uso o windows 8.0 e 7 64 Bits, os dois deram o mesmo problema.

As vezes ele reconecta sozinho, não entendo porque. é só deixar o computador parado durante algum tempo, mas não tem uma ordem, hora funciona, hora não.

Muito louco.

Link to comment
Share on other sites

Outro detalhe

quando saio do webcam2.exe ele gera um erro na pasta do aplicativo

Application
===========
Path and name: C:\download five win\WEBCAM1\WebCam.exe (32 bits)
Size: 1,364,480 bytes
Time from start: 0 hours 0 mins 12 secs
Error occurred at: 08-05-2014, 22:29:57
Error description: Error BASE/1075 Error de argumento: >
Args:
[ 1] = C Message not found
[ 2] = N 9000
Stack Calls
===========
Called from: => TWEBCAM:ERROR(0)
Called from: source\rtl\tobject.prg => (b)HBOBJECT(105)
Called from: => TWEBCAM:MSGNOTFOUND(0)
Called from: => TWEBCAM:DISCONNECT(164)
Called from: .\WEBCAM.PRG => SALIRYA$(0)
System
======
CPU type: Intel® Core2 Duo CPU T6400 @ 2.00GHz 2000 Mhz
Hardware memory: -256 megs
Free System resources: 90 %
GDI resources: 90 %
User resources: 90 %
Compiler version: Harbour 1.0.1dev Intl. (Rev. 9361)
Windows version: 6.2, Build 9200
Windows total applications running: 0
Variables in use
================
Procedure Type Value
==========================
TWEBCAM:ERROR
Param 1: O Class: ERROR
(b)HBOBJECT
Param 1: C "Message not found"
Param 2: C "TWEBCAM"
Param 3: C "DISCONNECT"
Param 4: N 1004
Local 1: N 9000
Local 2: U
Local 3: N 0
Local 4: S
Local 5: B {|| ... }
TWEBCAM:MSGNOTFOUND
Param 1: O Class: TWEBCAM
Param 2: C "DISCONNECT"
TWEBCAM:DISCONNECT
Param 1: C "DISCONNECT"
SALIRYA$
Linked RDDs
===========
DBF
DBFFPT
DBFBLOB
DBFNTX
DataBases in use
================
Classes in use:
===============
1 ERROR
2 HBCLASS
3 HBOBJECT
4 TFONT
5 TWINDOW
6 TCONTROL
7 TICON
8 TBRUSH
9 TMENU
10 TMENUITEM
11 TWEBCAM
12 TSTRUCT
13 TMSGBAR
14 TRECT
15 TMSGITEM
16 TTIMER
17 TCURSOR
18 TBAR
19 TBTNBMP
20 TDIALOG
21 TREG32
Memory Analysis
===============
224 Static variables
Dynamic memory consume:
Actual Value: 0 bytes
Highest Value: 0 bytes
Link to comment
Share on other sites


Function Test()
Local oWnd, oMenu, oImg
Local oWC

DllWebCam:=LoadLibrary("avicap32.dll") //LoadLib32("avicap32.dll")
if Abs( DllWebCam ) > 32
//? "Loaded ok"
ELSE
MsgAlert( "Error code: " + LTrim( Str( DllWebCam ) ) + " loading AVICAP32.DLL" )
endIF

oWC:=tWebCamPhoto():New()

DEFINE WINDOW oWnd FROM 0,0 TO 5,5
ACTIVATE WINDOW oWnd ON INIT ( oWC:CreateWnd(oWnd,60,10,320,240),;
oWC:Connect(),;
oWC:Save(oImg, STRZERO(SECONDS(),6,0)+'.bmp'),;
oWC:Disconnect(),; // Desconecta aqui
oWC:End(),;
oWnd:End() ) ICONIZED
RETURN(NIL)

Link to comment
Share on other sites

Eu já fiz isso logo no inicio , já tentei carregar a DLL no inicio do aplicativo e nao desconectei e entrei novamente e faz a mesma coisa.

Tentei criar o obj oWc no inicio do aplicativo e não dei end() , quando sai da webcam(), para testar, mas da o mesmo problema, quando vou conectar ele retorna .f. e não conecta. Só na primeira vez.

Link to comment
Share on other sites

  • 4 weeks later...

Ola Galera! Preciso mesmo de ajuda.

Já encontrei mais de 20 post com o mesmo problema em diversas linguagens, C# VB, etc.

Só que eles dizem que o problema não é de 32 para 64bits, mas windows XP para os demais 7,8,81

Funciona na primeira vez que entra , e se sair e esperar alguns minutos ou reiniciar o computador , volta a funcionar.

E realmente testei no 7 32Bits e deu o mesmo problema. nos computadores com XP não da o problema.

Se alguém souber como posso resolver isso ...

Vou agradecer muito.

Link to comment
Share on other sites

Faz algum tempo que estou com este mesmo problema, o máximo que consegui, foi capturar a imagem na primeira conexão sem preview, as demais dá erro. A mesma rotina funciona blz em outros pc 32 bits...desistir achando q era notebook.

Link to comment
Share on other sites

Faz algum tempo que estou com este mesmo problema, o máximo que consegui, foi capturar a imagem na primeira conexão sem preview, as demais dá erro. A mesma rotina funciona blz em outros pc 32 bits...desistir achando q era notebook.

só um pitaco....

A rotina que utilizo em 32bits, percebi que funciona em alguns micros e outros não... deduzi ser a câmera, já que em um cliente fiz o teste, troquei a câmera, coloquei uma outra de um cliente que estava funcionado, ai funcinou, mas quando voltei a câmera que estava, não funciona...

Link to comment
Share on other sites

  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...