Microsoft KB Archive/326708

= BUG: Return Type Marshaling of GUID Causes an Exception Error =

Article ID: 326708

Article Last Modified on 1/27/2004

-

APPLIES TO


 * Microsoft Visual J# .NET 2003 Standard Edition
 * Microsoft Visual J# .NET 2003 Standard Edition

-



This article was previously published under Q326708



SYMPTOMS
When you use platform invoke to call a method with a return type of com.ms.com._Guid, you may receive the following exception error message for Microsoft Visual J# .NET 2003:

An unhandled exception of type 'System.DllNotFoundException' occurred in MyApp.exe.

Additional information: Unable to load DLL (Test.dll).

For Microsoft Visual J# .NET 2002, you may receive the following exception error message:

An unhandled exception of type 'System.Runtime.InteropServices.MarshalDirectiveException' occurred in MyApp.exe

Additional information: Method's type signature is not PInvoke compatible.



STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.



Steps to Reproduce the Behavior
The following Visual J# .NET sample code compiles without an error, but you receive the error message that is described in the &quot;Symptoms&quot; section when you execute the code: import com.ms.com.*;

public class TestGuid {   /** @dll.import(&quot;Test.dll&quot;) */ public static native _Guid returnGUID; public static void main(String[] args) {       System.out.println(&quot;Try to get GUID from native&quot;); _Guid aguid = returnGUID; } }

Additional query words: vjsharp jsharp j# pinvoke guid com

Keywords: kbbug kbnofix KB326708

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.