Dave
The answer to Q1 would be, pass back a string. Pass back the QR code as a character string and store it in a memory variable. If this is being managed from within VFP you will already have the filename, but if Fox doesn't have that, pass it back as well because you'll need to tie the code string to something.

I think you might have achieved all you want with No.1.
Your item 2 seems to be a tad repetitive. If you're running a VFP report then all you need is the QR Code, the name of the file (or the name of the code, whichever is appropriate) and you already have those. It's not obvious where/why FileToStr() would enter the fray.

GT



On 20/11/12 20:57, Dave Crozier wrote:
Gary,
It isn't the QR codes that I have a problem with, I've sorted out all the 
coding for that myself in C# so I can create, read and print them no problem. I 
just want to be able to:

1. Pass the finished QR code (image) back to VFP from the ActiveX/DLL so I can 
use it in reports as per standard VFP image control. i.e what do I pass back? 
Memory Stream, blob string etc etc... I don't know.

2. Pass a document to my "ActiveX/DLL" and pass back the QR Code content as a 
string. I can already do this if I just pass in the location of the QR Code image to my 
ActiveX as I have worked out how to expose properties and methods to VFP from it. I guess 
I could convert the image to a string FiletoStr() and pass that in for this purpose 
unless anyone else has any better ideas.

Dave


-----Original Message-----
From: ProFox [mailto:[email protected]] On Behalf Of GaryT
Sent: 19 November 2012 17:38
To: ProFox Email List
Subject: Re: QR Codes in VFP

Dave,

You will have to determine precisely what you're being given to work with.  
Then either study the official JPEG/JFIF Standards, find the standard that 
governs the file you're reading and from that determine precisely where within 
the file the info is stored, and extract it...
(the Standards are not light reading)

OR

simply ask the file creator/publisher where in the file is the data

OR

do it the way I did it once by converting the entire file to ASCII and
examining the result.

Once you have the required offset the rest will be relatively
straightforward.

Years ago as part of a larger job I had to determine the exact
dimensions of a JPEG/JFIF so that a VFP window could be created, for
display etc.

I avoided the search through the official JPEG Standards; that would
have been a nightmare. Instead, using VFP low-level functions I
converted the entire file from HEX to ASCII, found what I thought looked
like the dimensions (in pixels from memory) and then ran the same test
on many other files. They all had the same info stored at exactly the
same offset and the rest of the job was easy.

Since QR codes are relatively new, I think you'll have more luck with
the file publisher - they MUST know exactly where in the file this data
is being placed, and it will be consistent.  It's possible the official
Standards haven't even caught up with the outside world, so I would
begin with the file creator/publisher anyway.

GaryT



On 20/11/12 02:59, Dave Crozier wrote:
I have developed a QR Code print/read application in C# including a library 
that does all the encoding/decoding. I use a canvas to produce the QR code on 
and can decrypt a QR code embedded in a JPG or PNG.

I now want to produce an ActiveX/dll that VFP can use in reportsin order to 
print out QR codes on a VFP report  and I'm at a loss on how/what to pass back 
to VFP from the ActiveX.

As for the physical activeX, I have no problem creating it in C# and have a 
template that can  send back numerics or strings as properties in the ActiveX 
from C# so that VFP can receive them, I just have no idea where to look to get 
an feel for what I should send back to VFP e.g Stream, string etc. Any ideas, 
or help on where to look?

Dave


[excessive quoting removed by server]

_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/[email protected]
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

Reply via email to