Home All Groups Group Topic Archive Search About

ShellExecute to html file in VB.net

Author
17 Mar 2009 3:11 PM
Robert Styma
I have used SHellExecute from C++ successfully on
Visual Studio 6.  I am currently using Visual Studio 2008
coding in Visual Basic.  All the examples I have tracked down
to use ShellExecute to open a file with the appropriate application
end up looking something like this:


    Private Declare Function ShellExecute Lib "shell32.dll" _
   Alias "ShellExecuteA" _
  (ByVal hwnd As Long, _
   ByVal lpOperation As String, _
   ByVal lpFile As String, _
   ByVal lpParameters As String, _
   ByVal lpDirectory As String, _
   ByVal nShowCmd As Long) As Long

    Private Sub Command1_Click()
        Const SW_SHOWDEFAULT As Long = 10
        Dim sFullPathToFile As String
        Dim rc As Long
        sFullPathToFile = "C:\tmp\EditMenu.htm"

        rc = ShellExecute(0, "Open", sFullPathToFile _
        , 0&, 0&, SW_SHOWDEFAULT)
    End Sub

When I execute the above, it does not throw an exception, It does not
generate anything in the event log.  It appears to run.
rc is returned as 1642688007033061378
x"16CA000A00000002"
The path to the file does exist and IE is defined as the
default application for .html files.  I have not been able to track
down what that error means. 

Can someone give me a pointer as to how to fix this issue?




--
Robert Styma
Principal Engineer (DMTS)
Alcatel-Lucent

Author
17 Mar 2009 3:17 PM
Jeff Johnson
"Robert Styma" <rollingbigbob@newsgroup.nospam> wrote in message
news:B98E6266-40E1-4A5A-8B12-FDD08282F534@microsoft.com...

> I am currently using Visual Studio 2008 coding in Visual Basic.

[Canned response]

This is a VB "classic" newsgroup. Questions about VB.NET (including VB
2005/2008 and VB Express, which have dropped .NET from their names) are
off-topic here.

Please ask .NET questions in newsgroups with "dotnet" in their names. The
*.vb.* groups are for VB6 and earlier. If you don't see the *.dotnet.*
groups on your news server, connect directly to the Microsoft server:
msnews.microsoft.com.

For questions specific to the VB.NET language, use this group:

microsoft.public.dotnet.languages.vb

Please note that things like controls and data access, which have their own
subgroups in the Classic VB hierarchy, are not language-specific in .NET, so
you should look for groups like these:

microsoft.public.dotnet.framework.windowsforms.controls
microsoft.public.dotnet.framework.adonet

(Note that "vb" is not present in the group name.)
Author
17 Mar 2009 4:17 PM
mayayana
> I have used SHellExecute from C++ successfully on
> Visual Studio 6.  I am currently using Visual Studio 2008
> coding in Visual Basic.

You're using VB.Net. VB and VB.Net two different things.
This group is for VB. For VB.Net try here:

microsoft.public.dotnet.languages.vb

  Microsoft dropped ".Net" from the name "VB.Net" as
part of their marketing strategy to sell .Net to VB developers.
Adding to that confusion, VB.Net has been named with several
versioning systems. There is .Net v. 1, 1.1, 2 and 3. There is .Net
2005 and .Net 2008. And sometimes the VB.Net versions
are referred to as VB7, VB8 and VB9, even though VB.Net is
not a continuation of VB6! These days, anything other than
VB5 or VB6 is probably VB.Net.

  You need to be aware of the difference between "the two VBs"
when looking for newsgroups. The same applies when searching
for sample code. VB and VB.Net code can look very similar in
some cases, but code in one system is not applicable to the other.
Author
17 Mar 2009 11:38 PM
Bill McCarthy
Give it up Mayayana. This spam of yours is adding nothing of any real help.

"mayayana" <mayayaX***@rcXXn.com> wrote in message
news:%23cwVqOxpJHA.1172@TK2MSFTNGP04.phx.gbl...
>
>  Microsoft dropped ".Net" from the name "VB.Net" as
> part of their marketing strategy to sell .Net to VB developers.

Nonsense.  The reason they dropped .NET from their naming was across the
board for all their products because they found it caused confusion, the
very same confusion you are still demonstrating today after being told
you've got it wrong (so many times)

> Adding to that confusion, VB.Net has been named with several
> versioning systems. There is .Net v. 1, 1.1, 2 and 3. There is .Net
> 2005 and .Net 2008.


