Crash when inserting OLE control in Word table

J

JY

Hi,

Our application is a plug-in into MS Word. A crash occurs when we try to
insert our custom OLE control into a table. The code snippet is:

//In header file
Word::_ApplicationPtr m_pWord;

//In cpp file
pWord->Selection->InlineShapes->AddOLEControl(&vtClass);
//vtClass is an initialized CComVariant;

Appreciate if someone can point out what is wrong.

TIA,
JY
 
Top