Help Needed for COM Automation

Just starting out? Need help? Post your questions and find answers here.
srod
PureBasic Expert
PureBasic Expert
Posts: 10589
Joined: Wed Oct 29, 2003 4:35 pm
Location: Beyond the pale...

Re: Help Needed for COM Automation

Post 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.
I may look like a mule, but I'm not a complete ass.
Post Reply