Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VF5 with Images on XP
Message
From
02/03/2004 07:19:41
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00881481
Message ID:
00882290
Views:
24
>Hi all,
>I've got an old VF5 application that uses the Wang Image OCX to display images. All was fine till the client upgraded to XP.
>
>Now I know that the Wang Imager isn't supported on XP but I've found a number of sites that tell you which files are requires to be copied from a Win 2000 machine (where I app runs fine). When I do that (and register the various OCX files) although the Kodakimg.exe runs fine my app crashes.
>
>Has anyone else tried this or can shed some light on the problem?
>Many thanks in anticipation.
>Caroline

Hi Caroline,

I remember going through something similar (though may not have been exact) some year(s) back. I can't quite remember what the problems were, but it probably had something to do with the AutoYield and SYS(2333) stuff. I dug out the code, so I'll just reproduce them here for you. This may not be a direct solution to your problem, but I do hope you'll find something useful from them ...

I have WangImage.ScanCtrl.1 control visually on my form, named imgScan. Nothing (properties) else set visually.

I have cboCustomerPhoto (OLEBoundControl) ...
AutoActivate = 2
AutoVerbMenu = .F.
ControlSource = CustPhot1.Photo && general field
Stretch = 2

I have a commandbutton cmdAcquire with the following code ...

LOCAL lcSetDefault, lcTempFile, liError, liScanSuccess
PRIVATE paError


IF !THISFORM.ImgScan.ScannerAvailable
MESSAGEBOX('No Scanner(s) found.',0+64+0,APP_TITLE)
RETURN .F.
ENDIF


THISFORM.MousePointer = 11

lcSetDefault = SYS(5)+SYS(2003)
lcTempFile = lcSetDefault+'\Acquire'+SUBSTR(SYS(2015),3,10)+'Temp.BMP'


WITH THISFORM
.ImgScan.ScanTo = 2 && 2=FileOnly
.ImgScan.FileType = 3 && BMP
.ImgScan.Image = lcTempFile
.ImgScan.ShowSetupBeforeScan = THISFORM.chkShowScannerSetup.VALUE
THIS.Application.AutoYield = .F. && _VFP.AutoYield = .F.
liScanSuccess = -1
liError = 0
ON ERROR liError = ERROR()
liScanSuccess = .ImgScan.StartScan()
ON ERROR
THIS.Application.AutoYield = .T.
IF liError#0
MESSAGEBOX('An error occured when trying to access your scanner.',0+64+0,APP_TITLE)
ENDIF
ENDWITH


SELECT CustPhot1
IF liScanSuccess=0 AND FILE(lcTempFile)
APPEND GENERAL Photo FROM (lcTempFile)
REPLACE Modified WITH .T.
ENDIF

THISFORM.MousePointer = 0

THISFORM.obcCustomerPhoto.REFRESH

DELETE FILE (lcTempFile)

SET DEFAULT TO &lcSetDefault


RETURN .T.



I have another commandbutton cmdSelectScanner, with the following code ...

LOCAL llSelectionMade


IF !THISFORM.ImgScan.ScannerAvailable
MESSAGEBOX('No Scanner(s) found.',0,APP_TITLE)
RETURN .F.
ENDIF


llSelectionMade = .F.
WITH THISFORM
liX = .ImgScan.ShowSelectScanner
IF liX=0 && 9233=Cancel
llSelectionMade = .T.
ENDIF
ENDWITH


RETURN llSelectionMade
Kenneth.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform