I'm trying to put jpg files into a .dbf of garden plants.

When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
I get an error "OLE error code 0x.800401f9: Error in the DLL"

This happens on my WinXP and on my Win2000 machine. When I try it on a Win98
machine, it works.
On my XP machine, I've set the default association with .jpg to MS-Paint.

Any helpful comments?

I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same error.

Also, on the Win98 machine, I've gone to the next step of actually
attempting to print the little picture of the flowers on a report.
I put my OLE field in the report, and click "preview", and all I get is a
box where the photo is supposed to be, with the text ".jpg" in the middle.

I take that same OLE report field, and point it to
f:\plants\pics\alyssm.jpg, and the picture prints properly

I've read about this in the programmer's reference, but there's not much on
what to do when it doesn't work. My XP machine is so "service packed" and
"anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing it runs at
all.

Thanks,
Bill Freeburg

Re: .jpg into a general field, and printing it by TonySper

TonySper
Sun Mar 27 12:46:51 CST 2005

I would try;
append general pic1 from "f:\plants\pics\alyssm.jpg"
I do not think you have to put the entire command in quotes, just the
file location.
TonySper

"Bill Freeburg" <Bill@MarathonSoftware.com> wrote in message
news:eb9HfYnMFHA.3228@TK2MSFTNGP12.phx.gbl...
I'm trying to put jpg files into a .dbf of garden plants.

When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
I get an error "OLE error code 0x.800401f9: Error in the DLL"

This happens on my WinXP and on my Win2000 machine. When I try it on a
Win98
machine, it works.
On my XP machine, I've set the default association with .jpg to
MS-Paint.

Any helpful comments?

I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same
error.

Also, on the Win98 machine, I've gone to the next step of actually
attempting to print the little picture of the flowers on a report.
I put my OLE field in the report, and click "preview", and all I get
is a
box where the photo is supposed to be, with the text ".jpg" in the
middle.

I take that same OLE report field, and point it to
f:\plants\pics\alyssm.jpg, and the picture prints properly

I've read about this in the programmer's reference, but there's not
much on
what to do when it doesn't work. My XP machine is so "service packed"
and
"anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing it
runs at
all.

Thanks,
Bill Freeburg








Re: .jpg into a general field, and printing it by Anders

Anders
Sun Mar 27 12:50:44 CST 2005

General fields are sort of deprecated technology. A Memo (binary -
nocptrans) field as storage lets you copy the content to a temporary file
and show in an Image control or open with any software by using
ShellExecute( ) .
VFP9 has a Pictureval property that makes it possible to assign a Memo or
Blob (new datatype in VFP9) field as picture source for an Image object.
-Anders

"Bill Freeburg" <Bill@MarathonSoftware.com> wrote in message
news:eb9HfYnMFHA.3228@TK2MSFTNGP12.phx.gbl...
> I'm trying to put jpg files into a .dbf of garden plants.
>
> When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
> I get an error "OLE error code 0x.800401f9: Error in the DLL"
>
> This happens on my WinXP and on my Win2000 machine. When I try it on a
Win98
> machine, it works.
> On my XP machine, I've set the default association with .jpg to MS-Paint.
>
> Any helpful comments?
>
> I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same error.
>
> Also, on the Win98 machine, I've gone to the next step of actually
> attempting to print the little picture of the flowers on a report.
> I put my OLE field in the report, and click "preview", and all I get is a
> box where the photo is supposed to be, with the text ".jpg" in the middle.
>
> I take that same OLE report field, and point it to
> f:\plants\pics\alyssm.jpg, and the picture prints properly
>
> I've read about this in the programmer's reference, but there's not much
on
> what to do when it doesn't work. My XP machine is so "service packed" and
> "anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing it runs
at
> all.
>
> Thanks,
> Bill Freeburg
>
>
>
>
>
>


RE: .jpg into a general field, and printing it by Leemi

Leemi
Mon Mar 28 09:00:08 CST 2005

Hi Bill:

Try this code and see if it works.

FoxPro is at the mercy of external applications for the display of items
embedded in general fields. This would be true no matter what type of file
it is (Excel Worksheet, bitmap, jpg, etc). Going forward, your app needs to
have a more encapsulated way of dealing with this. Following is just such a
method.

REPORT
---------------
By using the MEMO BINARY field type and a UDF(), we can store .JPG files in
a table field yet when the report runs have them read from DISK. Here's how:

(1) Create a table or cursor with a structure like this (plus any added
fields as necessary)

FileName C (150)
MemBin MEMO(BINARY)

The command would be CREATE TABLE GENDBF (FileName c(150), MemoBin M
NOCPTRANS)

(2) Append .JPGs file into the MEMO(Binary) field using FILETOSTR() and set
the filename field accordingly. For instance:

INSERT INTO CURSORNAME VALUES("ToothBrush.JPG", FILETOSTR(<PathToFile>))

(3) The FoxPro report will still need an OLEBOUND control on it to print
pictures, but instead of pointing the OLEBOUND to a general field, point it
FILE and use this as the expression:

MYUDF(FileName, MemoBin)

Where MyUDF is in some program made available via SET PROC and reads thusly:

PROCEDURE MYUDF(lpFileName, lpMemoBinFld)
LOCAL lcTemp as String
lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
IF !DIRECTORY(lcTemp)
MD (lcTemp)
ENDIF
SET SAFETY OFF
STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
SET SAFETY ON
RETURN lcTemp + lpFileName

(4) Finally, preview/print the report. You may also want to fire some lines
like this to clean up afterward:

ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
RD ADDBS(SYS(2023)) + "JPGTEMP"

The .PRG uses the code above and the .JPGs that come with W2K, so it should
run on that OS with no problem.

-----------------------------------------------------------------------

FORM
----------
Let's assume we have the table created earlier:

FileName C (150)
MemBin MEMO(BINARY)

This form will display images from it:

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


**************************************************
DEFINE CLASS form1 AS form
Top = 71
Left = 48
Height = 310
Width = 504
Caption = "Fox Image Demo"
Name = "Form1"

ADD OBJECT image1 AS image WITH ;
Height = 296, ;
Left = 3, ;
Top = 8, ;
Width = 381, ;
Name = "Image1"

ADD OBJECT cmdPrevious AS commandbutton WITH ;
Top = 27, ;
Left = 422, ;
Height = 27, ;
Width = 24, ;
Caption = "<", ;
Name = "cmdPrevious"

ADD OBJECT cmdNext AS commandbutton WITH ;
Top = 27, ;
Left = 446, ;
Height = 27, ;
Width = 24, ;
Caption = ">", ;
Name = "cmdNext"

ADD OBJECT cmdQuit AS commandbutton WITH ;
Top = 72, ;
Left = 405, ;
Height = 27, ;
Width = 84, ;
Caption = "Quit", ;
Name = "cmdQuit"

PROCEDURE getimage
LPARAMETERS lpFileName, lpMemoBinFld

LOCAL lcTemp AS STRING
lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
IF !DIRECTORY(lcTemp)
MD (lcTemp)
ENDIF
SET SAFETY OFF
STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
SET SAFETY ON
RETURN lcTemp + lpFileName
ENDPROC

PROCEDURE Destroy
USE IN SELECT("PICTURES")
ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
RD ADDBS(SYS(2023)) + "JPGTEMP"
ENDPROC

PROCEDURE Load
CD JUSTPATH(SUBSTR(SYS(16),AT(' ',SYS(16),2)))
USE PICTURES
ENDPROC

PROCEDURE Init
THISFORM.Image1.Picture = ;
THIS.GetImage(Pictures.FileName, Pictures.MemBin)
ENDPROC

PROCEDURE cmdPrevious.Click
IF RECNO() <> 1
SKIP -1
THISFORM.Image1.Picture = ;
THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
THISFORM.REFRESH
ENDIF
ENDPROC

PROCEDURE cmdNext.Click
IF RECCOUNT() <> RECNO() AND !EOF()
SKIP
THISFORM.Image1.Picture = ;
THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
THISFORM.REFRESH
ENDIF
ENDPROC

PROCEDURE cmdQuit.Click
THISFORM.RELEASE
ENDPROC
ENDDEFINE
**************************************************

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003

> I'm trying to put jpg files into a .dbf of garden plants.
>
> When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
> I get an error "OLE error code 0x.800401f9: Error in the DLL"
>
> This happens on my WinXP and on my Win2000 machine. When I try it on a
Win98
> machine, it works.
> On my XP machine, I've set the default association with .jpg to MS-Paint.
>
> Any helpful comments?
>
> I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same error.
>
> Also, on the Win98 machine, I've gone to the next step of actually
> attempting to print the little picture of the flowers on a report.
> I put my OLE field in the report, and click "preview", and all I get is a
> box where the photo is supposed to be, with the text ".jpg" in the middle.
>
> I take that same OLE report field, and point it to
> f:\plants\pics\alyssm.jpg, and the picture prints properly
>
> I've read about this in the programmer's reference, but there's not much
on
> what to do when it doesn't work. My XP machine is so "service packed" and
> "anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing it runs
at
> all.
>
> Thanks,
> Bill Freeburg



Re: .jpg into a general field, and printing it by TonySper

TonySper
Mon Mar 28 10:53:14 CST 2005

Lee,
You have to be kidding. I just use
append general header from "c:\files\head.jpg"
This has worked for me for 6 years with over 700 users.
TonySper

"Lee Mitchell" <Leemi@online.microsoft.com> wrote in message
news:Z7kLdb6MFHA.2504@TK2MSFTNGXA03.phx.gbl...
Hi Bill:

Try this code and see if it works.

FoxPro is at the mercy of external applications for the display of
items
embedded in general fields. This would be true no matter what type of
file
it is (Excel Worksheet, bitmap, jpg, etc). Going forward, your app
needs to
have a more encapsulated way of dealing with this. Following is just
such a
method.

REPORT
---------------
By using the MEMO BINARY field type and a UDF(), we can store .JPG
files in
a table field yet when the report runs have them read from DISK.
Here's how:

(1) Create a table or cursor with a structure like this (plus any
added
fields as necessary)

FileName C (150)
MemBin MEMO(BINARY)

The command would be CREATE TABLE GENDBF (FileName c(150), MemoBin M
NOCPTRANS)

(2) Append .JPGs file into the MEMO(Binary) field using FILETOSTR()
and set
the filename field accordingly. For instance:

INSERT INTO CURSORNAME VALUES("ToothBrush.JPG",
FILETOSTR(<PathToFile>))

(3) The FoxPro report will still need an OLEBOUND control on it to
print
pictures, but instead of pointing the OLEBOUND to a general field,
point it
FILE and use this as the expression:

MYUDF(FileName, MemoBin)

Where MyUDF is in some program made available via SET PROC and reads
thusly:

PROCEDURE MYUDF(lpFileName, lpMemoBinFld)
LOCAL lcTemp as String
lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
IF !DIRECTORY(lcTemp)
MD (lcTemp)
ENDIF
SET SAFETY OFF
STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
SET SAFETY ON
RETURN lcTemp + lpFileName

(4) Finally, preview/print the report. You may also want to fire some
lines
like this to clean up afterward:

ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
RD ADDBS(SYS(2023)) + "JPGTEMP"

The .PRG uses the code above and the .JPGs that come with W2K, so it
should
run on that OS with no problem.

-----------------------------------------------------------------------

FORM
----------
Let's assume we have the table created earlier:

FileName C (150)
MemBin MEMO(BINARY)

This form will display images from it:

PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show
RETURN


**************************************************
DEFINE CLASS form1 AS form
Top = 71
Left = 48
Height = 310
Width = 504
Caption = "Fox Image Demo"
Name = "Form1"

ADD OBJECT image1 AS image WITH ;
Height = 296, ;
Left = 3, ;
Top = 8, ;
Width = 381, ;
Name = "Image1"

ADD OBJECT cmdPrevious AS commandbutton WITH ;
Top = 27, ;
Left = 422, ;
Height = 27, ;
Width = 24, ;
Caption = "<", ;
Name = "cmdPrevious"

ADD OBJECT cmdNext AS commandbutton WITH ;
Top = 27, ;
Left = 446, ;
Height = 27, ;
Width = 24, ;
Caption = ">", ;
Name = "cmdNext"

ADD OBJECT cmdQuit AS commandbutton WITH ;
Top = 72, ;
Left = 405, ;
Height = 27, ;
Width = 84, ;
Caption = "Quit", ;
Name = "cmdQuit"

PROCEDURE getimage
LPARAMETERS lpFileName, lpMemoBinFld

LOCAL lcTemp AS STRING
lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
IF !DIRECTORY(lcTemp)
MD (lcTemp)
ENDIF
SET SAFETY OFF
STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
SET SAFETY ON
RETURN lcTemp + lpFileName
ENDPROC

PROCEDURE Destroy
USE IN SELECT("PICTURES")
ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
RD ADDBS(SYS(2023)) + "JPGTEMP"
ENDPROC

PROCEDURE Load
CD JUSTPATH(SUBSTR(SYS(16),AT(' ',SYS(16),2)))
USE PICTURES
ENDPROC

PROCEDURE Init
THISFORM.Image1.Picture = ;
THIS.GetImage(Pictures.FileName, Pictures.MemBin)
ENDPROC

PROCEDURE cmdPrevious.Click
IF RECNO() <> 1
SKIP -1
THISFORM.Image1.Picture = ;
THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
THISFORM.REFRESH
ENDIF
ENDPROC

PROCEDURE cmdNext.Click
IF RECCOUNT() <> RECNO() AND !EOF()
SKIP
THISFORM.Image1.Picture = ;
THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
THISFORM.REFRESH
ENDIF
ENDPROC

PROCEDURE cmdQuit.Click
THISFORM.RELEASE
ENDPROC
ENDDEFINE
**************************************************

I hope this helps.

This posting is provided "AS IS" with no warranties, and confers no
rights.

Sincerely,
Microsoft FoxPro Technical Support
Lee Mitchell

*-- VFP9 HAS ARRIVED!! --*
Read about all the new features of VFP9 here:
http://msdn.microsoft.com/vfoxpro/

*--Purchase VFP 9.0 here:
http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
69-4500-8bf2-3f06689f4ab3&type=ovr

Keep an eye on the product lifecycle for Visual FoxPro here:
http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
- VFP5 Mainstream Support retired June 30th, 2003
- VFP6 Mainstream Support retired Sept. 30th, 2003

> I'm trying to put jpg files into a .dbf of garden plants.
>
> When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
> I get an error "OLE error code 0x.800401f9: Error in the DLL"
>
> This happens on my WinXP and on my Win2000 machine. When I try it on
> a
Win98
> machine, it works.
> On my XP machine, I've set the default association with .jpg to
> MS-Paint.
>
> Any helpful comments?
>
> I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same
> error.
>
> Also, on the Win98 machine, I've gone to the next step of actually
> attempting to print the little picture of the flowers on a report.
> I put my OLE field in the report, and click "preview", and all I get
> is a
> box where the photo is supposed to be, with the text ".jpg" in the
> middle.
>
> I take that same OLE report field, and point it to
> f:\plants\pics\alyssm.jpg, and the picture prints properly
>
> I've read about this in the programmer's reference, but there's not
> much
on
> what to do when it doesn't work. My XP machine is so "service
> packed" and
> "anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing it
> runs
at
> all.
>
> Thanks,
> Bill Freeburg




Re: .jpg into a general field, and printing it by Bill

Bill
Mon Mar 28 14:12:19 CST 2005

Thanks for the suggestions.

I'll try these things. I've also found that using 256 color .bmp's works,
while .jpg's cause problems, as well as .bmp's with millions of colors.

I still don't know why appending the .jpg's work on a win98 machine and not
on an XP machine. The DLL error isn't something I have deciphered.

Lee makes a good point that general fields rely on exterior applications.
I'm thinking that Tony's client machines have a default config that I've
deviated from somehow by installing some external program, such as Jasc
PaintShop Pro, and Lee's done the same thing, but has solved the problem.

I don't understand the whole OLE process well enough to debug my problem,
and avoiding it by using .bmp's will work for me. I'm not ready to move to
VFP9.

Thanks again,
Bill Freeburg



Re: .jpg into a general field, and printing it by Fred

Fred
Mon Mar 28 19:14:55 CST 2005

And it won't work the very first time one of your users has a different
application that handles JPGs from the rest.

--
Fred
Microsoft Visual FoxPro MVP


