| View previous topic :: View next topic |
| Author |
Message |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Thu Aug 02, 2007 11:18 am Post subject: [VB] Opening a HLP file |
|
|
I've tried to open a HLP file using a command button in VB. I tried the code below...
| Command1_Click() wrote: | | Call Shell(C:/WINDOWS/Administrator/desktop/New Folder/Help.hlp) |
I gave my friend a copy but his computer is not maned Administrator, so he cannot open the Help.hlp file. Any solutions?
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Thu Aug 02, 2007 11:25 am Post subject: |
|
|
| Code: |
TCHAR tszDesktop[MAX_PATH];
if (SUCCEEDED(SHGetSpecialFolderPath(NULL, tszDesktop, CSIDL_DESKTOPDIRECTORY, 0))
{
PathAppend(tszDesktop, TEXT("New Folder\\Help.hlp"));
if (GetFileAttributes(tszDesktop) != INVALID_FILE_ATTRIBUTES)
{
ShellExecute(NULL, TEXT("open"), tszDesktop, NULL, NULL, SW_SHOW);
}
}
|
oh wait you can't do this because you're using VISUAL BASIC and VISUAL BASIC SUCKS.
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Thu Aug 02, 2007 12:11 pm Post subject: |
|
|
I get the point! I'm just learning it so I can get a hold on programing before I learn C++.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
Kevin Grandmaster Cheater Supreme
Reputation: 0
Joined: 07 Mar 2007 Posts: 1139 Location: Spiderman-World
|
Posted: Thu Aug 02, 2007 12:20 pm Post subject: |
|
|
| Start with C++ right away instead of learning VB first, or if you absolutely have to learn a language before C++, go Delphi.
|
|
| Back to top |
|
 |
Flyte Peanuts!!!!
Reputation: 6
Joined: 19 Apr 2006 Posts: 1887 Location: Canada
|
Posted: Thu Aug 02, 2007 12:34 pm Post subject: |
|
|
| HornyAZNBoy wrote: | | I get the point! I'm just learning it so I can get a hold on programing before I learn C++. |
That defeats the purpose. VB will ruin your head. It lessens your grip on programming, because programming was not meant to be like the english language.
|
|
| Back to top |
|
 |
AtheistCrusader Grandmaster Cheater
Reputation: 6
Joined: 23 Sep 2006 Posts: 681
|
Posted: Fri Aug 03, 2007 7:24 am Post subject: |
|
|
why do you use call shell????
use
Shell(C:/WINDOWS/Administrator/desktop/New Folder/Help.hlp)
call is not needed
|
|
| Back to top |
|
 |
Heartless I post too much
Reputation: 0
Joined: 03 Dec 2006 Posts: 2436
|
Posted: Fri Aug 03, 2007 9:57 am Post subject: |
|
|
| masterkert3 wrote: | why do you use call shell????
use
Shell(C:/WINDOWS/Administrator/desktop/New Folder/Help.hlp)
call is not needed |
Does it matter, I use Call Shell all the time.? I'm trying to open it with out the Shell function.
_________________
What dosen't kill you, usually does the second time. |
|
| Back to top |
|
 |
atlantis Advanced Cheater
Reputation: 0
Joined: 16 Jun 2007 Posts: 69
|
Posted: Fri Aug 03, 2007 11:17 am Post subject: |
|
|
Call Shell(Environ("homepath") & "\desktop\New Folder\Help.hlp)
if u understand.. but he must same language
lookup environ("homepath")
or if your app is in same folder use:
Call Shell(App.Path & "\" & "Help.hlp")
|
|
| Back to top |
|
 |
appalsap Moderator
Reputation: 0
Joined: 27 Apr 2006 Posts: 6753 Location: Pakistan
|
Posted: Fri Aug 03, 2007 11:24 am Post subject: |
|
|
| atlantis: that's shameful. You shouldn't try dangerous hacks to extend the language into something more than it is- you should be encouraging the OP to learn a real, useful language that will help him solve nontrivial problems with speed and ease.
|
|
| Back to top |
|
 |
Ksbunker Advanced Cheater
Reputation: 0
Joined: 18 Oct 2006 Posts: 88
|
Posted: Sat Aug 04, 2007 12:17 am Post subject: re: |
|
|
No need for shell or ShellExecuteA, Windows provides API in user32.dll to acheive this very easily.
Google "WinHelpA" (*.hlp) and "HtmlHelpA" (*.chm)
For VB Specific information visit: http://www.xtremevbtalk.com/archive/index.php/t-93651.html
|
|
| Back to top |
|
 |
|