AccessViolationException

  • Thread starter Thread starter Creativ
  • Start date Start date
C

Creativ

A COM component has an method, called Register(Variant variant), which
expect an array of string via Variant. If I want to use it, I can pass
an object[] whose element boxes a string.
The UnregisterAllItems method of the component remove all registered
items.
Most of the time, UnregisterAllItems works fine but sometime
UnregisterAllItems returns an AccessViolationException.
Any idea why it goes wrong?
 
Creativ,

First, you are not boxing the strings or the array of strings. Arrays
and strings are reference types.

Second, there isn't enough information to go on. Without seeing the
code for the UnregisterAllItems method, or how it is called from unmanaged
code, it's very difficult to know what is going on.
 

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

Back
Top