"TonySper" <tsperduti@bellsouth.net> wrote in message
news:_DW1e.66892$6g7.33528@bignews1.bellsouth.net...
> Lee,
> You have to be kidding. I just use
> append general header from "c:\files\head.jpg"
> This has worked for me for 6 years with over 700 users.
> TonySper
>
> "Lee Mitchell" <Leemi@online.microsoft.com> wrote in message
> news:Z7kLdb6MFHA.2504@TK2MSFTNGXA03.phx.gbl...
> Hi Bill:
>
> Try this code and see if it works.
>
> FoxPro is at the mercy of external applications for the display of
> items
> embedded in general fields. This would be true no matter what type of
> file
> it is (Excel Worksheet, bitmap, jpg, etc). Going forward, your app
> needs to
> have a more encapsulated way of dealing with this. Following is just
> such a
> method.
>
> REPORT
> ---------------
> By using the MEMO BINARY field type and a UDF(), we can store .JPG
> files in
> a table field yet when the report runs have them read from DISK.
> Here's how:
>
> (1) Create a table or cursor with a structure like this (plus any
> added
> fields as necessary)
>
> FileName C (150)
> MemBin MEMO(BINARY)
>
> The command would be CREATE TABLE GENDBF (FileName c(150), MemoBin M
> NOCPTRANS)
>
> (2) Append .JPGs file into the MEMO(Binary) field using FILETOSTR()
> and set
> the filename field accordingly. For instance:
>
> INSERT INTO CURSORNAME VALUES("ToothBrush.JPG",
> FILETOSTR(<PathToFile>))
>
> (3) The FoxPro report will still need an OLEBOUND control on it to
> print
> pictures, but instead of pointing the OLEBOUND to a general field,
> point it
> FILE and use this as the expression:
>
> MYUDF(FileName, MemoBin)
>
> Where MyUDF is in some program made available via SET PROC and reads
> thusly:
>
> PROCEDURE MYUDF(lpFileName, lpMemoBinFld)
> LOCAL lcTemp as String
> lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
> IF !DIRECTORY(lcTemp)
> MD (lcTemp)
> ENDIF
> SET SAFETY OFF
> STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
> SET SAFETY ON
> RETURN lcTemp + lpFileName
>
> (4) Finally, preview/print the report. You may also want to fire some
> lines
> like this to clean up afterward:
>
> ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
> RD ADDBS(SYS(2023)) + "JPGTEMP"
>
> The .PRG uses the code above and the .JPGs that come with W2K, so it
> should
> run on that OS with no problem.
>
> -----------------------------------------------------------------------
>
> FORM
> ----------
> Let's assume we have the table created earlier:
>
> FileName C (150)
> MemBin MEMO(BINARY)
>
> This form will display images from it:
>
> PUBLIC oform1
>
> oform1=NEWOBJECT("form1")
> oform1.Show
> RETURN
>
>
> **************************************************
> DEFINE CLASS form1 AS form
> Top = 71
> Left = 48
> Height = 310
> Width = 504
> Caption = "Fox Image Demo"
> Name = "Form1"
>
> ADD OBJECT image1 AS image WITH ;
> Height = 296, ;
> Left = 3, ;
> Top = 8, ;
> Width = 381, ;
> Name = "Image1"
>
> ADD OBJECT cmdPrevious AS commandbutton WITH ;
> Top = 27, ;
> Left = 422, ;
> Height = 27, ;
> Width = 24, ;
> Caption = "<", ;
> Name = "cmdPrevious"
>
> ADD OBJECT cmdNext AS commandbutton WITH ;
> Top = 27, ;
> Left = 446, ;
> Height = 27, ;
> Width = 24, ;
> Caption = ">", ;
> Name = "cmdNext"
>
> ADD OBJECT cmdQuit AS commandbutton WITH ;
> Top = 72, ;
> Left = 405, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Quit", ;
> Name = "cmdQuit"
>
> PROCEDURE getimage
> LPARAMETERS lpFileName, lpMemoBinFld
>
> LOCAL lcTemp AS STRING
> lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
> IF !DIRECTORY(lcTemp)
> MD (lcTemp)
> ENDIF
> SET SAFETY OFF
> STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
> SET SAFETY ON
> RETURN lcTemp + lpFileName
> ENDPROC
>
> PROCEDURE Destroy
> USE IN SELECT("PICTURES")
> ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
> RD ADDBS(SYS(2023)) + "JPGTEMP"
> ENDPROC
>
> PROCEDURE Load
> CD JUSTPATH(SUBSTR(SYS(16),AT(' ',SYS(16),2)))
> USE PICTURES
> ENDPROC
>
> PROCEDURE Init
> THISFORM.Image1.Picture = ;
> THIS.GetImage(Pictures.FileName, Pictures.MemBin)
> ENDPROC
>
> PROCEDURE cmdPrevious.Click
> IF RECNO() <> 1
> SKIP -1
> THISFORM.Image1.Picture = ;
> THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
> THISFORM.REFRESH
> ENDIF
> ENDPROC
>
> PROCEDURE cmdNext.Click
> IF RECCOUNT() <> RECNO() AND !EOF()
> SKIP
> THISFORM.Image1.Picture = ;
> THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
> THISFORM.REFRESH
> ENDIF
> ENDPROC
>
> PROCEDURE cmdQuit.Click
> THISFORM.RELEASE
> ENDPROC
> ENDDEFINE
> **************************************************
>
> I hope this helps.
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> Sincerely,
> Microsoft FoxPro Technical Support
> Lee Mitchell
>
> *-- VFP9 HAS ARRIVED!! --*
> Read about all the new features of VFP9 here:
> http://msdn.microsoft.com/vfoxpro/
>
> *--Purchase VFP 9.0 here:
> http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
> 69-4500-8bf2-3f06689f4ab3&type=ovr
>
> Keep an eye on the product lifecycle for Visual FoxPro here:
> http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
> - VFP5 Mainstream Support retired June 30th, 2003
> - VFP6 Mainstream Support retired Sept. 30th, 2003
>
>> I'm trying to put jpg files into a .dbf of garden plants.
>>
>> When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
>> I get an error "OLE error code 0x.800401f9: Error in the DLL"
>>
>> This happens on my WinXP and on my Win2000 machine. When I try it on
>> a
> Win98
>> machine, it works.
>> On my XP machine, I've set the default association with .jpg to
>> MS-Paint.
>>
>> Any helpful comments?
>>
>> I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same
>> error.
>>
>> Also, on the Win98 machine, I've gone to the next step of actually
>> attempting to print the little picture of the flowers on a report.
>> I put my OLE field in the report, and click "preview", and all I get
>> is a
>> box where the photo is supposed to be, with the text ".jpg" in the
>> middle.
>>
>> I take that same OLE report field, and point it to
>> f:\plants\pics\alyssm.jpg, and the picture prints properly
>>
>> I've read about this in the programmer's reference, but there's not
>> much
> on
>> what to do when it doesn't work. My XP machine is so "service
>> packed" and
>> "anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing it
>> runs
> at
>> all.
>>
>> Thanks,
>> Bill Freeburg
>
>
>



