using a com automation object (how do I avoid crash?)

J

James Carroll

I'm trying to call functions on an automation object, and I've run
makepy to generate a wrapper, and 99% of the calls I make on the
wrapper work great.

my question is: Is my [''] * 10 as close as I can come to a variant
array of pre-allocated empty strings?

I'm trying to call a function called EnumerateCameras

m.ShowLiveWindow(True) <--- this works
cams = [''] * 10
m.EnumerateCameras(cams)
<CRASH!>

The documentation that I have for the function says:

HRESULT EnumerateCameras
(
[in,out] VARIANT * pvBstrArray,
[out,retval] VARIANT_BOOL *pbSuccess
);

Parameters

pvBstrArray - Location of VARIANT array to read list of MicroFIRE
cameras into. Array must be pre-allocated with empty strings before
calling this function.


Is my [''] * 10 as close as I can come to a variant array of
pre-allocated empty strings?

Thanks,
-Jim
 

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

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top