Page 2 of 2

Re: Help Needed for COM Automation

Posted: Sat Mar 26, 2011 11:35 am
by srod
@Simon :

Yes your use of CoCreateInstance_() does not look right at all.

Also, your use of CLSIDFromString_() seems invalid and will undoubtedly lead to memory access errors. You want to pass this function the address of a CLSID structure, not the address of a pointer to such a structure.

The difference is that a CLSID structure occupies 16 bytes whilst a *CLSID occupies 4 bytes.. hence the invalid memory access.

Use something like :

Code: Select all

Define.CLSID CLSID_Interface
lnRtn =  CLSIDFromString_("{4C791FAF-8649-462D-A93A-185F95C2DC0E}",@CLSID_Interface)
When you've done this you will need to alter CoCreateInstance_()'s first parameter to presumably point at the CLSID_Interface structure.