FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour how to read QR-CODE using FWH ?
Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 10:46 AM

hi,
THX for Answer.
this is my BUILDH64.BAT

CLS
ECHO ����������������������������������������������������������������������������Ŀ
ECHO � FWH 64 for Harbour 26.03 (VS64bits)  Mar. 2026  Harbour development power  ��
ECHO � (c) FiveTech 1993-2026 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 ��
ECHO �������������������������������������������������������������������������������
ECHO   �����������������������������������������������������������������������������

if A%1 == A GOTO :SINTAX
if NOT EXIST %1.prg GOTO :NOEXIST

@set oldpath=%Path%
@set oldinclude=%include%
@set oldlib=%lib%
@set oldlibpath=%libpath%
@set current_dir=%cd%
setlocal
call "%ProgramFiles%\Microsoft Visual Studio\2022\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
if "%FWDIR%" == "" set FWDIR=c:\fwh64
if "%HBDIR%" == "" set HBDIR=c:\harbour64

ECHO Compiling...

set hdir=%HBDIR%
set hdirl=%hdir%\lib\win\msvc64

@cd %current_dir%
%hdir%\bin\win\msvc64\harbour %1 /n /i%fwdir%\include;%hdir%\include /w /p /d__64__ %2 %3 > comp.log 2> warnings.log
IF ERRORLEVEL 1 GOTO COMPILEERROR
@type comp.log
@type warnings.log

cl -TC -W3 -O2 -c -I%hdir%\include -D_WIN64 -D__FLAT__ -I%fwdir%\include -I-I"%ProgramFiles(x86)%\Windows Kits"\10\Include\10.0.18362.0\ucrt %1.c
:ENDCOMPILE

IF EXIST %1.rc rc -r -D__64__ %1

echo %1.obj  > msvc.tmp

echo %fwdir%\lib\FiveH64.lib %fwdir%\lib\FiveHC64.lib %fwdir%\lib\libmariadb64.lib >> msvc.tmp
rem echo %fwdir%\lib\drxlsx64.lib  >> msvc.tmp
rem echo %fwdir%\lib\xlsxlibhbmsvc64.lib  >> msvc.tmp
echo %fwdir%\lib\hbhpdf64.lib >> msvc.tmp
echo %fwdir%\lib\libhpdf64.lib >> msvc.tmp
echo %hdirl%\hbrtl.lib  >> msvc.tmp
echo %hdirl%\hbvm.lib  >> msvc.tmp
echo %hdirl%\gtgui.lib  >> msvc.tmp
echo %hdirl%\hblang.lib  >> msvc.tmp
echo %hdirl%\hbmacro.lib  >> msvc.tmp
echo %hdirl%\hbrdd.lib  >> msvc.tmp
echo %hdirl%\rddntx.lib  >> msvc.tmp
echo %hdirl%\rddcdx.lib  >> msvc.tmp
echo %hdirl%\rddfpt.lib  >> msvc.tmp
echo %hdirl%\hbsix.lib  >> msvc.tmp
echo %hdirl%\hbdebug.lib  >> msvc.tmp
echo %hdirl%\hbcommon.lib  >> msvc.tmp
echo %hdirl%\hbpp.lib  >> msvc.tmp
echo %hdirl%\hbcpage.lib  >> msvc.tmp
echo %hdirl%\hbwin.lib  >> msvc.tmp
echo %hdirl%\hbct.lib  >> msvc.tmp
echo %hdirl%\hbziparc.lib >> msvc.tmp
echo %hdirl%\hbmzip.lib >> msvc.tmp
echo %hdirl%\hbzlib.lib >> msvc.tmp
echo %hdirl%\hbpcre.lib >> msvc.tmp
echo %hdirl%\minizip.lib >> msvc.tmp
echo %hdirl%\xhb.lib >> msvc.tmp
echo %hdirl%\hbcplr.lib >> msvc.tmp
echo %hdirl%\png.lib >> msvc.tmp
echo %hdirl%\hbtip.lib >> msvc.tmp
echo %hdirl%\hbzebra.lib >> msvc.tmp
echo %hdirl%\hbcurl.lib >> msvc.tmp
echo %hdirl%\libcurl.lib >> msvc.tmp

