• Welcome to PlanetSquires Forums.
 
Main Menu

Recent posts

#1
Interesting! Yes, if just using a font works then by all means go for it. It would make life so much easier and then I can simply exclude not having to explicitly try to incorporate barcode support into the print preview code. The user could easily create the barcode themselves just like drawing any other text output. The only time I have ever dealt with barcodes in during the discussions that I've had with you because I have no real world use for them. Therefore my experience is very limited and I defer to you for advice on the best and easiest approach to implement barcodes in code.
#2
Hi All
Paul, I have send you an enmail just now, to keep my blunders off the group.

Something that I noticed about barcode support, is I assume you speak of Barcodes as Image objects or physical barcode drawing?

I have spoken to a few people that develops for the retail industry, and they have all abandoned barcode drawings. The easiest method is a barcode font. You do the checkdigit and encoding in a string, and output that string to a font in a document. (saves pages of coding, and superfast output with simple text tools)

We can test this with a simple one I use. Download code39 barcode font and install on your PC.
To encode a string simply add *before and *after the string you need to scan. Use the font to write the barcode in the document. It works like a charm.
All these more complicated barcodes like code128 etc have (PAYABLE) fonts available as long as you encode the string right.

Having to go that extra mile to include barcodes may not be neccesary, if this font trick works.

-regards, Peter
#3
I missed that post that its available!
Thanks a million Paul.

Will be testing this today!

-Peter
#4
Hi Paul, I'll have another look. Thanks again for the CPrintPreview class!

#5
WinFBX - Windows Framework for FreeBASIC / CMemMapFile class
Last post by Paul Squires - March 18, 2023, 06:53:42 PM
Just wanted to pass along my gratitude for this wonderful CMemMapFile class. Thanks José !

I have a need to share data between a C++ created exe and an FB created exe.

I first used the physical file memory mapped approach. Worked perfectly once I realized that the disk file must first exist and be of the buffer size that you require.

I then tried bypassing the disk file and just use shared memory between the two EXE's. The EXE that first creates the shared memory block must use the class's MapMemory method. The second EXE that attaches itself to this new shared memory must use the class's MapSharedMemory method. Both method calls must share the same mapping name, line "SHARED-MEMORY" or something that uniquely identifies the block of memory so that both EXE's know what memory to attach themselves to. Worked perfectly, once I figured that out.

Thanks again, and if anyone in the future stumbles on this post when searching for file CreateFileMapping, MapViewOfFile, or UnmapViewOfFile then you may save yourself a bit of time by remembering my couple of tips. Also look at José's documentation which (stupid me) I forgot to check out first before diving into the class and trying to learn it by studying the source code. https://github.com/JoseRoca/WinFBX/blob/master/docs/File%20Management/CMemMapFile%20Class.md

 ;D


#6
Thanks José appreciate it
#7
Done.
#8
Thanks José,

When I used your new files and compiled the WinFBE Editor source code, this RichEdit_SetCharFormat function throws a "pointer passed as scalar" warning, so you might want to update the code to do the cast.

FUNCTION = SendMessageW(hRichEdit, EM_SETCHARFORMAT, chfmt, Cast(LPARAM, lpcf))

#9
No, I have not modified the code since I uploaded it.  It was simply an exercise to see if I could get a print control working and to see if I could get a non-resource based dialog box implemented.  I had never done either.  I should have made it a class like you did.  If I remember right, I had made the printer portion a class but not the whole thing in its entirety. I must say that I love reading your well written code versus my "just get the darn thing working style". 
#10
Quote from: James Klutho on March 17, 2023, 04:59:57 PMI love the simplicity of your code.  Very nicely done.

BTW, Jim are you still working on or modifying your EZP print control?