Groups | Blog | Home
all groups > c# > march 2004 >

c# : C# Unmanaged Object scope


c#
3/26/2004 10:16:10 PM
Hello, Why is obj invalid in method2 even after calling method1 ?

class A
{
obj ;

method1(param)
{
obj = unmanaged_call()
}
method2()
{
obj // obj is no more valid / invalid here ??
Nicholas Paldino [.NET/C# MVP]
3/27/2004 9:20:55 AM
c#,

Is it possible that the call to unmanaged_call throws an exception, and
leaves obj in a null/invalid state? That's the only reason I can think of.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com

[quoted text, click to view]

Mattias Sjögren
3/27/2004 3:01:50 PM

[quoted text, click to view]

Please post some real code that actually compiles. It's hard to say
anything based on your pseudo code.

And in what way is the object invalid?



Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button