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

File Open Dialog

P: n/a
As a lot of us might now, the input file (aka browse button) in html does not
allow for multiple file selection or for filtering file types. The File Open
dialog used in WinForms allow these things and more.

I developed a windows user control in VB.NET with a button and File Open
Dialog, which allows multiple file selection. I registered the assembly with
regasm.exe and call the object from the html page with the object tag:

<OBJECT id="MyWinControl1" codeBase="Cab2.cab"
type="application/x-oleobject" height="280" width="480"
classid="CLSID:28766FA7-91E9-3A61-BC65-1981B6E6E840"
VIEWASTEXT></object>

When i run the page locally it works because the object is registered, but
when the page is ran from a computer that does not have the assembly
registered i get the little x icon in the browser. I thought the codeBase
will execute and prompt the user if they wanted to install the software, but
it doesn't.

Am I doing something wrong? Should the codebase reference the dll directly?
Should i use a different approach? Is this possible? If it was possible and
someone would help me make this work, would the user need to have the
framework installed in their machine?
Nov 19 '05 #1
Share this Question
Share on Google+
3 Replies


P: n/a
cab files are used with an install and IE uses the interal inf file. the cab
file also must be signed. you can reference the dll directly if it has no
other dependences. the user will still have to trust your site to get the
download, and must have the framework preinstalled.

-- bruce (sqlwork.com)
"JoNaS" <Jo***@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
| As a lot of us might now, the input file (aka browse button) in html does
not
| allow for multiple file selection or for filtering file types. The File
Open
| dialog used in WinForms allow these things and more.
|
| I developed a windows user control in VB.NET with a button and File Open
| Dialog, which allows multiple file selection. I registered the assembly
with
| regasm.exe and call the object from the html page with the object tag:
|
| <OBJECT id="MyWinControl1" codeBase="Cab2.cab"
| type="application/x-oleobject" height="280" width="480"
| classid="CLSID:28766FA7-91E9-3A61-BC65-1981B6E6E840"
| VIEWASTEXT></object>
|
| When i run the page locally it works because the object is registered, but
| when the page is ran from a computer that does not have the assembly
| registered i get the little x icon in the browser. I thought the codeBase
| will execute and prompt the user if they wanted to install the software,
but
| it doesn't.
|
| Am I doing something wrong? Should the codebase reference the dll
directly?
| Should i use a different approach? Is this possible? If it was possible
and
| someone would help me make this work, would the user need to have the
| framework installed in their machine?
Nov 19 '05 #2

P: n/a
ok, then how do i create the inf and install files?

JoNaS

"bruce barker" wrote:
cab files are used with an install and IE uses the interal inf file. the cab
file also must be signed. you can reference the dll directly if it has no
other dependences. the user will still have to trust your site to get the
download, and must have the framework preinstalled.

-- bruce (sqlwork.com)
"JoNaS" <Jo***@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
| As a lot of us might now, the input file (aka browse button) in html does
not
| allow for multiple file selection or for filtering file types. The File
Open
| dialog used in WinForms allow these things and more.
|
| I developed a windows user control in VB.NET with a button and File Open
| Dialog, which allows multiple file selection. I registered the assembly
with
| regasm.exe and call the object from the html page with the object tag:
|
| <OBJECT id="MyWinControl1" codeBase="Cab2.cab"
| type="application/x-oleobject" height="280" width="480"
| classid="CLSID:28766FA7-91E9-3A61-BC65-1981B6E6E840"
| VIEWASTEXT></object>
|
| When i run the page locally it works because the object is registered, but
| when the page is ran from a computer that does not have the assembly
| registered i get the little x icon in the browser. I thought the codeBase
| will execute and prompt the user if they wanted to install the software,
but
| it doesn't.
|
| Am I doing something wrong? Should the codebase reference the dll
directly?
| Should i use a different approach? Is this possible? If it was possible
and
| someone would help me make this work, would the user need to have the
| framework installed in their machine?

Nov 19 '05 #3

P: n/a
Ok, I created the cab file and inserted the WinControls.dll and WinControls.inf

I used this tutorial:
http://msdn.microsoft.com/library/de.../packaging.asp

INF Content
[version]
signature="$CHICAGO$"
AdvancedINF=2.0
[Add.Code]
WinControls.dll=WinControls.dll
[WinControls.dll]
file-win32-x86=thiscab
clsid={28766FA7-91E9-3A61-BC65-1981B6E6E840}
FileVersion=1,1,4322
RegisterServer=yes

I then signed the CAB File with this tutorial:
http://support.microsoft.com/kb/247257/EN-US/

When running the web page from a client computer I get the prompt to install
it. I click yes and then i get the red x.

What am I doing wrong? Is it the inf file? is it that the cab file does not
contain an exe to install?

JoNaS

"bruce barker" wrote:
cab files are used with an install and IE uses the interal inf file. the cab
file also must be signed. you can reference the dll directly if it has no
other dependences. the user will still have to trust your site to get the
download, and must have the framework preinstalled.

-- bruce (sqlwork.com)
"JoNaS" <Jo***@discussions.microsoft.com> wrote in message
news:0A**********************************@microsof t.com...
| As a lot of us might now, the input file (aka browse button) in html does
not
| allow for multiple file selection or for filtering file types. The File
Open
| dialog used in WinForms allow these things and more.
|
| I developed a windows user control in VB.NET with a button and File Open
| Dialog, which allows multiple file selection. I registered the assembly
with
| regasm.exe and call the object from the html page with the object tag:
|
| <OBJECT id="MyWinControl1" codeBase="Cab2.cab"
| type="application/x-oleobject" height="280" width="480"
| classid="CLSID:28766FA7-91E9-3A61-BC65-1981B6E6E840"
| VIEWASTEXT></object>
|
| When i run the page locally it works because the object is registered, but
| when the page is ran from a computer that does not have the assembly
| registered i get the little x icon in the browser. I thought the codeBase
| will execute and prompt the user if they wanted to install the software,
but
| it doesn't.
|
| Am I doing something wrong? Should the codebase reference the dll
directly?
| Should i use a different approach? Is this possible? If it was possible
and
| someone would help me make this work, would the user need to have the
| framework installed in their machine?

Nov 19 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.