c++ - Why not have access to the element? -


here code:

#import "c:\...\.....\....tlb"  using namespace std;  int main() {        hresult hr = coinitialize(null);     _applicationptr myapp("indesign.application");     documentptr mydoc = myapp->activedocument;     swatchesptr myswatches = mydoc->swatches;      cout << "number of swatch: " << myswatches->count << endl; // count = 10      swatchptr first_swatch = myswatches->item[1l];     swatchptr second_swatch = myswatches->item[2l];       cout << first_swatch->name; // correctly     cout << second_swatch->name; // crash      cin.get();     return 0; } 

why can not access elements? count 10. ideas?

the line swatchptr second_swatch = myswatches->item[2l]; compiles, empty.

error when accessing second_swatch->name:

error

error


Comments

Popular posts from this blog

java - unable show chart in xls document using jasper reports -

javascript - How to change image src on success AJAX -

java.lang.RuntimeException: Could not generate dummy secret at sun.security.ssl.RSAClientKeyExchange.<init> -