Use unmanaged code in VS2008

R

Rui Oliveira

Hi,

I have a managed application that uses an unmanaged dll code. And this works
perfect together when used in VStudio2005.

Unmanaged code have been developed in C++ in VS2003.

Now I upgrade managed application to VStudio 2008, and I have several
problems. In debug and after reset iis (iisreset) the application works well,
but a few time later hangs when try to call a unmanaged function.

What could be? There is some flag configuration in VStudio2008 to use
unmanaged code?

Thanks & Regards,
Rui
 
B

Brian Muth

You need to describe this problem better.

Does the managed application compiled in VS2008 call the unmanaged code
developed in VS2003 directly? If so, what has IIS got to do with this
problem? Do you use PInvoke to call the unmanaged code? If so, what
parameters are being passed? Is it only when calling a particular remote
function that the application hangs?

Brian
 
R

Rui Oliveira

Hi Brian,

Yes, managed application compiled in VS2008 call the unmanaged code
developed in VS2003 directly.

I add the unmanaged dll in managed application references and call functions
directly using wrapper automatically created by VStudio2008.

I can call several times the unmanaged function without any problem, but a
few time later, when call an unmanaged function the application hangs.

Apparently, the application hangs when I try to use application after don’t
use it for a while. Make sense?

Regards,
Rui
 
B

Brian Muth

Apparently, the application hangs when I try to use application after don’t
use it for a while. Make sense?

Nope, not to me. Applications don't "grow old".

You will need to roll up your sleeves and debug it. It's also helpful if you
characterize what you mean by "hang". Find out what it is doing immediately
beforehand.
 
R

Rui Oliveira

Hi,
I made some changes in my unmanaged code, and it looks better.
I added IsInvokeAllowed method to my unmanaged code. Overrided
COleControl::IsInvokeAllowed() to return TRUE.
Since yesterday that do not hangs. We will see in the following days if
keeps stable.
Thanks & Regards,
Rui
 
A

Allen

Rui,

You said "There is some flag configuration in VStudio2008 to use "
unmanaged code? But I think it said something like "use old syntax". If
that the case, you can do this:
Make a new project with 2008. you have to name all the files the same as
the old project from 2003 or 2005. Now copy and paste each file form the
old version to the new version. If you need more details, do not hesitate
to contact me again.
 

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

Top