473,396 Members | 1,812 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Help with creating tool

Thew
69
Hi

i am new to visual basic. So i am gonna need some help creating a tool.

what i want:

A tool with 1 text field, and 3 buttons.

If you press button 1, there will be a prompt box, to select a file (all files are clickable). If you select one, the content of the file will be shown in the text area. Then you can edit the text. Then when you press button 2, the file will be saved. When you didnt selected a file with button 1, there will be created a new file. When you press button 3, you will go to a website.

Now i already created the tool itself, but now the code.
Thats where i need help with.

I already found some code for button 3:

Expand|Select|Wrap|Line Numbers
  1. Private Sub Command3_Click()
  2. System.Diagnostics.Process.Start ("http://www.thewnetwork.tk/")
  3. End Sub
  4.  
but that didnt work. it gave this error:

Runtime error 424
Object required

i am using VB6

Thanks,
Thew
Sep 26 '10 #1
9 1584
Guido Geurs
767 Expert 512MB
This opens IE to the URL=

Expand|Select|Wrap|Line Numbers
  1. Shell "C:\Program Files\Internet Explorer\IEXPLORE.EXE http://www.thewnetwork.tk", vbMaximizedFocus
Sep 26 '10 #2
Thew
69
With is the problem: Not everyone has IE on his PC or has IE on drive C:\. For example, i have IE on drive D:\.
Sep 26 '10 #3
TamusJRoyce
110 100+
I believe the command you are looking for is Shell and not Start?

Shell("http://www.thewnetwork.tk/", vbNormalFocus)

But ggeu had the right idea. IE isn't always located in the C drive either.
Sep 26 '10 #4
Guido Geurs
767 Expert 512MB
If the settings are on each PC different, than You have to save them in a file.
Attached is an example how to do this.
Attached Files
File Type: zip Help with creating tool_v1.zip (9.2 KB, 55 views)
Sep 27 '10 #5
TamusJRoyce
110 100+
qqeu, have you used environment variables before?

try:
Expand|Select|Wrap|Line Numbers
  1. Shell "$ProgramFiles\Internet Explorer\IEXPLORE.EXE http://www.thewnetwork.tk", vbMaximizedFocus
  2.  
But this still doesn't open the default web browser if it isn't IE, or IE is uninstalled (some versions of windows 7 don't come with it installed!).

Any ideas, qqeu? I'm assuming Shell("http://www.thewnetwork.tk/", vbNormalFocus) doesn't work as documented.
Sep 27 '10 #6
Guido Geurs
767 Expert 512MB
Because the Explorer is not always the same and on different places, You have to save this path and filename of the browser in a file (settings.ini) with the command "Com_Settings" and the form "ExplorerSettings".

In the settings.ini file must be for You:
"D:\.......\IEXPLORER.EXE"
For an other PC: maybe= "C:\progr...\firefox.exe"

At the start of the program, the setting will be loaded into the textbox of the form "ExplorerSettings".

The line =
Expand|Select|Wrap|Line Numbers
  1.    Shell ExplorerSettings.Text_ExplorerPrg & " " & "http://www.thewnetwork.tk", vbMaximizedFocus
uses the text from this textbox to open the dedicated Explorer (IE, FireFox, ...) and the URL.
Sep 28 '10 #7
TamusJRoyce
110 100+
Using a .ini file you have to modify doesn't seem helpful enough.

There was a time where you had to search the windows registry to find the location and application you wished to execute. But that was back with Win16 API for Windows 3.1. Otherwise, the only other choice was using an .ini file approach.

I don't believe that NT based Windows has these global .ini files like settings.ini around anymore. If they do, they are legacy and can't be considered correct or to contain the information you may want.

But a better solution would be to find the command to tell Windows to open the website in question (Win95 and above), and Windows will choose the correct browser.

Otherwise, maybe someone else has some idea's?
Sep 30 '10 #8
TamusJRoyce
110 100+
I knew if I thought about it long enough I would remember it...

Expand|Select|Wrap|Line Numbers
  1. Shell("rundll32.exe shell32.dll,ShellExec_RunDLL http://www.thewnetwork.tk/", vbNormalFocus)
  2.  
http://www.vbaccelerator.com/codelib/shell/shellex.htm is an article that gives an example of importing shell32.dll and using ShellExec directly for vb6, if you would rather not rely on rundll32.exe
Sep 30 '10 #9
TamusJRoyce
110 100+
This rundll32.exe trick doesn't seem to be working for windows 7. Does anyone know one that will? or I will post one if I find it.

Ah. Well, the rundll works in a pinch if you only need to support <= windows xp, but System.Diagnostics.Process.Start("http://www.thewnetwork.tk/") is what you typically want.
Nov 18 '10 #10

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Phil | last post by:
k, here is my issue.. I have BLOB data in SQL that needs to be grabbed and made into a TIF file and placed on the client (could be in temp internet dir). The reason we need it in TIF format is...
7
by: Ronald S. Cook | last post by:
I was just wondering if anyone knew the most common 3rd party tool to buy for help authoring for our .NET Windows apps. We're looking to choose/standardize on something. Or, is it possible there'...
4
by: DeanL | last post by:
Hi Guys, I need some help creating a query that is going to take between 1 and 10 parameters. The parameters are entered on a form into text boxes that may have data or be empty. Is there a...
5
by: Stick | last post by:
Hi, I normally program in C++, and I'm trying to write this little tool in C#, but I quickly realized that I can't use pointers, so instead I need to create an array of 3 Color 's private...
2
by: JC | last post by:
I'm looking for help creating a keylogger program.It doesn't have to be hidden because I want to allow people access to what they have written. Can anyone help me with this or send me tutorials or...
5
by: Kristen | last post by:
I am using ASP.Net 2.0 and I need to create a web page on the fly based on what information is in the database. The page is going to have certain controls like text boxes and labels and buttons. ...
8
by: Swans, What Swans? | last post by:
In one of my tables, in addition to a text field that is a Description field, there are two fields for color formatting the data in reports. They are Longs and hold the foreground and background...
3
by: Dhananjay | last post by:
Hello everyone Do you have any idea about how to generate a tool which will extract the contents and images from html page.or do you have any resources then let me know. i am using VS 2005...
4
by: Marc | last post by:
HI, I have a set of dynamically created buttons and textbox's. Each button is linked to a textbox using the accessiblename property. I want to show a button tool tip containing the text box's...
6
by: firefighter17103 | last post by:
Hi All, I am new to MS Access 07, & do not know any VB, on a new business adventure. I am running Office07 on Vista Home Premium. I am in the process of creating a database that in the end I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.