Use unmanaged code in VS2008

  • Thread starter Thread starter Rui Oliveira
  • Start date Start date
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
 
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
 
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
 
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.
 
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
 
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.
 
Back
Top