Re: DLLInport from a ASP.NET web app using C#

Tech-Archive recommends: Fix windows errors by optimizing your registry



Yes - it does sound odd. Is there anychance something in this unmanged
method uses thread local storage? If that is the case it would have to
be invoked on the same thread everytime, else exhibit wierd behavior.

--
Scott
http://www.OdeToCode.com/blogs/scott/


On Sun, 5 Jun 2005 10:19:29 -0700, "Ravneet"
<Ravneet@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:

>Hi Scott,
>I will run the CLRSpy to narrow the cause. Meanwhile the sig of the native is:
>
>LPSTR APIENTRY getSerialEx();
>
>it is declared in the managed code as:
>static extern string getSerialEx();
>
>What I am not able to understand is that why it works the first time around
>and fails in successive sessions. I must remind you that this code is being
>called from Session_Start of the ASP.NET web application. To narrow down
>issues if I do a LoadLibrary just before the call it returns all the time
>with a valid module handle. So the DLL is loaded but the call to the function
>fails from second instance onwards. Now, this sounds like some memory not
>being released issue. I am gonna do some more tests, meanwhile if you (or
>anyone else) has something to suggest, pls do.
>
>Thanks
>Ravneet

.



Relevant Pages

  • Re: I cant believe it
    ... My friend on ... Fishing, on the other hand, didn't go so well. ... on a wakeboard for the first time tomorrow. ... If that fails, ...
    (rec.boats)
  • Re: Ownage
    ... not the first time, nor the second, nor the third... ... How long do you smear the good name of those people who ... it's not me proclaming myself a resident expert - it's ... everyone else who simply fails to contribute anything meaningful ...
    (rec.martial-arts)
  • Re: Seeking lots of "click here"s
    ... which fails to apply to every user who doesn't click. ... But that's just language, surely. ... You'd still say to a blind person "Do ... The first time my technophobe mother used the web when visiting she got used ...
    (uk.net.web.authoring)
  • Re: recurring kernel panic
    ... This same hardware has run OpenBSD for years. ... to "broken" there will be a first time when it fails. ... No-one wants to believe it is happening to them, but hardware fails *all the time*. ...
    (freebsd-questions)
  • Re: Application.ActiveInspector().CurrentItem Returns Wrong(Old) Value
    ... Using managed code you might also have to call Marshal.ReleaseComObjecton the object as well as GC.Collect. ... *First time Application.ActiveInspector.CurrentItem gives correct value. ... *Then i synchronize Outlook with exchange server and open the form, it displays old value of the contact. ...
    (microsoft.public.outlook.program_addins)