logo

activex control and exe (Visual Studio .NET)
alice wonder posted at Wednesday, January 30, 2008 4:15 PM

I have the scanner capability built in an windows app. I want to create activex control for this exe and use this in my aspx pages. Please suggest how to make activex control for this exe or any other alternative if available. I created the same project as a windows Control Library and have a dll also.

Thanks!

Reply    Reply Using Power Editor
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0
You cannot create an ActiveX control with C# or Visual Basic.net
Peter Bromberg replied to alice wonder on Wednesday, January 30, 2008 7:01 PM

There are some "tricks" you can do, but they involve some rather sophisticated programming techniques, and frankly, I wouldn't even begin to try them. You need to write an ActiveX control in Visual C++.
Reply    Reply Using Power Editor
Peter Bromberg is a C# MVP, MCP, and .NET expert who has worked in banking, financial and telephony for over 20 years. Pete focuses exclusively on the .NET Platform, and currently develops SOA and other .NET applications for a Fortune 500 clientele. Peter enjoys producing digital photo collage with Maya,playing jazz flute, the beach, and fine wines. You can view Peter's UnBlog and IttyUrl sites. Pete Tweets at peterbromberg
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

I created a windows Control Library
alice wonder replied to Peter Bromberg on Wednesday, January 30, 2008 8:15 PM

I am trying to use the windows control Library .dll in aspx page. I am following this link http://aspnet.4guysfromrolla.com/articles/052604-1.aspx 

My application namespace is winapp and the class name is default one UserControl1.

<object id="myControl" name="myControl" classid="http:winapp.dll#winapp.UserControl1" width="100" height="100" >

<param name="Title" value="my title" />

</object>

I placed my dll and .pdb files at wwwroot folder. But I still get a blank object.

Thanks for your quick reply.

Reply    Reply Using Power Editor
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

Windows handler on aspx
alice wonder replied to Peter Bromberg on Thursday, January 31, 2008 2:39 PM

I could make the Windows Control Library button to work on aspx page. by supplying the path copied to dll in the root folder. By doing this the button is palced on server, but how can I make it recognize the clients scanning device. Now it goes to the try catch block saying no scanning available.

Thanks!

Reply    Reply Using Power Editor
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

That's wonderful, but you may be missing the point:
Peter Bromberg replied to alice wonder on Thursday, January 31, 2008 2:44 PM

Yes you can host a windows usercontrol library in an ASP.NET page in the client's browser (assuming they have the .NET Framework installed). However, this does not give your userControl permissions to run programs on the client's machine. Browser security restrictions still apply. As I mentioned, the ONLY way you can gain permission to run a scan executable or any other program on a client machine from within the browser is to install an ActiveX control (That's COM)    and have the user grant permission to install it. A .NET userControl is NOT ActiveX!
Reply    Reply Using Power Editor
Peter Bromberg is a C# MVP, MCP, and .NET expert who has worked in banking, financial and telephony for over 20 years. Pete focuses exclusively on the .NET Platform, and currently develops SOA and other .NET applications for a Fortune 500 clientele. Peter enjoys producing digital photo collage with Maya,playing jazz flute, the beach, and fine wines. You can view Peter's UnBlog and IttyUrl sites. Pete Tweets at peterbromberg
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

OK thanks! Saved lot of time browsing
alice wonder replied to Peter Bromberg on Thursday, January 31, 2008 3:09 PM

Thanks for the suggestion and quick reply. I will try to create an activeX control.

 

Reply    Reply Using Power Editor
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

Creating Activex control tutorials
alice wonder replied to Peter Bromberg on Thursday, January 31, 2008 4:43 PM

Please guide me with some good links on how to create activex control. This is the 1st time I am trying to create one and all the links on web including MSDN are little confusing.

Thanks!

Reply    Reply Using Power Editor
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

does this short cut of creating Activex control work
alice wonder replied to Peter Bromberg on Thursday, January 31, 2008 6:42 PM

http://foxsys.blogspot.com/2007/03/activex-controls-in-vs2005-and-c-part-1.html

http://www.codeproject.com/KB/miscctrl/exposingdotnetcontrols.aspx

I need to call only the Initialize() and start scanning() methods of twain from this user control. Can I make it an activex control like the one mentioned in the above links. Or do I need to create an activex control to detect the clients device.

Thnaks!

Reply    Reply Using Power Editor
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0

Well the first article does not create an ActiveX control
Peter Bromberg replied to alice wonder on Thursday, January 31, 2008 7:36 PM

even though the author claims it is. It is only a UserControl with a "supposed" COM Interface.

The second article does create a real ActiveX control. You have a lot of studying to do - it's not just creating the control, you also have to learn how to package it in a CAB self-installer.

Reply    Reply Using Power Editor
Peter Bromberg is a C# MVP, MCP, and .NET expert who has worked in banking, financial and telephony for over 20 years. Pete focuses exclusively on the .NET Platform, and currently develops SOA and other .NET applications for a Fortune 500 clientele. Peter enjoys producing digital photo collage with Maya,playing jazz flute, the beach, and fine wines. You can view Peter's UnBlog and IttyUrl sites. Pete Tweets at peterbromberg
  Rank Winnings Points
February 0 $0.00 0
January 0 $0.00 0


Didn't Find The Answer You Were Looking For?

EggHeadCafe has experts online right now that may know the answer to your question.  We pay them a bonus for answering as many questions as they can.  So, why not help them and yourself by becoming a member (free) and ask them your question right now?
Ask Question In Live Forum

If you have an OpenID and do not want to become a member of the EggHeadCafe forum, you can also sign on to Chat Chaos and post your question to our real time Silverlight chat application.
Ask Question In Chat Chaos










  $1000 Contest    [)ia6l0 iii - $228  |  Jonathan VH - $161  |  Huggy Bear - $135  |  F Cali - $95  |  egg egg - $94  |  more Advertise  |  Privacy  |   (c) 2010