Rick Malik 0 Posted Wednesday at 09:08 PM Stack Overflow [closed] my question because they thought I was looking for books, software, or tutorials.... Maybe I am (looking for "show me how").... I just wanna know what to do with BadWordFound so I can replace the stupid thing in my TMemo when it finds it. There's plenty of VB and pascal examples, but I only speak c/c++. A simple line or two to follow my "VSSpell1->CheckText = MailMemo->Text;" would be useful.... Thanks Share this post Link to post
Remy Lebeau 1578 Posted Wednesday at 11:59 PM (edited) 2 hours ago, Rick Malik said: Stack Overflow [closed] my question because they thought I was looking for books, software, or tutorials.... Because, that is essentially what you did ask for - a tutorial on how to use the OCX control. 2 hours ago, Rick Malik said: I just wanna know what to do with BadWordFound so I can replace the stupid thing in my TMemo when it finds it. THAT is what you should have asked for instead. That would have made for a better StackOverflow question, and less likely to be closed. Also, since you clearly know what you are looking for, you should have explained/shown what you had already tried that didn't work for you. Quote There's plenty of VB and pascal examples, but I only speak c/c++. Then you should have included one of those examples in your StackOverflow question and asked how to accomplish the same thing in C++. I can't find any documentation or examples of the OCX control, in ANY programing language. Can you provide a source? Edited yesterday at 12:00 AM by Remy Lebeau Share this post Link to post
DelphiUdIT 228 Posted yesterday at 10:23 AM (edited) VSSpell was a, ActiveX component (not free) from "ComponentOne", now "Mescius" company. Since 2023, this was a legacy product 'cause the use of ActiveX tecnology and now it doesn't exist anymore. In some older pages there are some refs. but if you use the download link, only their control panel will be downloaded. So, I don't think there wil be any chance to use it. May be if you have it you can try to derive a "wrapper" or TLB in C++: Bye EDIT: after that I cannot help you more than this 'cause I don't use normally c++ Edited yesterday at 10:25 AM by DelphiUdIT Share this post Link to post
Rick Malik 0 Posted yesterday at 07:24 PM (edited) Thank you. At least you didn't bash me around. I got up a 3am this morning, espresso, and the pascal language guide that came with c++ builder. and after a lot of back and forth, I did finally decipher your guyses language. I came up with this (in case one day someone else wants to know) ----------------------------pascal example I found Dim ResCode As Integer VSSpell1.EventOptions = 0 VSSpell1.AutoPopup = False VSSpell1.CheckText = TextBox.Text ResCode = VSSpell1.ResultCode Do While ResCode < 0 Select Case ResCode Case VSR_WORD_MISSPELLED, VSIR_IGNORE VSSpell1.PopupMisspelledWord = 1 ResCode = VSSpell1.ResultCode Case VSR_BREAK End Select If ResCode - VSR_CHECK_CANCELLED ' misspelled in the guide twice Exit Loop End If ResCode = VSSpell1.ResumeCheck Loop Memo.Text = VSSpell1.Text --------------------------- in c++ (from a button click) int i = Memo1->Lines->Count; int ResCode; SpellChk->CheckText = Memo1->Text; ResCode = SpellChk->ResultCode; while(SpellChk->ResultCode < 0) { switch(ResCode) { case VSR_WORD_MISSPELLED: SpellChk->PopupWordMisspelled = 1; ResCode = SpellChk->ResultCode; break; case VSR_BREAK: SpellChk->ReplaceRecheck; break; } if(ResCode == VSR_CHECK_CANCELED) {return;} ResCode = SpellChk->ResumeCheck; } Memo1->Text = SpellChk->Text; ) Thanks for listening. Edited yesterday at 07:36 PM by Rick Malik Share this post Link to post
Anders Melander 1984 Posted 23 hours ago 1 hour ago, Rick Malik said: pascal example I found That's not Pascal. It's... Visual Basic. 🤦♂️ Share this post Link to post
Rick Malik 0 Posted 22 hours ago (edited) Funny, I can't tell the difference (: They're both either German or Polish to me. When my dad would talk to his mom, they'd switch around and it all sounded the same. Edited 22 hours ago by Rick Malik Share this post Link to post
Remy Lebeau 1578 Posted 21 hours ago (edited) 2 hours ago, Rick Malik said: Thank you. At least you didn't bash me around. I'm not bashing you around. I'm trying to be straight with you. StackOverflow is a Q&A site, not a help forum. It can be a pretty hard place on beginners who don't take the time to read the documentation and follow the guidelines. Your question in its initial form was not a good fit for the site, that's why it got closed pretty quick. But rather than fix it, you chose to delete it. As is your right. But, I suggest you take some time to learn how the site actually works before posting a new question there again. 2 hours ago, Rick Malik said: pascal example I found That's Visual Basic, not Pascal. 51 minutes ago, Rick Malik said: Funny, I can't tell the difference 🙂 VB and Pascal are very different languages, with different syntaxes and semantics. 2 hours ago, Rick Malik said: in c++ You made some minor mistakes in the translation. Specifically: you aren't setting a couple of VSSpell's properties your while loop is looking at the wrong value your switch block is missing a case when VSR_CHECK_CANCELED is detected, you are exiting the whole function instead of just breaking the loop. Try this: SpellChk->EventOptions = 0; SpellChk->AutoPopup = false; SpellChk->CheckText = Memo1->Text; int ResCode = SpellChk->ResultCode; while (ResCode < 0) { switch (ResCode) { case VSR_WORD_MISSPELLED: case VSIR_IGNORE: SpellChk->PopupWordMisspelled = 1; ResCode = SpellChk->ResultCode; break; case VSR_BREAK: SpellChk->ReplaceRecheck; break; } if (ResCode == VSR_CHECK_CANCELED) break; ResCode = SpellChk->ResumeCheck; } Memo1->Text = SpellChk->Text; Edited 21 hours ago by Remy Lebeau Share this post Link to post
Rick Malik 0 Posted 19 hours ago (edited) Please explain the difference ("StackOverflow is a Q&A site, not a help forum. ") Why would I ask a question if I didn't need help?. But if you wanna ask me about my cats (I have 19) please do... I got pics too. Most of the properties are set in the Object inspector- ie, dictionary, auto-change, etc. Their 'do while' is my while, right? And their 'select' is my switch, or am I using Russian to translate french. I said before, I have trouble basic and pascal. I couldn't figure out how to "if(), exit loop, endif".... && I didn't know what to do with that second 'loop' !? I thought exit meant we're done here. Isn't that what cancelled means? I also didn't know you could use 'break' outside the switch case statement....hmm, I'll look that up. And I purposely left out the ignore case. VSIR_IGNORE is probably another typo. Left it out. The good new is, my spell checker works as written. I'll try you statement and see if there's any marked difference and let you know. Thanks for the come back. Enjoy the rest of your evening . Edited 19 hours ago by Rick Malik Share this post Link to post
DelphiUdIT 228 Posted 10 hours ago 8 hours ago, Rick Malik said: Please explain the difference ("StackOverflow is a Q&A site, not a help forum. ") Why would I ask a question if I didn't need help?. But if you wanna ask me about my cats (I have 19) please do... I got pics too. Stack overflow is a site suitable for receiving precise and targeted answers on single problems. You can't ask a generic question (like: how do you make a loop in Pascal) and hope that someone will answer. In fact, the question will normally be closed. As a basis, it is assumed that the person asking questions has first "studied" the basis of the language and the techniques related to the question. 8 hours ago, Rick Malik said: Most of the properties are set in the Object inspector- ie, dictionary, auto-change, etc. Their 'do while' is my while, right? And their 'select' is my switch, or am I using Russian to translate french. I said before, I have trouble basic and pascal. I couldn't figure out how to "if(), exit loop, endif".... && I didn't know what to do with that second 'loop' !? I thought exit meant we're done here. Isn't that what cancelled means? I also didn't know you could use 'break' outside the switch case statement....hmm, I'll look that up. And I purposely left out the ignore case. VSIR_IGNORE is probably another typo. Left it out. These are just some of the basics that should be studied before asking questions or addressing any problem... and this applies to any language and not only. On the web, and also in this forum, there are many links to manuals, even free ones, that help in understanding Pascal. Have a good time. Bye Share this post Link to post
Rick Malik 0 Posted 9 hours ago Okay. So you're saying this place is a "Last resort" .... just wow Share this post Link to post
Rick Malik 0 Posted 3 hours ago Gone are the days when people like Jon Jenkinson, Andy Hall, Kent and Charlie, and a bunch of us would use these forums to discuss platforms, share insight, and solve problems... without criticism. I'm just a hobby programmer. I spent my life laying carpet in your homes and offices, so forgive me if I don't conform to your idea of what a programmer should behave like. I was a beta tester for cppb1 and stopped upgrading at version 6. I still run Windows 7. My PC is 64 bit, but I'm not planning on upgrading the OS or C++ Builder. I'm retired now, and just wanna play with the cats and write cute little games and utilities that I find interesting. My current project is an LCD unit Controller (Crystalfontz and Matrix Orbital) and I'm having fun. If it bothers you, the way I code or ask questions... just ignore me. (or ban me ?? don't care). Just don't bully me. I don't like schoolyard behavior. I'll try not to ask anymore STUPID questions. Like my next problem - how do I move a frameless window. - which I can do, but the mouse jumps to top-left corner and if you're close to the right hand side... off screen. (I'm not asking yet). And I've always scoured the documentation, looked for examples I can find online, and tried many approaches to the problem, before giving in to asking someone else. <\rant> Share this post Link to post
DelphiUdIT 228 Posted 2 hours ago If you mean me, my last post was just an explanation of your previous post. Far be it from me to criticize you. I understand very well the difficulty in dealing with new things. I wish you good things. I am definitely in the wrong place not knowing enough about C++. Bye Share this post Link to post