Re: .jpg into a general field, and printing it by TonySper

TonySper
Tue Mar 29 17:59:34 CST 2005

Bill,
I am using XP and I know of 20 others that are using XP and the
general field works just fine on them. Yes the .bmp works just as well
and so do .DOC files work as I do use the general field to send .DOC
files to reports with no problems. If you are using the jpg files in a
report you can just use the picture field in a report and not use any
general fields which is a better way to go as then you can put all you
JPG's in a folder and use them directly from the reports.
TonySper

"Bill Freeburg" <Bill@MarathonSoftware.com> wrote in message
news:OW0f5N9MFHA.2604@TK2MSFTNGP10.phx.gbl...
Thanks for the suggestions.

I'll try these things. I've also found that using 256 color .bmp's
works,
while .jpg's cause problems, as well as .bmp's with millions of
colors.

I still don't know why appending the .jpg's work on a win98 machine
and not
on an XP machine. The DLL error isn't something I have deciphered.

Lee makes a good point that general fields rely on exterior
applications.
I'm thinking that Tony's client machines have a default config that
I've
deviated from somehow by installing some external program, such as
Jasc
PaintShop Pro, and Lee's done the same thing, but has solved the
problem.

I don't understand the whole OLE process well enough to debug my
problem,
and avoiding it by using .bmp's will work for me. I'm not ready to
move to
VFP9.

Thanks again,
Bill Freeburg




Re: .jpg into a general field, and printing it by TonySper

TonySper
Tue Mar 29 18:04:10 CST 2005

Fred,
You have me confused and interested in learning. What do you mean by
"different applications that handles JPGs from the rest"? Can you
expand on what may bite me in the future?
TonySper

"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
news:%23$NK1y$MFHA.2704@TK2MSFTNGP15.phx.gbl...
And it won't work the very first time one of your users has a
different
application that handles JPGs from the rest.

--
Fred
Microsoft Visual FoxPro MVP