No there is not.   .Net v. 1, 1.1, 2 and 3 refers to the framework versions
(aka the runtimes)
Only products such as Visual Studio, Visual Basic or Visual C# are denoted
with the year of release.

So will you please stop posting this nonsense of yours claiming that "There
is .Net 2005 and .Net 2008. "  There isn't, and you have been told this
umpteen times.  The only reason you continue to post this must be because
you are deliberately trying to start and argument or deliberately trying to
confuse people. In either case, try growing up and maybe next time even just
skip over any dotnet question rather than posting misleading info, hey ?
Author
17 Mar 2009 11:59 PM
Karl E. Peterson
Bill McCarthy wrote:
> The reason they dropped .NET from their naming was across the
> board for all their products because they found it caused confusion,

Just like Vista, eh?  I dunno about you, but I sure didn't see too many folks
confused about what that portended! <g>

Face it, .NET is to Vista what Bush is to Cheney.  The only difference is magnitude
of abomination.
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
17 Mar 2009 11:32 PM
Bill McCarthy
Hi Robert,

Have a look for the Process class in System.Diagnostics namespace. It has a
Start method such as Process.Start(sFullPathToFile).
NOTE: For VB.NET questions please use the dotnet newsgroups such as :
microsoft.public.dotnet.languages.vb,



Show quoteHide quote
"Robert Styma" <rollingbigbob@newsgroup.nospam> wrote in message
news:B98E6266-40E1-4A5A-8B12-FDD08282F534@microsoft.com...
>I have used SHellExecute from C++ successfully on
> Visual Studio 6.  I am currently using Visual Studio 2008
> coding in Visual Basic.  All the examples I have tracked down
> to use ShellExecute to open a file with the appropriate application
> end up looking something like this:
>
>
>    Private Declare Function ShellExecute Lib "shell32.dll" _
>   Alias "ShellExecuteA" _
>  (ByVal hwnd As Long, _
>   ByVal lpOperation As String, _
>   ByVal lpFile As String, _
>   ByVal lpParameters As String, _
>   ByVal lpDirectory As String, _
>   ByVal nShowCmd As Long) As Long
>
>    Private Sub Command1_Click()
>        Const SW_SHOWDEFAULT As Long = 10
>        Dim sFullPathToFile As String
>        Dim rc As Long
>        sFullPathToFile = "C:\tmp\EditMenu.htm"
>
>        rc = ShellExecute(0, "Open", sFullPathToFile _
>        , 0&, 0&, SW_SHOWDEFAULT)
>    End Sub
>
> When I execute the above, it does not throw an exception, It does not
> generate anything in the event log.  It appears to run.
> rc is returned as 1642688007033061378
> x"16CA000A00000002"
> The path to the file does exist and IE is defined as the
> default application for .html files.  I have not been able to track
> down what that error means.
>
> Can someone give me a pointer as to how to fix this issue?
>
>
>
>
> --
> Robert Styma
> Principal Engineer (DMTS)
> Alcatel-Lucent
Author
18 Mar 2009 1:20 AM
Kevin Provance
"Bill McCarthy" <I have a little tiny dick> wrote in message
news:ezvbaj1pJHA.4516@TK2MSFTNGP02.phx.gbl...
| Hi Robert,
|
| Have a look for the Process class in System.Diagnostics namespace. It has
a
| Start method such as Process.Start(sFullPathToFile).
| NOTE: For VB.NET questions please use the dotnet newsgroups such as :
| microsoft.public.dotnet.languages.vb,

Again you must be reminded that this is a VB Classic newsgroup and that
VB.NET is off topic and inappropriate.  And, you are an identity thief by
using the URL of my website in your email information.  No one at any time
should take you seriously.

All replies from here on in will be redirected towards the appropriate
group.  Please discontinue your encouraging further replies of off topic
material in the incorrect newsgroup, or suffer the consequences.
Author
18 Mar 2009 5:54 AM
Cor Ligthert[MVP]
> NOTE: For VB.NET questions please use the dotnet newsgroups such as :
> microsoft.public.dotnet.languages.vb,

Why Bill as the MSDN newsgroup servers directs  every question with VB and
Net in it to this newsgroup?



Cor

