Creating ActiveX control in vb.net

Hi,

I created  a control simple text box in VB as Windows User Control and used it as an object, that is ActiveX Control. First it was display perfectly. Then I added a button and reloaded the page its not showing anything except for the object as an Image Thumbnail.

Can any one tell me step by step to create an ActiveX control in vb.net and show it in browser.  
abbas1982Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

RejojohnyCommented:
what do you mean by activex control o? do you mean a COM control? but why do you want it in .net? what is the purpose .. COM componenets cannot be developed using vb.net ..

if you want to create a user control that you want to use in a asp.net project, create a "web user control" and not a windows user control ..

Rejo
0
abbas1982Author Commented:
Actually I want to develop a control which can upload more then one file. That a batch upload. e.g. A user selects a directory and its conetents are uploaded to the site through ftp.
0
RejojohnyCommented:
you can develop a web user control or a asp.net "file control" within a "repeater" control to show user multiple file upload options .. so he selects file in each of the "file control" by browsing to each file and then clicks on one "upload" button and all the files get uploaded ..

am not sure whether you can then upload the contents using FTP .. you cannot get files using FTP from a client machine .. if you have to "get" files using FTP, the server has to connect to a FTP server .. it cannot connect to a directory in some client machine ..

Rejo
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

abbas1982Author Commented:
So, how face book and other photo album applications on web do it.
0
RejojohnyCommented:
they are not using ftp, but going through http for the file upload and you can also do the same the way i described above ..
0
abbas1982Author Commented:
I dont know they are usinf ftp or what but they are definetly using some sort of activeX

This is the script which loads it
showUploader('http://upload.facebook.com/', '27072', '60', '535691821');

0
RejojohnyCommented:
those might be activex controls .. to create one you cannot use .net, you will have to use vb6 or any other software .. do note, that with activex, there are security restrictions and not everyone would be happy to download it ..

Rejo
0
abbas1982Author Commented:
But will the folder browse will work if a user accepts it. Because I managed to develop to build activex control. I built WindowsUserControl and used FolderBrowse but .NET throwed security exception
0
RejojohnyCommented:
you cannot create a windows user control and use it in web application .. you will have to create a web user control ..

have a look here on some sample codes
Multiple File Upload in ASP.Net
http://www.codetoad.com/asp.net_multiplefileupload.asp

http://www.ondotnet.com/pub/a/dotnet/2002/04/01/asp.html

some thrid party tools
http://www.telerik.com/products/aspnet/controls/upload/overview.aspx .. exactly as you want it .. this control is also developed in .net
http://www.programmersheaven.com/zone26/cat1210/index.htm
http://www.powupload.com/

Rejo
0
abbas1982Author Commented:
So, is there any I can create the same mechanism in VB6 creating OCX file and then use it in browsers.

I have checked that FaceBook is an OCX control and is intalled on the system (if the user grants the permission ) and it is located in "Download Program Files" of IE
0
RejojohnyCommented:
>>So, is there any I can create the same mechanism in VB6 creating OCX file and then use it in browsers
you will have to insert the developed OCX into your webpage as object tags ..

>>it is located in "Download Program Files" of IE
yes
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
abbas1982Author Commented:
Mr Rejojohny
So how can I do that ........

Any samples to get me started....
0
abbas1982Author Commented:
OK i have able to do it, but I m testing something then I ll show it here how it can be done.


But one question... an activex control developed on will will work on MAC OS or not.........

(COMMENT: Every problem has a solution; but a soultion creates one or more problem)
0
RejojohnyCommented:
>>an activex control developed on will will work on MAC OS or not.........
no, it will not work and that is what I also menat when I said above - "do note, that with activex, there are security restrictions and not everyone would be happy to download it .." it will also not work in some of the browsers unless you download the plugins ..

I am a strong beleiver that every problem has a solution if you really look for it at the right places :-) ..
0
abbas1982Author Commented:
One problem I found. I developed the control and it is working fine in my pc after the download and everything.

But wwhen I tested it on other pc, i clicked yes to install, but for some reason the control didnt register. I manually registerd it then it worked.....

Any known symtoms......

I also added the liscence file for winsock control
0
RejojohnyCommented:
what is the security setting on the browser of the other pc where it does not work? try with medium of low security .. ot customise the options available to prompt for activex controls and install them .. close all browser windows and retry .
0
abbas1982Author Commented:
Here I am posting how to accomplish multiple file uploads.

-Create an OCX control in VB6
-Use winsock to upload files (This is URL which explains how to upload a file in VB6 using winsock http://www.vbforums.com/showthread.php?t=337424)
-Package the control with deployment wizard, for internet. This will make a can file.
-Then following is the object Tag to be placed in your html, asp or aspx file

<OBJECT ID="PhotoUploadControl"
CLASSID="CLSID:73933396-34F0-4A02-A87A-695025009ECA"
CODEBASE="http://server/PhotoUpload.CAB#version=1,0,0,0" width="100%" height="100%">
<PARAM NAME="LPKPath" VALUE="http://staging/blink-2/lisc.lpk">
</OBJECT>

-The Package and deplyment wizzard creates a sample HTML file and shows how the control can be used.


-NTOES: The control should be signed by a security certificate like thwate or verisign.

I am awarding points to Rejojohny as he led me to do it.

Ta
0
abbas1982Author Commented:
I have posted the solution for it but the author motivated me to do it.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.