"TonySper" <tsperduti@bellsouth.net> wrote in message
news:_DW1e.66892$6g7.33528@bignews1.bellsouth.net...
> Lee,
> You have to be kidding. I just use
> append general header from "c:\files\head.jpg"
> This has worked for me for 6 years with over 700 users.
> TonySper
>
> "Lee Mitchell" <Leemi@online.microsoft.com> wrote in message
> news:Z7kLdb6MFHA.2504@TK2MSFTNGXA03.phx.gbl...
> Hi Bill:
>
> Try this code and see if it works.
>
> FoxPro is at the mercy of external applications for the display of
> items
> embedded in general fields. This would be true no matter what type
> of
> file
> it is (Excel Worksheet, bitmap, jpg, etc). Going forward, your app
> needs to
> have a more encapsulated way of dealing with this. Following is just
> such a
> method.
>
> REPORT
> ---------------
> By using the MEMO BINARY field type and a UDF(), we can store .JPG
> files in
> a table field yet when the report runs have them read from DISK.
> Here's how:
>
> (1) Create a table or cursor with a structure like this (plus any
> added
> fields as necessary)
>
> FileName C (150)
> MemBin MEMO(BINARY)
>
> The command would be CREATE TABLE GENDBF (FileName c(150), MemoBin M
> NOCPTRANS)
>
> (2) Append .JPGs file into the MEMO(Binary) field using FILETOSTR()
> and set
> the filename field accordingly. For instance:
>
> INSERT INTO CURSORNAME VALUES("ToothBrush.JPG",
> FILETOSTR(<PathToFile>))
>
> (3) The FoxPro report will still need an OLEBOUND control on it to
> print
> pictures, but instead of pointing the OLEBOUND to a general field,
> point it
> FILE and use this as the expression:
>
> MYUDF(FileName, MemoBin)
>
> Where MyUDF is in some program made available via SET PROC and reads
> thusly:
>
> PROCEDURE MYUDF(lpFileName, lpMemoBinFld)
> LOCAL lcTemp as String
> lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
> IF !DIRECTORY(lcTemp)
> MD (lcTemp)
> ENDIF
> SET SAFETY OFF
> STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
> SET SAFETY ON
> RETURN lcTemp + lpFileName
>
> (4) Finally, preview/print the report. You may also want to fire
> some
> lines
> like this to clean up afterward:
>
> ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
> RD ADDBS(SYS(2023)) + "JPGTEMP"
>
> The .PRG uses the code above and the .JPGs that come with W2K, so it
> should
> run on that OS with no problem.
>
> -----------------------------------------------------------------------
>
> FORM
> ----------
> Let's assume we have the table created earlier:
>
> FileName C (150)
> MemBin MEMO(BINARY)
>
> This form will display images from it:
>
> PUBLIC oform1
>
> oform1=NEWOBJECT("form1")
> oform1.Show
> RETURN
>
>
> **************************************************
> DEFINE CLASS form1 AS form
> Top = 71
> Left = 48
> Height = 310
> Width = 504
> Caption = "Fox Image Demo"
> Name = "Form1"
>
> ADD OBJECT image1 AS image WITH ;
> Height = 296, ;
> Left = 3, ;
> Top = 8, ;
> Width = 381, ;
> Name = "Image1"
>
> ADD OBJECT cmdPrevious AS commandbutton WITH ;
> Top = 27, ;
> Left = 422, ;
> Height = 27, ;
> Width = 24, ;
> Caption = "<", ;
> Name = "cmdPrevious"
>
> ADD OBJECT cmdNext AS commandbutton WITH ;
> Top = 27, ;
> Left = 446, ;
> Height = 27, ;
> Width = 24, ;
> Caption = ">", ;
> Name = "cmdNext"
>
> ADD OBJECT cmdQuit AS commandbutton WITH ;
> Top = 72, ;
> Left = 405, ;
> Height = 27, ;
> Width = 84, ;
> Caption = "Quit", ;
> Name = "cmdQuit"
>
> PROCEDURE getimage
> LPARAMETERS lpFileName, lpMemoBinFld
>
> LOCAL lcTemp AS STRING
> lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
> IF !DIRECTORY(lcTemp)
> MD (lcTemp)
> ENDIF
> SET SAFETY OFF
> STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
> SET SAFETY ON
> RETURN lcTemp + lpFileName
> ENDPROC
>
> PROCEDURE Destroy
> USE IN SELECT("PICTURES")
> ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
> RD ADDBS(SYS(2023)) + "JPGTEMP"
> ENDPROC
>
> PROCEDURE Load
> CD JUSTPATH(SUBSTR(SYS(16),AT(' ',SYS(16),2)))
> USE PICTURES
> ENDPROC
>
> PROCEDURE Init
> THISFORM.Image1.Picture = ;
> THIS.GetImage(Pictures.FileName, Pictures.MemBin)
> ENDPROC
>
> PROCEDURE cmdPrevious.Click
> IF RECNO() <> 1
> SKIP -1
> THISFORM.Image1.Picture = ;
> THISFORM.GetImage(Pictures.FileName,
> Pictures.MemBin)
> THISFORM.REFRESH
> ENDIF
> ENDPROC
>
> PROCEDURE cmdNext.Click
> IF RECCOUNT() <> RECNO() AND !EOF()
> SKIP
> THISFORM.Image1.Picture = ;
> THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
> THISFORM.REFRESH
> ENDIF
> ENDPROC
>
> PROCEDURE cmdQuit.Click
> THISFORM.RELEASE
> ENDPROC
> ENDDEFINE
> **************************************************
>
> I hope this helps.
>
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
> Sincerely,
> Microsoft FoxPro Technical Support
> Lee Mitchell
>
> *-- VFP9 HAS ARRIVED!! --*
> Read about all the new features of VFP9 here:
> http://msdn.microsoft.com/vfoxpro/
>
> *--Purchase VFP 9.0 here:
> http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
> 69-4500-8bf2-3f06689f4ab3&type=ovr
>
> Keep an eye on the product lifecycle for Visual FoxPro here:
> http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
> - VFP5 Mainstream Support retired June 30th, 2003
> - VFP6 Mainstream Support retired Sept. 30th, 2003
>
>> I'm trying to put jpg files into a .dbf of garden plants.
>>
>> When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
>> I get an error "OLE error code 0x.800401f9: Error in the DLL"
>>
>> This happens on my WinXP and on my Win2000 machine. When I try it
>> on
>> a
> Win98
>> machine, it works.
>> On my XP machine, I've set the default association with .jpg to
>> MS-Paint.
>>
>> Any helpful comments?
>>
>> I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same
>> error.
>>
>> Also, on the Win98 machine, I've gone to the next step of actually
>> attempting to print the little picture of the flowers on a report.
>> I put my OLE field in the report, and click "preview", and all I
>> get
>> is a
>> box where the photo is supposed to be, with the text ".jpg" in the
>> middle.
>>
>> I take that same OLE report field, and point it to
>> f:\plants\pics\alyssm.jpg, and the picture prints properly
>>
>> I've read about this in the programmer's reference, but there's not
>> much
> on
>> what to do when it doesn't work. My XP machine is so "service
>> packed" and
>> "anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing
>> it
>> runs
> at
>> all.
>>
>> Thanks,
>> Bill Freeburg
>
>
>




Re: .jpg into a general field, and printing it by Fred

Fred
Tue Mar 29 19:15:46 CST 2005

Where we were bitten was BMPs stored in a general field. When we moved from
W98 to W2K, nothing worked in printing the reports, or accessing the BMP
files. It's just not worth the headache. We also encountered the same
problem with JPG files in a General field, so that was the end of our usage
of them.

