By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,830 Members | 1,746 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,830 IT Pros & Developers. It's quick & easy.

access c++ runtime from web form? - how

P: n/a
Hello,

If I have some older C++ functions that I am calling from my code behind in
a web form; and these functions use the C++ runtime which is found in the
windows/system32 directory; how do I ensure that I have security set up to
access these functions from my web form code behind?

My application is just hanging when I call the functions from a webform, but
they run fine in a windows application.....

Thanks!

Jim
Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
* "James Radke" <jr*****@wi.rr.com> scripsit:
If I have some older C++ functions that I am calling from my code behind in
a web form; and these functions use the C++ runtime which is found in the
windows/system32 directory; how do I ensure that I have security set up to
access these functions from my web form code behind?


You will more likely get an answer here:

<news://msnews.microsoft.com/microsoft.public.dotnet.framework.aspnet>

Web interface:

<http://msdn.microsoft.com/newsgroups/default.asp?url=/newsgroups/loadframes.asp?icp=msdn&slcid=us&newsgroup=microso ft.public.dotnet.framework.aspnet>

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

P: n/a
Hi James,

Thanks for using Microsoft MSDN Managed Newsgroup. My name is Peter, and I
will be assisting you on this issue.

First of all, I would like to confirm my understanding of your issue.
From your description, I understand that when you call a C++ function of
msvcrt.dll in a Web application, your asp.net application hangs.
Have I fully understood you? If there is anything I misunderstood, please
feel free to let me know.

By default, when you run an ASP.NET application, the ASP.NET application
will run as the ASP.NET account, whose privilege is very weak. You may try
to add the ASP.NET account to the administators group.( JUST for test only,
you may need to delete it from the administators group after you complete
the test)

Here I write a demo to call the rand function is MSVCRT.DLL, which will
work on my machine. You may have a try.
Private Declare Function rand Lib "MSVCRT" Alias "rand" () As Integer

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
Dim i As Integer
i = rand()
Response.Write(i.ToString())
End Sub

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 <WebApplication> and select Properties, this will open
the <WebApplication>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.

For detailed information, you may take a look at the links below.
317012 INFO: Process and Request Identity in ASP.NET
http://support.microsoft.com/?id=317012

Building Secure ASP.NET Applications: Authentication, Authorization, and
Secure Communication
http://msdn.microsoft.com/library/de...us/dnnetsec/ht
ml/secnetlpMSDN.asp

Or can you tell me which function are you trying to call in the webform?
If you can post your code for me to reproduce the problem, I will
appreciate your efforts.

Best regards,

Perter 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 #3

This discussion thread is closed

Replies have been disabled for this discussion.