473,327 Members | 2,069 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,327 software developers and data experts.

ActiveX DLL COM object

When using regular, non .NET asp, I would write an ActiveX DLL COM object
in Visual Basic 6 to do all the work on the server.

Now I am using ASP.NET with C# and want to do the same. Which C# template
do I use? Where can I find information, tutorials, etc on this?

Thanks!

--
http://www.vbmark.com/
A good place to start.
Nov 16 '05 #1
8 1617
vbMark,

Do you still want to use a COM object, or do you want to create a class
library that will do the work? If you use a COM object, then you are going
to hamper the performance of your app, because you have to set ASPCompat on
the ASP.NET page to true, which locks the apartment state of the thread
doing processing.

If you just want to create a class library, then you would do it as you
would normally, and reference it in the page you want to use it in.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"vbMark" <no@email.com> wrote in message
news:Xn************************@130.133.1.4...
When using regular, non .NET asp, I would write an ActiveX DLL COM object
in Visual Basic 6 to do all the work on the server.

Now I am using ASP.NET with C# and want to do the same. Which C# template
do I use? Where can I find information, tutorials, etc on this?

Thanks!

--
http://www.vbmark.com/
A good place to start.

Nov 16 '05 #2
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in news:un**************@tk2msftngp13.phx.gbl:
vbMark,

Do you still want to use a COM object, or do you want to create a
class
library that will do the work? If you use a COM object, then you are
going to hamper the performance of your app, because you have to set
ASPCompat on the ASP.NET page to true, which locks the apartment state
of the thread doing processing.

If you just want to create a class library, then you would do it
as you
would normally, and reference it in the page you want to use it in.

Hope this helps.


What I ultimately want to do is run a command line program from my
ASP.NET page but Process.Start keeps giving me permission errors even
though I have given full control to the world.

I don't know what you mean by "class library." I did create a class and
tried Process.Start from there but had the same problem. If you could
suggest a way to run a command line program on the server without using
Process.Start that would be great.

--
http://www.vbmark.com/
A good place to start.
Nov 16 '05 #3
Mark,

What are the permission errors that you get? Even if you used a COM
object, you would still be running under the user that the page is being
processed under (unless you used a COM+ object, in which case you can set
the user that the object runs under).

How are you setting the user that the page is being processed under?

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

"vbMark" <no@email.com> wrote in message
news:Xn************************@130.133.1.4...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in news:un**************@tk2msftngp13.phx.gbl:
vbMark,

Do you still want to use a COM object, or do you want to create a
class
library that will do the work? If you use a COM object, then you are
going to hamper the performance of your app, because you have to set
ASPCompat on the ASP.NET page to true, which locks the apartment state
of the thread doing processing.

If you just want to create a class library, then you would do it
as you
would normally, and reference it in the page you want to use it in.

Hope this helps.


What I ultimately want to do is run a command line program from my
ASP.NET page but Process.Start keeps giving me permission errors even
though I have given full control to the world.

I don't know what you mean by "class library." I did create a class and
tried Process.Start from there but had the same problem. If you could
suggest a way to run a command line program on the server without using
Process.Start that would be great.

--
http://www.vbmark.com/
A good place to start.

Nov 16 '05 #4
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in news:#6**************@TK2MSFTNGP11.phx.gbl:
Mark,

What are the permission errors that you get? Even if you used a
COM
object, you would still be running under the user that the page is
being processed under (unless you used a COM+ object, in which case
you can set the user that the object runs under).

How are you setting the user that the page is being processed
under?


Here is the error message:
"Error saving file: System.ComponentModel.Win32Exception: Access is
denied at
System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo
startInfo) at System.Diagnostics.Process.Start() at
System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at
System.Diagnostics.Process.Start(String fileName, String arguments) at
converter.WebForm1.DoConvert(String sWorkingDir, String sFile) in
c:\inetpub\wwwroot\converter\default.aspx.cs:line 33 at
ASP.default_aspx.Button1_Click(Object Source, EventArgs e) in
http://localhost/converter/default.aspx:line 33"

What I am doing is a two step process.

1) Upload an image file (.jpg). This works fine. The file is written
to the bin directory.

2) Run a command line argument on an executable that resides in the bin
directory that converts the jpg into a gif. This is where I get the
error. If I drop to a command line and test it the process runs fine.

I right clicked on the bin directory and gave full control to ASP.NET
Machine Account and IUSR Internet Guest Account.

--
http://www.vbmark.com/
A good place to start.
Nov 16 '05 #5
Mark,

Giving full control to the IUSR account won't do anything, because by
the time your page is processed, it is occuring in another process, and that
process is running under the ASPNET local user.

I think that the problem arises from the fact that the ASPNET account
doesn't have the rights to launch a new process, not that it doesn't have
rights to write to the directory.

As a test, go to the web.config file for the directory that the page is
in, and add the <identity> element (setting impersonate to true). Add the
name of a user that has rights to spawn a new process and see if that works.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"vbMark" <no@email.com> wrote in message
news:Xn************************@130.133.1.4...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in news:#6**************@TK2MSFTNGP11.phx.gbl:
Mark,

What are the permission errors that you get? Even if you used a
COM
object, you would still be running under the user that the page is
being processed under (unless you used a COM+ object, in which case
you can set the user that the object runs under).

