473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Problem calling DLL from webform application

Hello,

I am using VB.NET to call an unmanaged DLL which contains some functions.
When I call the DLL from a windows application, it all works fine. When I
place the same code in a webform application, my call to the first
initialization routine simply hangs (i.e. in debugger it shows the code
starts executing, but control never comes back to the debugger).

This DLL uses the MFC42.DLL and MSVCRT.DLL which is in the WINNT/SYSTEM32
folder as well as two other DLLS in the DLL application folder. The system
I am trying to run this on is a Windows 2003 server.

I have both the WINNT\SYSTEM32 and the DLL Application folder in the path
statement.

Can someone explain to me why the call is working from a windows vb.net
application and not from an webform vb.net application? Or, can someone
point out what I should look into to try and correct this issue?

Thanks!

Jim
Nov 20 '05 #1
5 1731
More than likely, the ASP.NET account on the server doesn't have sufficient
permission to execute the DLL.

"James Radke" <jr*****@wi.rr.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,

I am using VB.NET to call an unmanaged DLL which contains some functions.
When I call the DLL from a windows application, it all works fine. When I
place the same code in a webform application, my call to the first
initialization routine simply hangs (i.e. in debugger it shows the code
starts executing, but control never comes back to the debugger).

This DLL uses the MFC42.DLL and MSVCRT.DLL which is in the WINNT/SYSTEM32
folder as well as two other DLLS in the DLL application folder. The system I am trying to run this on is a Windows 2003 server.

I have both the WINNT\SYSTEM32 and the DLL Application folder in the path
statement.

Can someone explain to me why the call is working from a windows vb.net
application and not from an webform vb.net application? Or, can someone
point out what I should look into to try and correct this issue?

Thanks!

Jim

Nov 20 '05 #2
Russell,

What permissions would it require? That the IUSR_<server> has read
permissions on BOTH the application, and SYSTEM32 directories which has the
files? Or are there some other type of permissions required?

Wouldn't my Try, Catch around my first call have returned some type of
permissions error if that is the case?

Thanks!

Jim
"Russell Jones" <ar**@nospam.northstate.net> wrote in message
news:O1**************@TK2MSFTNGP10.phx.gbl...
More than likely, the ASP.NET account on the server doesn't have sufficient permission to execute the DLL.

"James Radke" <jr*****@wi.rr.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello,

I am using VB.NET to call an unmanaged DLL which contains some functions. When I call the DLL from a windows application, it all works fine. When I place the same code in a webform application, my call to the first
initialization routine simply hangs (i.e. in debugger it shows the code
starts executing, but control never comes back to the debugger).

This DLL uses the MFC42.DLL and MSVCRT.DLL which is in the WINNT/SYSTEM32 folder as well as two other DLLS in the DLL application folder. The

system
I am trying to run this on is a Windows 2003 server.

I have both the WINNT\SYSTEM32 and the DLL Application folder in the path statement.

Can someone explain to me why the call is working from a windows vb.net
application and not from an webform vb.net application? Or, can someone
point out what I should look into to try and correct this issue?

Thanks!

Jim


Nov 20 '05 #3
Hi james,

Which api are you calling?
Can you post your code for me to reproduce the problem?

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.

Nov 20 '05 #4
Peter,

Unfortunately I cannot post the code for me to reproduce as it needs some
external data files that you won't have. However, it is basically the same
DLL that I was having the problem with calling from VB.NET (i.e. the one
that you created yourself to help me figure out how to pass the data
correctly.) This DLL runs fine in a Windows executable application, but the
same exact code calling the DLL does NOT work from a vb.net webform
application?

If you use the same DLL you created in C++ to test my other issue, and call
it from a webform, you will most likely have the same issue.

Does that help?

Thanks!

Jim

"Peter Huang" <v-******@online.microsoft.com> wrote in message
news:Ri**************@cpmsftngxa07.phx.gbl...
Hi james,

Which api are you calling?
Can you post your code for me to reproduce the problem?

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.

Nov 20 '05 #5
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.

Nov 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Morten | last post by:
Hi! I have a problem displaying some values in a datagrid. I have an array that consists of a number of objects. Each object has 2 properties: Name and a list of web addresses. (e.g: Name:...
0
by: Brian Watkins | last post by:
Help! I keep getting the message "Use the RepostSource or Databindings property to specify a report source." when I try to view my WebForm1.aspx page in the browser. I'm trying to create a...
1
by: Tom Wild | last post by:
Hi I am trying to create a webform that connects to an Access database. If I use the connection string: "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\Gizmo\Gizmo.mdb" Then the application...
5
by: Jerry | last post by:
I am using .Net 2003. I have been working with this ASP.Net webform that I created a few weeks ago. It has been working fine. However, while modifying the webform today, this webform stopped...
2
by: Helge Kalnes | last post by:
We are running an ASP.NET application on a cluster of 3 web-servers, using the Network Load Balancing feature of Application Center. We have synchronized the machineKey in machine.config on the 3...
0
by: Jon | last post by:
Hi all Initially i faced a problem running ASP Application where webform components do not display(Running on IIS 5.0 and VS 2002) Refer to below for previous post...
8
by: Keith-Earl | last post by:
Okay, looking for a Best Practice. We are building a classic three tier app in VB.NET. When we load up a WebForm we have access to very useful objects such as the Session object. We frequently...
7
by: Dean Slindee | last post by:
I would like to hear some practical comments about how to decide whether a new application becomes a Winform vs a Webform application. Would you say that every app should be, by default, a Winform...
4
by: Goran Djuranovic | last post by:
Hi all, I am experiencing a strange thing happening with a "designer.vb" page. Controls I manually declare in this page are automatically deleted after I drop another control on a ".aspx" page. -...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.