StgOpenStorageEx returns STG_E_FILEALREADYEXISTS

1.1k views Asked by At

I was struggling attempting to find out why StgOpenStorageEx returns STG_E_FILEALREADYEXISTS on a compound document when opening it for readonly. It didn't make sense. The file was there and I wasn't trying to create anything. Just open it up. I couldn't find an answer online so I thought I would share the answer I found here.

1

There are 1 answers

0
tdemay On BEST ANSWER

StgOpenStorageEx returns STG_E_FILEALREADYEXISTS when the file is not a compound document.

In my situation I was having a problem with encrypting and decrypting content so my compound document that I was creating was invalid. It wasn't a compound document at all.