質問

Can I register a .Net COM class with the SingleUse-flag?

The reason I want to use SingleUse is that otherwise the static fields inside the COM instances (the client application uses 2 instances with different database connection strings) are shared resulting in any COM instance to access the same database.

役に立ちましたか?

解決

No, this doesn't go in the registry. It is a property of an out-of-process COM server, used when it registers its class factories. The dwClsContext argument for CoRegisterClassObject().

Using static fields is your mistake. Easy to fix.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top