How are you setting the user that the page is being processed
under?


Here is the error message:
"Error saving file: System.ComponentModel.Win32Exception: Access is
denied at
System.Diagnostics.Process.StartWithShellExecuteEx (ProcessStartInfo
startInfo) at System.Diagnostics.Process.Start() at
System.Diagnostics.Process.Start(ProcessStartInfo startInfo) at
System.Diagnostics.Process.Start(String fileName, String arguments) at
converter.WebForm1.DoConvert(String sWorkingDir, String sFile) in
c:\inetpub\wwwroot\converter\default.aspx.cs:line 33 at
ASP.default_aspx.Button1_Click(Object Source, EventArgs e) in
http://localhost/converter/default.aspx:line 33"

What I am doing is a two step process.

1) Upload an image file (.jpg). This works fine. The file is written
to the bin directory.

2) Run a command line argument on an executable that resides in the bin
directory that converts the jpg into a gif. This is where I get the
error. If I drop to a command line and test it the process runs fine.

I right clicked on the bin directory and gave full control to ASP.NET
Machine Account and IUSR Internet Guest Account.

--
http://www.vbmark.com/
A good place to start.

Nov 16 '05 #6
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in news:On**************@TK2MSFTNGP11.phx.gbl:
Mark,

Giving full control to the IUSR account won't do anything, because
by
the time your page is processed, it is occuring in another process,
and that process is running under the ASPNET local user.

I think that the problem arises from the fact that the ASPNET
account
doesn't have the rights to launch a new process, not that it doesn't
have rights to write to the directory.

As a test, go to the web.config file for the directory that the
page is
in, and add the <identity> element (setting impersonate to true). Add
the name of a user that has rights to spawn a new process and see if
that works.


Using the <identity> element worked but I had to make the new user that I
made an Administrator. Does that sound right?

--
http://www.vbmark.com/
A good place to start.
Nov 16 '05 #7
Mark,

There are some caveats here that you should be aware of. The first is
that all pages in that directory will run under this user profile. This
generally is not a good thing. The second is that it is an administrator.
I think that you should use a user which is not an administrator (a regular
user should do).
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"vbMark" <no@email.com> wrote in message
news:Xn************************@130.133.1.4...
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in news:On**************@TK2MSFTNGP11.phx.gbl:
Mark,

Giving full control to the IUSR account won't do anything, because
by
the time your page is processed, it is occuring in another process,
and that process is running under the ASPNET local user.

I think that the problem arises from the fact that the ASPNET
account
doesn't have the rights to launch a new process, not that it doesn't
have rights to write to the directory.

As a test, go to the web.config file for the directory that the
page is
in, and add the <identity> element (setting impersonate to true). Add
the name of a user that has rights to spawn a new process and see if
that works.


Using the <identity> element worked but I had to make the new user that I
made an Administrator. Does that sound right?

--
http://www.vbmark.com/
A good place to start.

Nov 16 '05 #8
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote
in news:uL**************@TK2MSFTNGP12.phx.gbl:
Mark,

There are some caveats here that you should be aware of. The
first is
that all pages in that directory will run under this user profile.
This generally is not a good thing. The second is that it is an
administrator. I think that you should use a user which is not an
administrator (a regular user should do).


Okay, I'll play around with it some more. Thank you for all your help!

--
http://www.vbmark.com/
A good place to start.
Nov 16 '05 #9

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

Similar topics

8
by: AnalogKid | last post by:
Short question: What's the difference between SingleUse and MultiUse ? Long question: I've been writing some sample code to see how different Instancing values and threading models work. I...
4
by: Filip Wtterwulghe | last post by:
Hello, We have a number of VB6 ActiveX applicationmodule(s) that are loaded into a IE6 WebBrowserControl . This WebControl is imbededded into Application X . Now We want to send a message from...
2
by: Fie Fie Niles | last post by:
This one XP machine (with IE 6) is having a problem viewing any ActiveX controls (created on VB6) on the Internet Explorer browser. I put the same ActiveX control in a VB program, and when I run...
18
by: DartmanX | last post by:
Is there a simple way to determine if someone using Internet Explorer has completely disabled ActiveX controls? Jason
1
by: torbs | last post by:
How can I create a fade with javascript that fade an activex object (quicktime) to the background and not to the IE windowed control. I call this function several times, each time decreasing the...
5
by: andy.g.ward | last post by:
I keep getting this when trying to create an MFC activex control in a c# windows service - anyone got any ideas what the missing module could be??? Exception thrown :...
1
by: Anand Kale | last post by:
How to have ActiveX control called from Web Form in ASP.Net ? ActiveX control is written using VC++/MFC/ATL-COM. Also kindly answer following issues, 1. Also how to take care of issues about...
3
by: Jeffery Franzen | last post by:
Anyone know where the documentation is regarding Activex controls in asp web forms? I'm using VS.NET 2002 enterprise and am trying to use Activex controls in vb.net web form app. I do the add...
1
by: Frank | last post by:
Short Version of Question: Can anyone provide an example of how I should embed the ActiveX and license, and then use it in a function?
4
by: marcosnogood | last post by:
Hello, I need to dynamically load an activex object because what object to load is based on certain conditions. Also I need to wait for the object to have initialized before moving on. What I...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.