using dll/InteropServices on website

M

mjacu

Hello

I've got a problem using unmanaged dll in C++ on my website.
I'm using System.Runtime.InteropServices namespace and DllImport.
My dll allocate memory and generate some files using allocated memory.
Every request generate one file.
In global.asax in Application_Start I call function from dll allocating
memory. In Application_End I call function freeing memory.
My webform.Page_Load() call some functions from dll,
which operate on allocated memory.
Sometimes everything work fine, but sometimes I get
NullReferenceException when call dll function.
When I get NullReferenceException, next requests
generate this exception too.
I don't know, what is wrong.
Few months ago I have COM component doing the same work.
COM component use the same C++ source code.
Now I must do the same using dll/InteropServices.

Regards,
Jacek
 
B

Brock Allen

If your C++ component threadsafe? ASP.NET is a thread hot envionment, so
perhaps assumptions your C++ component is making aren't valid?
 

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

Members online

Forum statistics

Threads
473,995
Messages
2,570,233
Members
46,821
Latest member
AleidaSchi

Latest Threads

Top