Jump to content
Rick Malik

vsspell ocx and how to use it?

Recommended Posts

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
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 by Remy Lebeau

Share this post


Link to post

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++:

 

image.thumb.png.3126e3dde57d1da59e3f1e186f86c756.png

 

image.thumb.png.76a9274d6ee03852a8bb7244b922ea3e.png

 

image.thumb.png.e2a92f8be798e24949657daabb582ffe.png

 

Bye

 

EDIT: after that I cannot help you more than this 'cause I don't use normally c++

Edited by DelphiUdIT

Share this post


Link to post

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 by Rick Malik

Share this post


Link to post

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 by Rick Malik

Share this post


Link to post
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 by Remy Lebeau

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×