Hi James,
The DLL I create is just used to test how to pass the structure.
I have also test that DLL, I can not reproduce the problem.
What exact error message do you get?
To isolate the problem, you may try the code below.
Public Declare Sub GetComputerName Lib "kernel32" _
Alias "GetComputerNameW" _
(<MarshalAs(UnmanagedType.LPWStr)> ByVal lpBuffer As StringBuilder, _
ByRef nSize As Integer)
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim len As Integer, s As StringBuilder = New StringBuilder(50)
len = s.MaxCapacity
GetComputerName(s, len)
Response.Write(s)
End Sub
This will work on my machine.
If this does not work for you, you may try to check the IIS setting.
1 Run inetmgr in the Run dialog and this will open the Internet
Information Services(IIS) Manager
2 Navigated to Internet Information Services/<Computer Name>/Web
Sites/Default Web Site/<WebApplication>, (This is the application name
that you indicated in the VS.NET IDE),
3 Right Click on the WebApplication5 and select Properties, this will
open the WebApplication5 Properties dialog.
4 Select Directory security and then select Authentication and access
control section click the Edit button. This will open the Authentication
methods dialog
5 Uncheck the Enable anonymous access and check the Integrated Windows
authentication. This will enable the browse use the log on user account to
access the aspx page, I assume the account have the permission to access
the NavigateTree.xml file.
6 You may have a try and let me know the result. If you have any related
question please feel free to let me know.
Regards,
Peter Huang
Microsoft Online Partner Support
Get Secure!
www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.