--
Fred
Microsoft Visual FoxPro MVP


"TonySper" <tsperduti@bellsouth.net> wrote in message
news:_1m2e.366$f%4.343@bignews1.bellsouth.net...
> Fred,
> You have me confused and interested in learning. What do you mean by
> "different applications that handles JPGs from the rest"? Can you
> expand on what may bite me in the future?
> TonySper
>
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> news:%23$NK1y$MFHA.2704@TK2MSFTNGP15.phx.gbl...
> And it won't work the very first time one of your users has a
> different
> application that handles JPGs from the rest.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "TonySper" <tsperduti@bellsouth.net> wrote in message
> news:_DW1e.66892$6g7.33528@bignews1.bellsouth.net...
>> Lee,
>> You have to be kidding. I just use
>> append general header from "c:\files\head.jpg"
>> This has worked for me for 6 years with over 700 users.
>> TonySper
>>
>> "Lee Mitchell" <Leemi@online.microsoft.com> wrote in message
>> news:Z7kLdb6MFHA.2504@TK2MSFTNGXA03.phx.gbl...
>> Hi Bill:
>>
>> Try this code and see if it works.
>>
>> FoxPro is at the mercy of external applications for the display of
>> items
>> embedded in general fields. This would be true no matter what type
>> of
>> file
>> it is (Excel Worksheet, bitmap, jpg, etc). Going forward, your app
>> needs to
>> have a more encapsulated way of dealing with this. Following is just
>> such a
>> method.
>>
>> REPORT
>> ---------------
>> By using the MEMO BINARY field type and a UDF(), we can store .JPG
>> files in
>> a table field yet when the report runs have them read from DISK.
>> Here's how:
>>
>> (1) Create a table or cursor with a structure like this (plus any
>> added
>> fields as necessary)
>>
>> FileName C (150)
>> MemBin MEMO(BINARY)
>>
>> The command would be CREATE TABLE GENDBF (FileName c(150), MemoBin M
>> NOCPTRANS)
>>
>> (2) Append .JPGs file into the MEMO(Binary) field using FILETOSTR()
>> and set
>> the filename field accordingly. For instance:
>>
>> INSERT INTO CURSORNAME VALUES("ToothBrush.JPG",
>> FILETOSTR(<PathToFile>))
>>
>> (3) The FoxPro report will still need an OLEBOUND control on it to
>> print
>> pictures, but instead of pointing the OLEBOUND to a general field,
>> point it
>> FILE and use this as the expression:
>>
>> MYUDF(FileName, MemoBin)
>>
>> Where MyUDF is in some program made available via SET PROC and reads
>> thusly:
>>
>> PROCEDURE MYUDF(lpFileName, lpMemoBinFld)
>> LOCAL lcTemp as String
>> lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
>> IF !DIRECTORY(lcTemp)
>> MD (lcTemp)
>> ENDIF
>> SET SAFETY OFF
>> STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
>> SET SAFETY ON
>> RETURN lcTemp + lpFileName
>>
>> (4) Finally, preview/print the report. You may also want to fire
>> some
>> lines
>> like this to clean up afterward:
>>
>> ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
>> RD ADDBS(SYS(2023)) + "JPGTEMP"
>>
>> The .PRG uses the code above and the .JPGs that come with W2K, so it
>> should
>> run on that OS with no problem.
>>
>> -----------------------------------------------------------------------
>>
>> FORM
>> ----------
>> Let's assume we have the table created earlier:
>>
>> FileName C (150)
>> MemBin MEMO(BINARY)
>>
>> This form will display images from it:
>>
>> PUBLIC oform1
>>
>> oform1=NEWOBJECT("form1")
>> oform1.Show
>> RETURN
>>
>>
>> **************************************************
>> DEFINE CLASS form1 AS form
>> Top = 71
>> Left = 48
>> Height = 310
>> Width = 504
>> Caption = "Fox Image Demo"
>> Name = "Form1"
>>
>> ADD OBJECT image1 AS image WITH ;
>> Height = 296, ;
>> Left = 3, ;
>> Top = 8, ;
>> Width = 381, ;
>> Name = "Image1"
>>
>> ADD OBJECT cmdPrevious AS commandbutton WITH ;
>> Top = 27, ;
>> Left = 422, ;
>> Height = 27, ;
>> Width = 24, ;
>> Caption = "<", ;
>> Name = "cmdPrevious"
>>
>> ADD OBJECT cmdNext AS commandbutton WITH ;
>> Top = 27, ;
>> Left = 446, ;
>> Height = 27, ;
>> Width = 24, ;
>> Caption = ">", ;
>> Name = "cmdNext"
>>
>> ADD OBJECT cmdQuit AS commandbutton WITH ;
>> Top = 72, ;
>> Left = 405, ;
>> Height = 27, ;
>> Width = 84, ;
>> Caption = "Quit", ;
>> Name = "cmdQuit"
>>
>> PROCEDURE getimage
>> LPARAMETERS lpFileName, lpMemoBinFld
>>
>> LOCAL lcTemp AS STRING
>> lcTemp = ADDBS(SYS(2023)) + "JPGTEMP\"
>> IF !DIRECTORY(lcTemp)
>> MD (lcTemp)
>> ENDIF
>> SET SAFETY OFF
>> STRTOFILE(lpMemoBinFld, lcTemp + lpFileName)
>> SET SAFETY ON
>> RETURN lcTemp + lpFileName
>> ENDPROC
>>
>> PROCEDURE Destroy
>> USE IN SELECT("PICTURES")
>> ERASE ADDBS(SYS(2023)) + "JPGTEMP\*.jpg"
>> RD ADDBS(SYS(2023)) + "JPGTEMP"
>> ENDPROC
>>
>> PROCEDURE Load
>> CD JUSTPATH(SUBSTR(SYS(16),AT(' ',SYS(16),2)))
>> USE PICTURES
>> ENDPROC
>>
>> PROCEDURE Init
>> THISFORM.Image1.Picture = ;
>> THIS.GetImage(Pictures.FileName, Pictures.MemBin)
>> ENDPROC
>>
>> PROCEDURE cmdPrevious.Click
>> IF RECNO() <> 1
>> SKIP -1
>> THISFORM.Image1.Picture = ;
>> THISFORM.GetImage(Pictures.FileName,
>> Pictures.MemBin)
>> THISFORM.REFRESH
>> ENDIF
>> ENDPROC
>>
>> PROCEDURE cmdNext.Click
>> IF RECCOUNT() <> RECNO() AND !EOF()
>> SKIP
>> THISFORM.Image1.Picture = ;
>> THISFORM.GetImage(Pictures.FileName, Pictures.MemBin)
>> THISFORM.REFRESH
>> ENDIF
>> ENDPROC
>>
>> PROCEDURE cmdQuit.Click
>> THISFORM.RELEASE
>> ENDPROC
>> ENDDEFINE
>> **************************************************
>>
>> I hope this helps.
>>
>> This posting is provided "AS IS" with no warranties, and confers no
>> rights.
>>
>> Sincerely,
>> Microsoft FoxPro Technical Support
>> Lee Mitchell
>>
>> *-- VFP9 HAS ARRIVED!! --*
>> Read about all the new features of VFP9 here:
>> http://msdn.microsoft.com/vfoxpro/
>>
>> *--Purchase VFP 9.0 here:
>> http://www.microsoft.com/PRODUCTS/info/product.aspx?view=22&pcid=54787e64-52
>> 69-4500-8bf2-3f06689f4ab3&type=ovr
>>
>> Keep an eye on the product lifecycle for Visual FoxPro here:
>> http://support.microsoft.com/default.aspx?id=fh;[ln];lifeprodv
>> - VFP5 Mainstream Support retired June 30th, 2003
>> - VFP6 Mainstream Support retired Sept. 30th, 2003
>>
>>> I'm trying to put jpg files into a .dbf of garden plants.
>>>
>>> When I say "append general pic1 from f:\plants\pics\alyssm.jpg"
>>> I get an error "OLE error code 0x.800401f9: Error in the DLL"
>>>
>>> This happens on my WinXP and on my Win2000 machine. When I try it
>>> on
>>> a
>> Win98
>>> machine, it works.
>>> On my XP machine, I've set the default association with .jpg to
>>> MS-Paint.
>>>
>>> Any helpful comments?
>>>
>>> I'm using VFP 6.0, and also tried it with the free 9.0 beta. Same
>>> error.
>>>
>>> Also, on the Win98 machine, I've gone to the next step of actually
>>> attempting to print the little picture of the flowers on a report.
>>> I put my OLE field in the report, and click "preview", and all I
>>> get
>>> is a
>>> box where the photo is supposed to be, with the text ".jpg" in the
>>> middle.
>>>
>>> I take that same OLE report field, and point it to
>>> f:\plants\pics\alyssm.jpg, and the picture prints properly
>>>
>>> I've read about this in the programmer's reference, but there's not
>>> much
>> on
>>> what to do when it doesn't work. My XP machine is so "service
>>> packed" and
>>> "anti virus'd" and "anti-spyware'd" and "firewalled" it's amazing
>>> it
>>> runs
>> at
>>> all.
>>>
>>> Thanks,
>>> Bill Freeburg
>>
>>
>>
>
>
>