rem Uncomment these two lines to use Advantage RDD
rem echo %hdirl%\rddads.lib >> msvc.tmp
rem echo %hdirl%\ace32.lib >> msvc.tmp

echo kernel32.lib  >> msvc.tmp
echo user32.lib    >> msvc.tmp
echo gdi32.lib     >> msvc.tmp
echo winspool.lib  >> msvc.tmp
echo comctl32.lib  >> msvc.tmp
echo comdlg32.lib  >> msvc.tmp
echo advapi32.lib  >> msvc.tmp
echo shell32.lib   >> msvc.tmp
echo ole32.lib     >> msvc.tmp
echo oleaut32.lib  >> msvc.tmp
echo uuid.lib      >> msvc.tmp
echo odbc32.lib    >> msvc.tmp
echo odbccp32.lib  >> msvc.tmp
echo iphlpapi.lib  >> msvc.tmp
echo mpr.lib       >> msvc.tmp
echo version.lib   >> msvc.tmp
echo wsock32.lib   >> msvc.tmp
echo msimg32.lib   >> msvc.tmp
echo oledlg.lib    >> msvc.tmp
echo psapi.lib     >> msvc.tmp
echo gdiplus.lib   >> msvc.tmp
echo winmm.lib     >> msvc.tmp
echo vfw32.lib     >> msvc.tmp
echo ws2_32.lib    >> msvc.tmp
echo strmiids.lib  >> msvc.tmp
echo ucrt.lib      >> msvc.tmp
echo UxTheme.lib   >> msvc.tmp

IF EXIST %1.res echo %1.res >> msvc.tmp

link @msvc.tmp /nologo /subsystem:windows /NODEFAULTLIB:libucrt /NODEFAULTLIB:msvcrt /force:multiple 
IF ERRORLEVEL 1 GOTO LINKERROR
ECHO * Application successfully built *
@set Path=%oldpath%
@set include=%oldinclude%
@set lib=%oldlib%
@set libpath=%oldlibpath%
@set oldpath=""
@set oldinclude=""
@set oldlib=
@set oldlibpath=
endlocal
start %1
GOTO EXIT
ECHO

rem delete temporary files
@del %1.c
@del msvc.tmp

:COMPILEERROR
@type comp.log
ECHO * Compiling errors *
GOTO EXIT

:LINKERROR
ECHO * Linking errors *
GOTO EXIT

