I am writing some code in a dll that must conform to certain specs. One of those, is that it can only use the methods, enums, classes, etc that it currently has.
The specification of all one method is enforced by an application that I "submit" the dll to. If it doesn't conform to the specs, it rejects it.
Update: This is specifically happening in C#. The documentation regarding the spec states: "If any code other than the four public functions is changed, the COM+ Class ID could change and the object safety script will not work, causing the BSTCustomValidation.dll validation component to not run."
Given the requirement is to only have one exported function then it is easy to fulfill that by not exporting the other 19.
Sounds like you should define an explicit interface.
Because COM interop generates a class interface automatically, post-version changes to your class can alter the layout of the class interface exposed by the common language runtime. Since COM clients are typically unprepared to handle changes in the layout of an interface, they break if you change the member layout of the class.
Combining that with declaring everything private
or internal
as necessary should be sufficient.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With