Rick Malik 0 Posted yesterday 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 1577 Posted 23 hours ago (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 23 hours ago by Remy Lebeau Share this post Link to post
DelphiUdIT 228 Posted 12 hours ago (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 12 hours ago by DelphiUdIT Share this post Link to post
Rick Malik 0 Posted 3 hours ago (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 3 hours ago by Rick Malik Share this post Link to post
Anders Melander 1984 Posted 2 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 1 hour 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 1 hour ago by Rick Malik Share this post Link to post
Remy Lebeau 1577 Posted 1 hour 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 1 hour ago by Remy Lebeau Share this post Link to post