Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Calling unmanaged COM DLL from C# ASP.NET...

Avatar of LilMoke
LilMoke asked on
C++.NET ProgrammingC#
7 Comments1 Solution609 ViewsLast Modified:

I am trying to call an old C++ COM DLL from .NET.  I have done the following but it does not seem to work:

I added a Reference to the DLL, TERMINATORLib and am using the code shown below.  

That code works fine until I call a function that takes Parameters.

protected void Page_Load(object sender, EventArgs e)
      TERMINATORLib.getbyMemberId it = new TERMINATORLib.getbyMemberId();

When I call this function:

     int nCharType = it.returnChartype("9C5B442E46B0F361F1416F49D5827A96");

I get the follwing error:
     Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Can anyone explain why I am getting this error?

Avatar of jkr
This problem has been solved!
Unlock 1 Answer and 7 Comments.
See Answers