How To Use MS Word Spell Check In MFC Application

P

Prakash Joshi

Thanks for investing your time.

I would like to use MS Word' spell check in my MFC Application.
//*** Spell Checker GUIDS

DEFINE_GUID(IID_IVSpell,
0x26E39D50, 0xC628, 0x11D0, 0x90, 0x67, 0x00, 0x60, 0x97, 0x64, 0x08,
0x9F);

hr = CoInitialize(NULL);
CLSID clsid;

CLSIDFromProgID(L"Word.Application", &clsid); // or word.application.
10

//*** Try to load the Microsoft Word spell checker first.

hr = CoCreateInstance(clsid,
NULL,
CLSCTX_INPROC_SERVER,
IID_IVSpell,
(void**)&m_piVSpell);

It is returning CLASS_E_NOAGGREGATION value.
I have checked registry it is registerd over there.
CLSIDFromProgID() return me class id properly.

Can some explain is forth parameter i.e. IID_IVSpell (reference to
interface) is going right.
we have created it by DEFINE_GUID as above.

Thanks In Advance.

- Prakash Joshi.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top