Re: .jpg into a general field, and printing it by TonySper

TonySper
Thu Mar 31 09:40:53 CST 2005

Fred,
Thanks for the info. I have not run into that problem as yet. I am
only using the general field for putting letterheads on some invoice
reports but also have an over ride where if there is no data in the
general field the report looks for a different named jpg in the folder
and uses that jpg directly in the report as a picture field. In other
words I have two reports, one is used if there is data in the general
field and the other is used if there is a named jpg in the folder.
After reviewing your comments I will update the program and remove the
general field as the picture field in the report works very well and
does allow the user to put the jpg in a folder and not worry about
loading up the database. I more than likely have been lucky so far.
TonySper

"Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
news:%23Qht9XMNFHA.1096@tk2msftngp13.phx.gbl...
Where we were bitten was BMPs stored in a general field. When we
moved from
W98 to W2K, nothing worked in printing the reports, or accessing the
BMP
files. It's just not worth the headache. We also encountered the
same
problem with JPG files in a General field, so that was the end of our
usage
of them.

--
Fred
Microsoft Visual FoxPro MVP


"TonySper" <tsperduti@bellsouth.net> wrote in message
news:_1m2e.366$f%4.343@bignews1.bellsouth.net...
> Fred,
> You have me confused and interested in learning. What do you mean by
> "different applications that handles JPGs from the rest"? Can you
> expand on what may bite me in the future?
> TonySper
>
> "Fred Taylor" <ftaylor@mvps.org!REMOVE> wrote in message
> news:%23$NK1y$MFHA.2704@TK2MSFTNGP15.phx.gbl...
> And it won't work the very first time one of your users has a
> different
> application that handles JPGs from the rest.
>
> --
> Fred
> Microsoft Visual FoxPro MVP
>
>
> "TonySper" <tsperduti@bellsouth.net> wrote in message
> news:_DW1e.66892$6g