This project has moved and is read-only. For the latest updates, please go here.

Working in VB6

May 17, 2013 at 9:21 PM
I have a old project want add some QR-Code feature.
Can ZXing.Net work with Visual Basic 6 ?
May 17, 2013 at 11:08 PM
At least with the commandline tool.
A direct use without an external process could be with the use of COM interop.
But I did never try that. And I have no VB6 development environment for testing.
If you only want to decode static images or encode some new ones the use of the commandline should be the easiest way.
May 18, 2013 at 3:37 AM
Thank you for advice, I going to try it, once finish, I will report the result here.
May 18, 2013 at 5:54 AM
I'm using Windows 7 64bits

After Test ...... the CommandLineEncoder work fine !!

But the CommandLineDecoder report the Error list below :

System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind)  D:\Entwicklung\Tools\Internet\ZXing.Net.Build.4\Clients\CommandLineDecoder\DecodeThread.cs: Line 74
System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
By the way, The path "D:\Entwicklung\Tools\Internet\ZXing.Net.Build.4\Clients\CommandLineDecoder\DecodeThread.cs" is NOT in my computer !!!

I tried ......
"CommandLineDecoder.exe MyImg.png"
"CommandLineDecoder.exe MyImg.png --multi"
"CommandLineDecoder.exe MyImg.png --dump_results"
"CommandLineDecoder.exe MyImg.png --multi --dump_results"
...... Same problem
May 18, 2013 at 8:08 AM
I did fixed the Error of CommandLineDecoder

The Image name need "FULL PATH"

"CommandLineDecoder.exe MyImg.png --dump_results"
to be
"CommandLineDecoder.exe C:\MyPath\MySubPath\MyImg.png --dump_results"

I tested with VB6, if work fine also !!!

If all the Encoder & Edcoder results are copy to ClipBoard is better,
I should not need get back from TEXT file (Because I can't get the result from the DOS SHELL with VB6)

Thanks for ZXing.Net project !!! ...... Thanks Micjahn
May 18, 2013 at 8:36 PM
The current version of the commandline encoder and decoder support the clipboard now.
I fixed the error with relative file paths, too.
You can get the current source from the repository. You have to build your own version of the commandline tools.
May 19, 2013 at 4:39 PM
I did build the commandline Encode and Decode, and tested

About The CommandLineEncoder

1) Get from Clipboard work fine ! ....... :) .......... It work on DOS Command and VB6 Both
2) The file path also tested, fixed sure, thanks for concern.

About The CommandLineDecoder

1) I tested use the option ......... --copy_to_clipboard (the help manual not modify yet)
..... It work fine at DOS prompt but VB6
..... before this post, I did use DOS Pipe to do this, Ex. ..... C:> CommandLineDecoder MyImg.png | CLIP <<<< Use CLIP command
..... It could get the TEXT to my ClipBoard of caurse, but once I put this command to VB6 SHELL, it can NOT work !!!
..... Like this, I put .... CommandLineDecoder MyImg.png --copy_to_clipboard, also NOT work within VB6

2) I suggest the clipboard content are output only Parsed result (Like --dump_results Text File inside) is better then show all the RAW output (May be have a option choose Clipboard output format)

3) Is it possible to add a OPTION for "--get_from_clipboard" to get a Picture from ClipBoard ?
(This matter is because not need create a TEMP file for transfer between the application and CommandLineDecoder)

Sorry, since I am a novice for programming, only knew I little bit VB6 and VB.NET, I don't know C+ and C#, and I have not power to modify the Source code.

Until now, I still have no idea how to put your zxing.dll for VB6 programming (I put it into VB.NET project was fine)

One more stupid question, why I can not register zxing.dll on my computer with Error (regsvr32 zxing.dll .... OR .... RegAsm zxing.dll), but it can work fine put togeter with my VB.NET test project, is it need to be register or not ?

Please forgive my poor English !