-
Re: Getting the ball rolling. Which VB6 projects are you working on?
The FSO is ill-advised for a number of reasons.
First, it is very slow. Dog slow.
Second, it is a fat library to load and map into your process' address space.
But most importantly it is rarely safe to assume that a text file where lines are delimited by naked LF characters is ASCII-encoded. LF-delimited ANSI is plain crazy and basically doesn't exist unless a real newb created it. Instead LF-delimited files should always be assumed to be UTF-8. The FSO doesn't handle UTF-8 properly, it assumes the text is ASCII (not even ANSI, only 7-bit ASCII).
If the files are relatively small just use an ADO.Stream instance to read them. At least it can handle Charset = "utf-8" and LineSeparator = adLF properly.
For larger files it might be worth rolling your own code from API calls. Just be sure you handle buffer management carefully. In particular you will need to use the MB_ERR_INVALID_CHARS flag with MultiByteToWideChar() in order to detect when a multibyte UTF-8 sequence has broken across buffer boundaries.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
dilettante
The FSO is ill-advised for a number of reasons.
Thankyou Dil.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Our russian friend Mikle experimented in gamedev.
Few month ago he present latest build of one of them. On the famous russian VB-forum also can find Last release https://yadi.sk/d/8Fl5kCql3YLFTw
https://www.vbforums.com/images/ieimages/2021/01/2.jpg
and the source code
https://yadi.sk/d/KpAyqaVhCq9u3w
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
heck if you need someone or some app to check and clean your source code, then it's not quite that good for your professionally speaking, wise. However i used to have an assistant, who helped me with the source coding of my apps, etc. But they were my assistant worker, whom was also professional, even so...
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
sergeos
Our russian friend Mikle experimented in gamedev.
Can you use imgur for your image please? [DONE!] This forum often breaks attachments.
Also, this thread is meant to be about what YOU are working on. :) Though I may steal this for my other thread about creating a laptop with only VB6 apps.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
ThEiMp
heck if you need someone or some app to check and clean your source code, then it's not quite that good for your professionally speaking, wise. However i used to have an assistant, who helped me with the source coding of my apps, etc. But they were my assistant worker, whom was also professional, even so...
What has the above got to do with anything in this thread?
"even so..." < :confused:
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
yereverluvinuncleber
What has the above got to do with anything in this thread?
"even so..." < :confused:
I just wanted to make that statement, sorry for the trouble caused by it, then so
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
ThEiMp
I just wanted to make that statement, sorry for the trouble caused by it, then so
No trouble, it just didn't mean anything in the context. Let's keep on thread please.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Still working on my chat tool. Progress infinitesimally slow compared to what I could do with a fair wind at my back. A mother with serious dementia is not a load I'd wish on anyone. VB6 is my escape!
I am working on handling the timezone difference whilst converting unixtime stamps.
https://www.vbforums.com/images/ieimages/2021/09/13.png
No visual differences. Just a picture to remind myself of what I'm up to.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
I was thinking about revamping the look of my Ribbonbar, I'm going to mix it up with these modern dashboards.
Attachment 182440
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Getting the ball rolling. Which VB6 projects are you working on?
None....
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Episcopal
I was thinking about revamping the look of my Ribbonbar, I'm going to mix it up with these modern dashboards.
Attachment 182440
Can't see your attachment E.P.
-
1 Attachment(s)
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
yereverluvinuncleber
Can't see your attachment E.P.
I'm getting to see...
Look at this other one.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Adding QR to a medical report so that patients can download it in digital format using QR code
https://www.vbforums.com/images/ieimages/2021/09/16.png
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Little passion project. Started with something simple and it blew up into this:-
https://www.vbforums.com/images/ieimages/2021/10/1.png
This one is going in the CodeBank.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Niya
I see you haven't inserted any modules. When I started with VB5 or 6, I had a habit of downloading ready-made examples of programs to study, but I deleted the Classes and copied the code to a Module. How bad is the lack of knowledge.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Episcopal
I see you haven't inserted any modules.
This is a direct result of my determination to not use UDTs at all. There is only one place in that entire project where a UDT is used I'm probably going to get rid of it eventually and just use a class module. UDTs in VB6 are such utter garbage. They cause way too many problems and they are unintuitive to use. For example in some cases they behave like value types(eg. can't be null) and in other cases they behave like reference types(can only be passed by reference). This confusion makes it difficult to correctly model certain types of solutions. COM also doesn't like them and the VB6 compiler will fight you tooth and nail on behalf of COM when you start getting bold with their usage. I just avoid them as much as I can.
They are only good for making API or native calls. This is why this program has no modules. All of the important data are modeled using classes.
Quote:
Originally Posted by
Episcopal
I had a habit of downloading ready-made examples of programs to study, but I deleted the Classes and copied the code to a Module. How bad is the lack of knowledge.
LMAO ;)
We all had to grow in knowledge and wisdom from nothing ;)
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Niya
.....UDTs in VB6 are such utter garbage.....
I'm using UDTs in a few of my programs from over the years with no ill effects.....Should I not be using them?
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
I use UDTs all the time and I've never had any problems at all, and I really don't have any confusion about them.
I guess there are two places that we must be careful with them:
1) The inter-variable padding is a bit strange. But, with a bit of VarPtr use on the variables, it's easy enough to figure it out. Also, on one or two API calls, we've got to be careful with this. However, 99% of the time, it even works perfectly in these cases ... and, for that 1%, there are easy workarounds just using Byte arrays in our UDT. However, if we're the only one using our UDTs, then this inter-variable padding is seldom of any concern.
2) You can't put them in Variants without defining them in a TypeLib. However, as I've shown in the past, we can actually create these TypeLibs with the VB6 IDE (i.e., no need for MIDL).
And, if we learn how to use the Friend declaration, we can pass them just about anywhere we like.
--------------
And just as an FYI, here's how you can use the VB6 IDE to create a typelib:
- Start VB6 Project.
- Under Project/Project1 Properties..., change it to an ActiveX DLL.
- Add a standard module and put a Sub Main in it.
- Add a Class1 module.
- Create any UDTs you like in this Class module, making sure they're declared as Public.
- Under Project/Project1 Properties... again, go to the "Components" tab and check "Remote Server Files".
- Compile the project.
- Voila, a Project1.tlb file appears, with your UDTs available for use (and they'll go into Variants).
You might want to rename this project so it's something other than Project1. That way, it won't conflict with other quick-test projects.
Also, the act of compiling this "Remote Server Files" project registers your new typelib. So, if you move it to other computers, you'll have to re-register it to use it.
The only (main) downside of creating your TypeLib this way is that it needs to be distributed with your compiled project. If you use MIDL, you won't need to distribute the typelib once you're compiled.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
SomeYguy
I'm using UDTs in a few of my programs from over the years with no ill effects.....Should I not be using them?
Ok let me clarify before I end up doing some damage here.
I don't think anyone should stop using UDTs. Use them as much as you like. I'm saying that I have a problem with them. UDTs have so many rules, restrictions and oddities that unless you're actively using VB6 on a daily basis, UDTs are going to be a constant source of frustration.
I've been programming mainly in VB.Net for several years. Stuctures and Classes in .Net don't have all these restrictions and oddities. They are extremely straightforward to use and their behaviors are clearly defined and quite consistent. You're free to use them however you like. They are treated as first class citizens in .Net(basically like any primitive type such as Integers) which simplifies a lot of things.
I'm way too used how freely .Net handles structured data and I really don't want to re-train myself on all the idiosyncrasies of UDTs in VB6 so I elected to avoid them entirely before they drive me insane. But if you understand all the rules, pitfalls and traps, I'd say use them to your heart's delight.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Niya
Ok let me clarify before I end up doing some damage here.
I don't think anyone should stop using UDTs. Use them as much as you like. I'm saying that I have a problem with them. UDTs have so many rules, restrictions and oddities that unless you're actively using VB6 on a daily basis, UDTs are going to be a constant source of frustration.
I've been programming mainly in VB.Net for several years. Stuctures and Classes in .Net don't have all these restrictions and oddities. They are extremely straightforward to use and their behaviors are clearly defined and quite consistent. You're free to use them however you like. They are treated as first class citizens in .Net(basically like any primitive type such as Integers) which simplifies a lot of things.
I really don't want to re-train myself on all the idiosyncrasies of UDTs in VB6 so I simply elected not to use them entirely before they drive me insane. But if you understand all the rules, pitfalls and traps, I'd say use them to your heart's delight.
Roger that and understood. I just wanted to make sure that there isn't a massively better way and that my software won't bomb during the next planet alignment on the 4th Sunday at the full moon or something ;).....
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
SomeYguy
Roger that and understood. I just wanted to make sure that there isn't a massively better way and that my software won't bomb during the next planet alignment on the 4th Sunday at the full moon or something ;).....
Oh yes sure. You're perfectly fine.
This thing with UDTs is more of a me problem than anything else. To use an analogy, using UDTs makes me feel like a formerly rich person trying to get used to being poor again. So your programs are not going to break. Don't worry. :D
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
dilettante
The FSO is ill-advised for a number of reasons.
First, it is very slow. Dog slow.
Second, it is a fat library to load and map into your process' address space.
But most importantly it is rarely safe to assume that a text file where lines are delimited by naked LF characters is ASCII-encoded. LF-delimited ANSI is plain crazy and basically doesn't exist unless a real newb created it. Instead LF-delimited files should always be assumed to be UTF-8. The FSO doesn't handle UTF-8 properly, it assumes the text is ASCII (not even ANSI, only 7-bit ASCII).
If the files are relatively small just use an ADO.Stream instance to read them. At least it can handle Charset = "utf-8" and LineSeparator = adLF properly.
Dil, your summary was quite correct. I have had a couple of issues with FSO's inability to always handle UTF8 text. I have implemented my code using ADO utf8 text streams as suggested, coding wasn't always easy but I think I have largely cracked it.
Quote:
Originally Posted by
Episcopal
I was thinking about revamping the look of my Ribbonbar, I'm going to mix it up with these modern dashboards.
Good to see what you are doing but I do hate ribbons, should the man who invented them be shot?
Quote:
Originally Posted by
AthlonArg
Adding QR to a medical report so that patients can download it in digital format using QR code
For whose health service? Is this for a private health clinic, I assume so?
Quote:
Originally Posted by
Niya
Little passion project. Started with something simple and it blew up into this:-
This one is going in the CodeBank.
I like that. I know someone else who'd like that too.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
yereverluvinuncleber
I like that. I know someone else who'd like that too.
I think I know who you're talking about. I don't want to fan any flames so I won't mention who it is.
Believe it or not, I was partially inspired by his posts to attempt this in VB6. Seemed like an interesting challenge to undertake as I don't think anyone outside of these forums would dare to attempt this in VB6. The limits of VB6 has made this quite a challenge to implement. It was very straightforward to do in VB.Net and other more powerful languages like Java and JavaScript.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
yereverluvinuncleber
For whose health service? Is this for a private health clinic, I assume so?
Yeap, Is the clinic where my wife works, I created the system 10 years ago, only had patients CRUD and appointments, now has a Administration (Like SAP, Checks, banks, providers, Salary, RRHH, Paid Orders, etc...), Reports, Webapp conection, Mobile App, autoupdate and a lot of things and a lot of bugs (Thanks ' and On Error Resume Next) :bigyello:
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Niya
The limits of VB6 has made this quite a challenge to implement. It was very straightforward to do in VB.Net and other more powerful languages like Java and JavaScript.
It is a skill in itself to implement something in VB6 that is easy to accomplish in VB.NET... I am working the other way round and I find challenges the other direction just due to unfamiliarity with the .NET way of doing things.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
yereverluvinuncleber
It is a skill in itself to implement something in VB6 that is easy to accomplish in VB.NET...
It's not so much that it can't be done in VB6, it's just more tedious.
Quote:
Originally Posted by
yereverluvinuncleber
I am working the other way round and I find challenges the other direction just due to unfamiliarity with the .NET way of doing things.
When this ceases to be the case, you're going to have a hard time going back to VB6. If you love VB6, the last thing you want to do is get comfortable with VB.Net. You're going to hate going back to write code in VB6. If the subject of this latest venture of mine wasn't so damned interesting to me, I wouldn't be able stomach doing it in VB6. If this were some run-of-the mill boring CRUD application I was writing, I'd have ran my head into a wall by now out of frustration. :D
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Niya
Seemed like an interesting challenge to undertake as I don't think anyone outside of these forums would dare to attempt this in VB6.
I started to grow in programming because of the obstacles.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Episcopal
I started to grow in programming because of the obstacles.
This is exactly what makes someone good at programming! It's those difficult obstacles. But it's not always about the challenge. Sometimes you just need to make a quick buck or accommodate one of your clients with a new utility. In this case, you need to get it done as quickly as possible. This kind of gun-slinger programming is good for learning and having a bit of fun but it's bad for business. In business, time is everything! Businesses need things done quickly.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Niya
Businesses need things done quickly.
That's why I have my own framework and addins in the VB6 IDE. To speed up ... of course it doesn't even come close to vbrichclient, nor VB.NET.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
Episcopal
I started to grow in programming because of the obstacles.
For a second I thought it read "I started to grow in programming because of the testicles". A double take required.
https://www.vbforums.com/images/ieimages/2021/10/8.png
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
Quote:
Originally Posted by
yereverluvinuncleber
If my testicles were that big, I would definitely have to evolve in the programming, to earn money and pay for surgery... kkkkkkkkkk
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
https://www.youtube.com/watch?v=Xrwr4yHp7Y8
This is about as far as I'm willing to go. I was intent on going further to create a very basic scripting language but I think I've reached the limits of my patience with VB6. I have to spent way too much time on tiny details that have nothing to do with the end-goal. Half my time was spent writing a bunch of list classes just to pass data around. I can't stomach it anymore. I'll do all the fancy stuff in the VB.Net version.
That being said, I'm still quite proud of it. It's the first time I've done something like this so successfully. I've wanted to do this since I was like 13 years old but such a feat would have been too far beyond my capabilities back then. I've always been fascinated by how programming languages work.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
That is impressive. Personally, if I was building another language of any type I'm not sure I'd want to use the .NET framework regardless of how easy .NET makes it. I think I'd make a step toward using something like C++.
As you have started already, I don't know how you feel about abandoning a project but I always find it difficult to do that even if my intention is to write it another language.
-
Re: Getting the ball rolling. Which VB6 projects are you working on?
I have just made my static-sized utility resizable, always tricky with a graphical interface, my progress is, as always, exceedingly slow.
https://www.vbforums.com/images/ieimages/2021/10/1.jpg
I have also modified the method used to write the text files to the use of an ADO binary stream, rather than using FSO as it seems faster and appears to handle utf8 chars correctly. This is important as one of the other clients runs on Mac OSX. Step by step, bug by bug, one per day, I fix and complete my utility. It works but as my brother always states, "the turd needs polishing".
I am about to add some sound recording to my utility. Before I do that, I should ask about the appropriateness of my chosen path. I was planning to use the mciSendString API, is there anything I should know about the method I have selected before I dive in? It seems very easy to achieve but there is bound to be some wider knowledge about the pitfalls or limitations of my chosen path, there always is...