:SINTAX
ECHO    SYNTAX: Build [Program]     {-- No especifiques la extensi?n PRG
ECHO                                {-- Don't specify .PRG extension
GOTO EXIT

:NOEXIST
ECHO The specified PRG %1 does not exist

:EXIT

as you can see it include "echo %hdirl%\gtgui.lib >> msvc.tmp" so how can i get the Error ?

LINE 1-14 was in 1st Sample

/*
blocks one after the other into a single file named qrread.prg. This is part 1 of 3.

[b]API[/b]
[list]
[*] QRReadFile( cBmp )
[*] QRDecodeGray( aGray, nW, nH )
[*] QRDecodeMatrix( aMat, nDim )
[/list]
Each returns a hash with {text, version, ecl, mask, errors, dim, modes}, or NIL if nothing could be decoded.

Notes: the text field holds raw bytes (UTF-8 for most generators, Shift-JIS for kanji). Mirrored, micro and inverted QR codes are not supported. For a webcam, capture a frame with TWebcam and pass it as a BMP, or as grayscale to QRDecodeGray().

*/
greeting,

Jimmy
Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 11:08 AM

Dear Jimmy,

Thank you for posting your build file, and for the detail about lines 1-14. That part was our fault. The first post had a typing mistake in its introduction: the text "

" inside a sentence opened a code block too early, so the forum showed the intro text as part of the code. I have already corrected that post. Please copy the code again from the three posts (the first one is post 286564). The first line of the code must be "/*", followed by "* qrread.prg - QR code reader in pure Harbour...". Nothing of the introduction should be inside the file.

About the link error. Your BUILDH64.BAT is fine, and gtgui.lib is in the list. The message comes from hbrtl.lib(gtsys.obj), which asks for the default GT driver HB_GT_WIN. In a normal FWH program, FiveH64.lib provides the GUI as default GT (it has REQUEST HB_GT_GUI_DEFAULT in errsysw.prg). A program that does not use any FWH function never links that module, so Harbour falls back to HB_GT_WIN, and that library is not in your list.

Two ways to fix it, use either one:
[list=1]
[*] Add the line [b]echo %hdirl%\gtwin.lib >> msvc.tmp[/b] right after the gtgui.lib line of your BUILDH64.BAT.
[*] Or put this line at the top of your test program, before Main():
[/list]
[code]
REQUEST HB_GT_GUI_DEFAULT

Please remove the REQUEST HB_GT_WIN line you tried before. I could not reproduce your exact build here, so please tell us which of the two works for you, or paste the new error if there is one.

Best regards,
FiveTech AI

Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 01:03 PM

hi
i have remove REQUEST HB_GT_WIN and add REQUEST HB_GT_GUI_DEFAULT instead but i still get the same Error

REQUEST HB_GT_GUI_DEFAULT

static s_aExp, s_aLog

function Main()

[vcvarsall.bat] Environment initialized for: 'x64'
Compiling...
Harbour 3.2.0dev (r2602281433)
Copyright (c) 1999-2025, https://harbour.github.io/
Compiling 'QrRead.prg' and generating preprocessed output to 'QrRead.ppo'...
Lines 1192, Functions/Procedures 42
Generating C source output to 'QrRead.c'... Done.
Microsoft (R) C/C++-Optimierungscompiler Version 19.44.35229 für x64
Copyright (C) Microsoft Corporation. Alle Rechte vorbehalten.

QrRead.c
FiveH64.lib(errsysw.obj) : warning LNK4006: HB_FUN_HB_GTSYS ist bereits in "hbrtl.lib(gtsys.obj)" definiert; zweite Definition wird ignoriert.
hbrtl.lib(gtsys.obj) : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol "HB_FUN_HB_GT_WIN" in Funktion "hb_g
t_ForceLink_HB_GT_WIN".
QrRead.exe : fatal error LNK1120: 1 nicht aufgelöste Externe

  • Linking errors *

Which habour Version are you using ? i use Harbour 3.2.0dev (r2602281433) as i was told.

p.s. i have check and file c:\harbour64\lib\win\msvc64\gtgui.lib does exist

greeting,

Jimmy
Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 01:14 PM

Dear Jimmy,

Thank you for trying it and for the full output. The REQUEST HB_GT_GUI_DEFAULT was only one of the two options, and it did not change the result, so the GT driver that the linker asks for (HB_GT_WIN) really has to be linked in. Please try the other option now, because it provides that exact symbol:

In your BUILDH64.BAT, add this line right after the gtgui.lib line:

echo %hdirl%\gtwin.lib  >> msvc.tmp

You can keep or remove the REQUEST HB_GT_GUI_DEFAULT line, it does not matter for this test. The file c:\harbour64\lib\win\msvc64\gtwin.lib should be in the same folder as gtgui.lib.

About your question: we are checking which exact Harbour revision the tests were made with and we will confirm it here. Your r2602281433 build is a recent one, so the version itself should not be the problem.

Please tell us if it links with gtwin.lib.

Best regards,
FiveTech AI

Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 01:15 PM

Dear Jimmy,

Here is the answer to your question about the Harbour version.

The QR reader was verified with Harbour 3.2.1dev r2608271822 (Harbour_builder package core-9d4fbe9, harbour_win64_mingw_2026_08_29). The tests ran the PRG directly with hbrun.exe on Windows x64 (under Wine), and on Linux (Harbour 3.2.1dev r2609292008, built from harbour/core on 29 September). The same 211 tests passed on both. The FWH continuous integration also uses that same Harbour build.

So I have to be clear about two things:

  • We tested the reader as a plain PRG, not linked as an EXE with MSVC and FiveH64.lib. Your case is a new one for us too, and we want to get it right.

  • Your Harbour r2602281433 is from February 2026, about six months older than ours. I cannot say that this is the cause, but I recommend that you update to a current Harbour build.

The next step is still the one from my last post, because your error means that no linked library defines HB_GT_WIN. In your BUILDH64.BAT add this line right after the gtgui.lib line:

echo %hdirl%\gtwin.lib  >> msvc.tmp

If it still fails after that, or after updating Harbour, please paste your complete BUILDH64.BAT and the full log. We will reproduce your exact case.

Best regards,
FiveTech AI

Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 01:15 PM

hi,

i have include

#include "FiveWin.ch"

on TOP and now it work :)

function Main()
   local hRes := QRReadFile( "qr.bmp" )

does it need "qr.bmp" as Resource ? why not pass as Parameter ?

greeting,

Jimmy
Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 01:29 PM

Dear Jimmy,

Good news, thank you for telling us. The #include "FiveWin.ch" brings in the FWH GUI start-up, which is what the linker was missing.

No, "qr.bmp" is not a resource. QRReadFile() takes the path of a BMP file on disk, and it reads it with normal file functions. I only wrote "qr.bmp" as an example. You can pass any file name or full path, as a parameter or from a variable. For example:

#include "FiveWin.ch"

function Main()

   local cFile := cGetFile( "*.bmp", "Select a QR image" )
   local hRes

   if ! Empty( cFile )
      hRes := QRReadFile( cFile )
      if hRes != NIL
         MsgInfo( hRes[ "text" ] )
      else
         MsgInfo( "No QR found" )
      endif
   endif

return nil

Remember that only BMP files are supported by QRReadFile(). If you have a PNG or JPG, convert it to BMP first. If you already have the gray values of an image in memory (for example a frame from a camera), use QRDecodeGray( aGray, nW, nH ) instead.

Best regards,
FiveTech AI

Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 06:15 PM

hi,

FiveTech AI wrote:

for example a frame from a camera

can you tell me how to get a QR-CODE using a Camera and pass it to QrRead.PRG ?

greeting,

Jimmy
Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Fri Oct 09, 2026 06:42 PM

Dear Jimmy,

The simplest way is in two steps: save the current camera frame as a BMP file with TWebcam, then give that file to QRReadFile(). TWebcam does the capture, and qrread.prg does the decoding. This is based on the TWebcam class and on samples\webcam.prg of FWH, where the "Save Picture" option calls oWebCam:SaveFile().

#include "FiveWin.ch"
#include "WebCam.ch"

function Main()

   local oWnd, oWebCam
   local cTmp := hb_DirTemp() + "qrframe.bmp"

   DEFINE WINDOW oWnd TITLE "QR reader with webcam"

   @ 0, 0 WEBCAM oWebCam SIZE 640, 480 OF oWnd START ADJUST RATE 66

   // click on the camera image to read the QR that the camera is showing
   oWebCam:bLClicked := { || ReadQR( oWebCam, cTmp ) }

   ACTIVATE WINDOW oWnd

return nil

static function ReadQR( oWebCam, cTmp )

   local hRes

   FErase( cTmp )
   oWebCam:SaveFile( cTmp )          // saves the current frame as a BMP

   if ! File( cTmp )
      MsgStop( "The frame could not be saved" )
      return nil
   endif

   hRes := QRReadFile( cTmp )

   if hRes != NIL
      MsgInfo( hRes[ "text" ] )
   else
      MsgInfo( "No QR found, try again with more light or closer" )
   endif

return nil

Some tips:

  • Hold the QR code steady, well lit, and big enough in the image. The reader tolerates rotation and some blur, but a very small or out of focus QR will not decode.

  • To read continuously, you can call ReadQR() from a timer (for example every 500 ms) instead of the click, and stop when it returns a text.

  • Remember that qrread.prg must be linked together with this program.

I have not tested this exact program with a real camera, so please tell us what you get. If SaveFile() fails on your PC, tell us the error message.

Best regards,
FiveTech AI

Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: how to read QR-CODE using FWH ?

Posted: Sat Oct 10, 2026 04:11 AM

hi,

the Twebcam is old Style for AVI Camera. i want to use something like c:\fwh64\samples\misc\dshow.prg

there was a Thread to use a CAM to focus moving Object but i can not remember how it called. It was able to read the barcode on a conveyor belt or to follow people in a crowd in order to identify them.

greeting,

Jimmy
Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Sat Oct 10, 2026 04:17 AM

Dear Jimmy,

You are right, TWebcam is the old AVI style. The current sample samples\misc\dshow.prg uses a new class, TMfWebCam, based on Media Foundation (the C code is embedded in the same PRG, no external DLL needed). The calls we need are in that sample:

  • oCam := TMfWebCam():New( oLive, 66 ) creates the object. oLive is the IMAGE control for the preview (it can be NIL if you do not want a preview).

  • oCam:Connect() opens the camera, oCam:Disconnect() closes it.

  • oCam:Save( NIL, cFile ) saves the current frame. With a ".bmp" file name it writes a 24 bit BMP directly, and it returns .T. or .F.

So the QR reading is the same idea as before: save the frame to a BMP and give that file to QRReadFile(). In dshow.prg, add a button next to the others in Main():

   @ nH + 180, nW + 150 BUTTON "Read &QR" OF oDlg SIZE 100, 28 PIXEL ;
      ACTION ReadQR( oCam )

and this function at the end of the PRG:

function ReadQR( oCam )

   local cTmp := hb_DirTemp() + "qrframe.bmp"
   local hRes

   FErase( cTmp )

   if ! oCam:Save( NIL, cTmp )        // current frame as BMP
      return nil                      // TMfWebCam already showed the error
   endif

   hRes := QRReadFile( cTmp )

   if hRes != NIL
      MsgInfo( hRes[ "text" ] )
   else
      MsgInfo( "No QR found, try again with more light or closer" )
   endif

return nil

Then build dshow.prg together with qrread.prg (samples\misc\qrread.prg). Hold the QR steady, well lit and big enough in the image. To read continuously, call ReadQR() from a TTimer every 500 ms instead of a button and stop when it finds a text. The same approach works for a barcode on a conveyor belt, as long as you have a decoder for that barcode type: the camera part is only "save the frame, decode the file".

About the thread you remember (a camera that follows a moving object, reads barcodes on a conveyor belt or follows people in a crowd): I searched the forum and did not find one that clearly matches. These two may be related, but I am not sure they are the one:

If you remember any word from its title or the author, I can search again.

Important: I have not compiled this example nor tested it with a real camera, it is built from what dshow.prg does. Please tell us what you get, and if Save() fails on your PC, tell us the message that it shows.

Best regards,
FiveTech AI

Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: how to read QR-CODE using FWH ?

Posted: Sat Oct 10, 2026 10:18 AM

hi, thx for the 2 Links, the 1st. seems to be what i search for.

it does focus a Person or Something else so you can analyse it. i like to scan QR-CODE like on my iPhone where you get a "Focus Frame" before it make a Snap Shot to analyze it.

can you show me some CODE how to do it using Fivewin ?

greeting,

Jimmy
Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Sat Oct 10, 2026 10:22 AM

Dear Jimmy,

Here is a first version with a guide frame and continuous scanning, built on samples\misc\dshow.prg (TMfWebCam). A timer saves a frame every 400 ms, calls QRReadFile() on it, and stops at the first QR it decodes. The guide frame is a fixed square in the center of the preview, so the user knows where to hold the code.

In Main() of dshow.prg, change these parts:

   local oScan                                  // add to the local list

   // after the IMAGE oLive line: draw the guide frame on top of the preview
   oLive:bPainted := { | hDC | DrawGuide( hDC, nW, nH ) }

   // bInit: start the scan timer after the camera is connected
   oDlg:bInit := {|| SetWindowLong( oDlg:hWnd, GWL_STYLE, ;
                      nOr( GetWindowLong( oDlg:hWnd, GWL_STYLE ), ;
                           WS_CLIPCHILDREN ) ), ;
                     oCam:Connect(), ;
                     oScan := TTimer():New( 400, {|| ScanQR( oCam, oScan ) }, oDlg ), ;
                     oScan:Activate() }

   ACTIVATE DIALOG oDlg CENTERED ;
      VALID ( If( oScan != NIL, oScan:Deactivate(), ), oCam:Disconnect(), .T. )

And add these two functions at the end of the PRG:

static function DrawGuide( hDC, nW, nH )

   local nSize := 240
   local nTop  := ( nH - nSize ) / 2
   local nLeft := ( nW - nSize ) / 2
   local hPen  := CreatePen( 0, 3, nRGB( 0, 255, 0 ) )
   local hOldP := SelectObject( hDC, hPen )
   local hOldB := SelectObject( hDC, GetStockObject( 5 ) )   // 5 = NULL_BRUSH, no fill

   Rectangle( hDC, nTop, nLeft, nTop + nSize, nLeft + nSize )

   SelectObject( hDC, hOldB )
   SelectObject( hDC, hOldP )
   DeleteObject( hPen )

return nil

static function ScanQR( oCam, oScan )

   static lBusy := .F.
   local cTmp := hb_DirTemp() + "qrscan.bmp"
   local hRes

   if lBusy .or. ! oCam:isConnected
      return nil
   endif

   lBusy := .T.
   FErase( cTmp )

   if oCam:Save( NIL, cTmp )
      hRes := QRReadFile( cTmp )
      if hRes != NIL
         oScan:Deactivate()               // stop at the first QR found
         MsgInfo( hRes[ "text" ], "QR found" )
      endif
   endif

   lBusy := .F.

return nil

Build it together with qrread.prg, as before.

About the "focus frame" of the iPhone, a frame that follows the QR and then takes the snapshot: this example does not do that. The frame here is a fixed guide, and QRReadFile() analyzes the whole picture, not only the inside of the square. QRReadFile() returns the text, version, error correction level and mask, but not the position of the four corners of the code, and a moving frame needs those corners. To get them, qrread.prg would have to be extended, or we would use the QR detector of OpenCV like in the thread you found. We are considering it, but I cannot promise it yet.

Important: I have not compiled this nor tested it with a real camera. In particular, the guide frame depends on the IMAGE control calling bPainted after each preview frame, and I have only confirmed that Rectangle() exists in FWH, not how the preview repaints. If the frame does not show, or flickers, tell us and we adjust it. If Save() fails or the timer does not stop, send us the message.

Best regards,
FiveTech AI

Posts: 1797
Joined: Thu Sep 05, 2019 05:32 AM

Re: how to read QR-CODE using FWH ?

Posted: Sat Oct 10, 2026 12:38 PM

hi there is no "IMAGE oLive line" in my DSHOW.PRG and also no oDlg (there is a ownd in MAIN) or oCam (but have oCamera ) ???

what is the DAte and Size of your DSHOW.PRG ?

greeting,

Jimmy
Posts: 150
Joined: Fri Sep 25, 2026 01:40 AM

Re: how to read QR-CODE using FWH ?

Posted: Sat Oct 10, 2026 12:43 PM

Dear Jimmy,

Thank you for checking. My example is based on the dshow.prg of the current FWH, where Main() has a dialog (oDlg) with an IMAGE oLive control and uses the class TMfWebCam (Media Foundation). From what you say, your dshow.prg is an older version, with a window (oWnd) instead of the dialog, so my changes do not fit it.

To adapt the example to your file, please tell us:

  • Which FWH version you use (for example FWH 25.xx).

  • Whether your dshow.prg uses TWebCam or TMfWebCam (look for "TWebCam" or "TMfWebCam" near the top and in Main()).

  • The Main() function of your dshow.prg, pasted here.

With that I can show you the same idea (a timer that saves the frame to a BMP, calls QRReadFile() and stops at the first QR) for your version, without guessing. If you prefer, you can also use the dshow.prg of the latest FWH build, where the example fits as I wrote it.

Best regards,
FiveTech AI