Show quoteHide quote
"Bill McCarthy" <TPASoft.com Are Identity Thieves> wrote in message
news:ezvbaj1pJHA.4516@TK2MSFTNGP02.phx.gbl...
> Hi Robert,
>
> Have a look for the Process class in System.Diagnostics namespace. It has
> a Start method such as Process.Start(sFullPathToFile).
> NOTE: For VB.NET questions please use the dotnet newsgroups such as :
> microsoft.public.dotnet.languages.vb,
>
>
>
> "Robert Styma" <rollingbigbob@newsgroup.nospam> wrote in message
> news:B98E6266-40E1-4A5A-8B12-FDD08282F534@microsoft.com...
>>I have used SHellExecute from C++ successfully on
>> Visual Studio 6.  I am currently using Visual Studio 2008
>> coding in Visual Basic.  All the examples I have tracked down
>> to use ShellExecute to open a file with the appropriate application
>> end up looking something like this:
>>
>>
>>    Private Declare Function ShellExecute Lib "shell32.dll" _
>>   Alias "ShellExecuteA" _
>>  (ByVal hwnd As Long, _
>>   ByVal lpOperation As String, _
>>   ByVal lpFile As String, _
>>   ByVal lpParameters As String, _
>>   ByVal lpDirectory As String, _
>>   ByVal nShowCmd As Long) As Long
>>
>>    Private Sub Command1_Click()
>>        Const SW_SHOWDEFAULT As Long = 10
>>        Dim sFullPathToFile As String
>>        Dim rc As Long
>>        sFullPathToFile = "C:\tmp\EditMenu.htm"
>>
>>        rc = ShellExecute(0, "Open", sFullPathToFile _
>>        , 0&, 0&, SW_SHOWDEFAULT)
>>    End Sub
>>
>> When I execute the above, it does not throw an exception, It does not
>> generate anything in the event log.  It appears to run.
>> rc is returned as 1642688007033061378
>> x"16CA000A00000002"
>> The path to the file does exist and IE is defined as the
>> default application for .html files.  I have not been able to track
>> down what that error means.
>>
>> Can someone give me a pointer as to how to fix this issue?
>>
>>
>>
>>
>> --
>> Robert Styma
>> Principal Engineer (DMTS)
>> Alcatel-Lucent
>
Author
18 Mar 2009 2:13 PM
Eduardo
"Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> escribió en el mensaje
news:u$svI44pJHA.3876@TK2MSFTNGP02.phx.gbl...
>> NOTE: For VB.NET questions please use the dotnet newsgroups such as :
>> microsoft.public.dotnet.languages.vb,
>
> Why Bill as the MSDN newsgroup servers directs  every question with VB and
> Net in it to this newsgroup?

What are you talking about? Could you be so kind and being more specific and
say how to look into this issue?
Author
18 Mar 2009 4:48 PM
Kevin Provance
"Eduardo" <m*@mm.com> wrote in message news:gpr32v$fsh$1@aioe.org...
|
| What are you talking about? Could you be so kind and being more specific
and
| say how to look into this issue?

It's either one of two things.

1) Weak minded, clueless MVPs who don't know dick about anything taking
matters into their own hands.

2) More MSFT FUD in an ongoing effort to pollute this community.

Really, it's the same thing if you think about it.  Time to rewrite the
canned responses.

Make sure that when .netters are directed here that you redirect all follow
ups to the .net group so that all consequent replies end up there, where
they belong.  And I would also go as far as to advise in such replies Cor's
and Bill's private email addresses so the OP can get the kind of personall
attention that off topic replies seem to get here.  Clutter up their inboxes
enough and maybe they'll think twice before cluttering up this group with
their proaganda.
Author
18 Mar 2009 7:09 PM
Karl E. Peterson
Eduardo wrote:
> "Cor Ligthert[MVP]" <Notmyfirstn***@planet.nl> escribió en el mensaje...
>>> NOTE: For VB.NET questions please use the dotnet newsgroups such as :
>>> microsoft.public.dotnet.languages.vb,
>>
>> Why Bill as the MSDN newsgroup servers directs every question with VB and
>> Net in it to this newsgroup?
>
> What are you talking about? Could you be so kind and being more specific and
> say how to look into this issue?

Silly old goat doesn't know NNTP from HTTP, clearly.

What a (useless old) tool he is...
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
18 Mar 2009 9:31 AM
Michael Williams
"Bill McCarthy" <TPASoft.com Are Identity Thieves> wrote in message
news:ezvbaj1pJHA.4516@TK2MSFTNGP02.phx.gbl...

> Hi Robert, Have a look for the Process class in
> System.Diagnostics namespace.

Hi McCarthy. Have a look at your of tank of sheep dip. In fact, have a drink
of it to see if it knocks any sense into your stupid head. This is a Classic
VB newsgroup. Just redirect dotnet questions to the correct group and STOP
attempting to answer them here. Dick brain.

Michael