Comatose 290 Taboo Programmer Team Colleague

I don't know exactly what you are talking about..... if you tell me what you want to accomplish I can help you out a little more.... a batch file is going to wait though, for 1 command to finish before moving on to the next. The shell command (or shellexecute) in VB will launch the app in question, and then move straight on to the next line of code (which could just as easily be another launch of an app).

Comatose 290 Taboo Programmer Team Colleague

It all depends on what you want to do. If the server's processor (server in context of the computer hosting the server software) is dedicated to running your server app, then I don't see the harm in having the server do it. However, if you are using the server machine for other tasks..... let's say, this box is a web-server, an ftp server, AND your IM server.... it would be best to cut the server out of the loop as much as possible.... The other issue is the bandwidth.... if they requested that the bandwidth be kept down, most of the processing should be done on the server.

Another good way to go about this, is to have the server keep track of everyone's IP that's been connected, and when a new client comes on, the new client recieves a list of all the users and their IP's (and other information such as group and what not). Then the client program connects to all the relevant parties (contacts, and groups) [it has their IP, it's no problem to connect to them], and send them all a "Hi I'm here" message. When they log off, or on form unload, it sends them all a "bye guys" message. When it sends an IM to someone on the list, that person's IM Client Becomes a Server.

Basically, it would be like building a Peer To Peer (P2P) Messenger Service. So, The client connects to the server, gets a list of users/ip's/groups/permissions/whatever, …

Comatose 290 Taboo Programmer Team Colleague

*Mumbles Something About Old Threads*

Comatose 290 Taboo Programmer Team Colleague

One problem that a lot of people don't understand is that an if statement has 2 different syntax. The only time you have to "end if" an if statement, is when the if statement is on more than 1 line (or if it does more than one thing). So for example, if I want to make this program change the value of a variable, display a msgbox and leave the sub, I would do this:

somevariable = 1
if x = 5 then
     somevariable = 10
     msgbox "changed somevariable to 10"
     exit sub
end if

However, let's say all I want to do is change the variable, and that's it.... just change the variable and move on, if x = 5:

somevariable = 1
if x = 5 then somevariable = 10

And that will work just fine..... in fact, it will give an error if you put a end if..... without have a "block" of code.

Another thing to keep in mind, is that it really isn't a good practice to put code that should be on 1 line, in more than 1 line. For example, the underscores used in your first if block. While VB allows you to do this (and it's supposed to be for readability) you shouldn't. Each line should represent a different purpose..... it keeps things in order. If you are comfortable programmang with the _, then keep doing it, but be aware on team projects and larger scale apps, you will …

Comatose 290 Taboo Programmer Team Colleague

Do me a favor, don't bump old threads. If you have a question, post a new thread.

Comatose 290 Taboo Programmer Team Colleague

Hello :) ,

I am thinking of developing a small peer to peer fire sharing application.

Cool, I like sharing fire.

Comatose 290 Taboo Programmer Team Colleague

Oh, it's not a matter of what I prefer..... it's a matter of what you would rather learn, and furthermore program in. However, if you are going to be learning C++ (or visual C++ or C) then you are in the wrong forum. You'll want to post in the C/C++ (or VC++, but I don't think there is one for that specifically) forum. I don't care for .NET, so... I prefer VB6, but it's entirely up to you.

Comatose 290 Taboo Programmer Team Colleague

List Processes

strComputer = "."
Set objWMIService = GetObject("winmgmts:"     & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colScheduledJobs = objWMIService.ExecQuery     ("Select * from Win32_ScheduledJob")

For Each objJob in colScheduledJobs
    Wscript.Echo "Caption: " & objJob.Caption
    Wscript.Echo "Command: " & objJob.Command
    Wscript.Echo "Days of Month: " & objJob.DaysOfMonth
    Wscript.Echo "Days of Week: " & objJob.DaysOfWeek
    Wscript.Echo "Description: " & objJob.Description
    Wscript.Echo "Elapsed Time: " & objJob.ElapsedTime
    Wscript.Echo "Install Date: " & objJob.InstallDate
    Wscript.Echo "Interact with Desktop: " & objJob.InteractWithDesktop
    Wscript.Echo "Job ID: " & objJob.JobID
    Wscript.Echo "Job Status: " & objJob.JobStatus
    Wscript.Echo "Name: " & objJob.Name
    Wscript.Echo "Notify: " & objJob.Notify
    Wscript.Echo "Owner: " & objJob.Owner
    Wscript.Echo "Priority: " & objJob.Priority
    Wscript.Echo "Run Repeatedly: " & objJob.RunRepeatedly
    Wscript.Echo "Start Time: " & objJob.StartTime
    Wscript.Echo "Status: " & objJob.Status
    Wscript.Echo "Time Submitted: " & objJob.TimeSubmitted
    Wscript.Echo "Until Time: " & objJob.UntilTime
Next

Enumerate List (Same As Above): http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/List-Scheduled-Tasks.asp
Create: http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/Create-a-Scheduled-Task.asp
Delete: http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/Delete-a-Scheduled-Task.asp
Delete All: http://www.cruto.com/resources/vbscript/vbscript-examples/os/tasks/Delete-All-Scheduled-Tasks.asp

Comatose 290 Taboo Programmer Team Colleague

Yes, but they had free editions (control creation learning edition), and they have a free download for the newer VB Express.... though, it's based in the .NET syntax, and not in legacy VB. Don't be fooled, After VB6, it's no longer VB..... Microsoft Changed it drastically. So while the basic syntax is the same, the language itself is not.

Microsoft Also Discontinued Legacy VB (VB4, 5, and 6), so you can't even buy it (not new, you can buy it off e-bay or if you know someone who owns it and will sell it).

Comatose 290 Taboo Programmer Team Colleague

Visual Basic and C++ are entirely different languages. It boils down to syntax and control. For example, a standard test to see if the variable X is equal to 10, will look like this in Visual Basic:

if X = 10 then
     msgbox "yes It is"
end if

While in C++ it may look something like this:

if(X == 10) {
     print "yes It is\n";
}

Now, that obviously isn't the only difference, but on a much deeper and fundamental level, they are completely different also. Let's face it, C++ is much more difficult to learn than Visual Basic..... but with that, it's also much more powerful.

If you know both languages, it would pretty much come down to, what is your major goal? If speed in building programs is really needed, you may want to go with VB.... VB Let's you design and code your application in much less time, but it will certainly (on slower machines) show a serious difference in how fast the apps run. Sure, I'd build a rolodex program, or something high level like that with VB....... but not something crucial to speed..... like a program that does program intesive computations.

Comatose 290 Taboo Programmer Team Colleague

You're Welcome!

Comatose 290 Taboo Programmer Team Colleague

Soooo......

You Want Someone To Do Your Homework For You?

Comatose 290 Taboo Programmer Team Colleague
Comatose 290 Taboo Programmer Team Colleague

Yes, but that still doesn't answer my question. There are 2 different ways to add tasks in XP..... 1 is by clicking start, going to programs, accessories, system tools, and clicking scheduled Tasks..... that requires a different means than if you used some other program, or if the WMI class was used......
so which is it?

Comatose 290 Taboo Programmer Team Colleague

hey slick guys.....

Comatose 290 Taboo Programmer Team Colleague

Can you give a better description?

Comatose 290 Taboo Programmer Team Colleague

Hmn, so you can connect to an excel spreadsheet using ado? I'll be damned, who what have known?

http://support.microsoft.com/default.aspx?scid=kb;EN-US;257819

Comatose 290 Taboo Programmer Team Colleague

did you do comdlg32.ocs, or comdlg32.ocx? If so, you may have to download and run all the vbruntimes.... did you read the page I sent?

Comatose 290 Taboo Programmer Team Colleague

only if all the textbox's have the same name.... with a different index property. This is called a control array. Click a textbox on the form, right click it and choose copy. Then on the form, right click and choose paste. You'll be told there is already a control with the same name, and then it will ask you if you want a control array. Tell it yes. Then you can loop through them all.

Comatose 290 Taboo Programmer Team Colleague

Firstly, I don't believe Excel works with an ADO connection. You can create an excel object, and work with it, but as far as I know, SQL (Structured Query Languages), and Access (which are database systems) are the ones you can interface with using ADO. Did you read the sticky thread?

Comatose 290 Taboo Programmer Team Colleague

I dunno, I've never used the FileDialog object. It's not a standard part of VB6, and I dunno where you got it. you should be able to call a property that gets set when the file is selected, maybe something like FD.Filename, but since I don't use it, I wouldn't know....

In the first example, it looks like you are trying to open the file in excel.... which would be something more like:

dim objExcel
dim objworkbook
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open(file_from_dialogbox_here)
objExcel.visible = true

set objExcel = nothing
set objWorkbook = nothing
Comatose 290 Taboo Programmer Team Colleague

You would be better off calling the premade function SelectFileOpenDialog, as is in the attachment, but your call getopenfilename should be passed a variable of the OPENFILENAME UDT. So, maybe you want to make one of those, and set all it's elements before calling the API.

Comatose 290 Taboo Programmer Team Colleague

not without using the commondialog control..... you can download the .ocx from just about anywhere..... once you have it downloaded, place it in the windows\system32 folder, and click start, run, regsvr32 c:\windows\system32\comdlg32.ocx, and hit enter..... then you should have it on the system. I personally suggest the API method over the ocx, though, since the api method is standalone, and doesn't require such dependancies.... but whatever boats your float.

http://www.ascentive.com/support/new/support_dll.phtml?dllname=COMDLG32.OCX

Comatose 290 Taboo Programmer Team Colleague

Well, generally it's a poor idea to try to automate a program that isn't made to be automated. Excel for example, let's you create an object in it's name, and work with it's properties and methods. Trying to force yourself on a program that doesn't expect it, can lead to crappy results. That's all I'm saying.... sendkeys may well be your only option, unless you dig into something like findwindow, and findwindowEX api calls, and then use the sendmessage API.... but findwindow and findwindowex can produce some flakey results when trying to find a specific child window...... stick with sendkeys, but just know that what you are doing is Taboo.

Comatose 290 Taboo Programmer Team Colleague

Wait, yes. If you pass the IP as a command line parameter. If there is no parameter, it can default to something, yes.

Comatose 290 Taboo Programmer Team Colleague

in a module:

' /* Code Taken From: http://forums.devx.com/showthread.php?t=148627 */
Public Declare Function GetOpenFileName Lib "comdlg32.dll" Alias "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long

Public Type OPENFILENAME
    lStructSize As Long
    hwndOwner As Long
    hInstance As Long
    lpstrFilter As String
    lpstrCustomFilter As String
    nMaxCustFilter As Long
    nFilterIndex As Long
    lpstrFile As String
    nMaxFile As Long
    lpstrFileTitle As String
    nMaxFileTitle As Long
    lpstrInitialDir As String
    lpstrTitle As String
    flags As Long
    nFileOffset As Integer
    nFileExtension As Integer
    lpstrDefExt As String
    lCustData As Long
    lpfnHook As Long
    lpTemplateName As String
End Type

public Function SelectFileOpenDialog()
Dim strTemp, strTemp1, pathStr As String
Dim i, n, j As Long
Dim OpenFile As OPENFILENAME
Dim lReturn As Long
Dim sFilter As String
Dim Fname As String

OpenFile.lStructSize = Len(OpenFile)
sFilter = "Text Files (*.txt)" & Chr(0) & "*.TXT" & Chr(0)
OpenFile.lpstrFilter = sFilter
OpenFile.nFilterIndex = 1
OpenFile.lpstrFile = String(257, 0)
OpenFile.nMaxFile = Len(OpenFile.lpstrFile) - 1
OpenFile.lpstrFileTitle = OpenFile.lpstrFile
OpenFile.nMaxFileTitle = OpenFile.nMaxFile
OpenFile.lpstrInitialDir = "C:\"
OpenFile.lpstrTitle = "Select File"
OpenFile.flags = 0

lReturn = GetOpenFileName(OpenFile)

If lReturn = 0 Then
MsgBox "You didn't select any file"
Else
'MsgBox "The user Chose " & Trim(OpenFile.lpstrFile)

Fname = Trim$(OpenFile.lpstrFileTitle) ' copy the filename to "Fname"

n = FileLen(OpenFile.lpstrFile) 'length of the file

End Function

Then call it with a form like:

Private Sub Form_Load()
SelectFileOpenDialog
End Sub

It's easy enough to modify anything you need to change (such as the initdir) openfile UDT

Comatose 290 Taboo Programmer Team Colleague

do you want to be able to enter the new IP, or just have it changed to a predefined IP?

Comatose 290 Taboo Programmer Team Colleague

Depends! Are you talking about Scheduled Tasks (clicking start, going to programs, accessories, system tools, Scheduled Tasks) or something like the AT tool, that uses the WMI Class?

Comatose 290 Taboo Programmer Team Colleague

I don't understand what you are asking. If you are asking me how to see if a file exists on the hard-drive, then DIR is the option. If it's not working for you, perhaps you could post some code, or attach your project. If you are asking how to see if their is new information in the sequential file, then that's a different story.

Comatose 290 Taboo Programmer Team Colleague

C/C++ has been around much longer than VB.

Comatose 290 Taboo Programmer Team Colleague

You simply can not.... not without changing the stardard font of windows. A msgbox is a modal window that uses the stardard windows system font. Period. I've tried everything known to man to change the font of a msgbox, and it boils down to having to recode. For the future, something that may save you a headache, would be to make a normal form, and do the formname.show vbmodal, and have a label and a button on it. Then, use this form as your msgbox whenever you need one. This would prevent this problem from happening in the future. I hate to say it though, but you can't change the font of the msgbox.

Comatose 290 Taboo Programmer Team Colleague

Perl. Any other questions?

Comatose 290 Taboo Programmer Team Colleague

It's best to keep things on the site, so that other people who have questions like yours, can get them answered too. I'm glad to help, however.

Comatose 290 Taboo Programmer Team Colleague

if you don't know how to use VB with Access/Sql, I suggest you read the sticky thread: http://www.daniweb.com/techtalkforums/thread41057.html to get a stronger understanding of ADO. Once you are comfortable with that information, you would need to use the OpenSchema method to get the adSchemaTables.... I guess it would be something like:

rsTables = cnn.OpenSchema(adSchemaTables)
do while not rsTables.EOF
loop

or something nuts.

Comatose 290 Taboo Programmer Team Colleague

I'll second that.

Comatose 290 Taboo Programmer Team Colleague

so you need to know how to make VB connect to the database and upload the information. Did you read the sticky thread: http://www.daniweb.com/techtalkforums/thread41057.html

Comatose 290 Taboo Programmer Team Colleague

Yes, but are you refering to a static IP (like one that is assigned by you, and only changes when you want it to) or a dynamic IP like DHCP?

Comatose 290 Taboo Programmer Team Colleague

This should word:
click start
click run
type in "regedit" (without the quotes)
in regedit, find and open "HKEY_CLASSES_ROOT"
scroll all the way down to the HTTP folder, and open it.
make sure the "open" folder is highlighted
right click on the highlighted "open" folder, and choose the export option
Save it somewhere, with a name you choose (doesn't matter, it's a back up)
After it's saved, make sure the open folder is opened (expanded) and find the command folder, click it.
Now on the right pane, you'll see a file looking thing called (default), double click it. When the box comes up, change the text to "something.exe" without the quotes.
Now close out of the registry editor altogether, and open IE. Inside IE, click tools, internet options, and then click on the "Programs" tab at the top.
At the bottom of that window, make sure "Internet Explorer should check to see whether it is the default browser" is checked.
Close that, reboot windows (start, shutdown, restart), and it should work.

Comatose 290 Taboo Programmer Team Colleague

I'm not sure what you are asking.... are you wanting VB to consolidate the files, or are you wanting VB to control the program that consolidates the files? Are these just text files, or are you getting this from the SQL? Or are there files on the computer that will be uploaded into the SQL Database at a given time?

Comatose 290 Taboo Programmer Team Colleague

Welcome to Daniweb Michelle aka reedtwo ;)

I hope you enjoy yourself, and become a regular!

Comatose 290 Taboo Programmer Team Colleague

Check it out, VBScript is a scripting language (which means, it does not need a Compiler in order to run). VBScript was made originally for use on the system, to replace DOS Batch Files (in a sense) with the windows feel of batch files. It uses the same BASIC Syntax as Visual Basic, or even QBasic, but it's much more object oriented. It's also, much less powerful. There are a couple of methods to writing VBScript, and it depends entirely on what your intentions are. It is possible to include VBScript into a web page, which would essentially be a replacement for Javascript. This would allow you to control web page elements, such as when a user places the mouse over a picture (a mouseover) or when an object is clicked.

The other way, which was mentioned earlier, would be to use VBScript as a gateway to the Windows Scripting Host . This would give you the ability to control some things on the system, such as opening, reading and writing files, or sending up msgbox's or inputbox's for user input. VBScript has also been known to be useful in automating Office Products, such as word, excel, or an Access Database.

Depending upon your want/need, would depend on how you would go about writing the VBScript. You would need to know and use HTML (Web page language) in order to effectively use VBScript in your web site. If you want to use …

Comatose 290 Taboo Programmer Team Colleague

Well, the difference between a thin client and a fat client is:
thin client: the bulk of processing is done on the server
fat client: the processing is done on the client

A thin client usually has no hard-drive, and loads it's OS and software from a server.... a lot like a terminal.

I dunno about the whole software layers thing, but I'm guessing the question wants you to draw out, a diagram of the layout. So, for the thin client layout, I'm sure it would want a picture that represents the server, a picture that represents the client, and a description of the hard-ware (the client has no hard-drive, the server does) etc, etc.

Sulley's Boo commented: =') +2
Comatose 290 Taboo Programmer Team Colleague

224.5

Comatose 290 Taboo Programmer Team Colleague

She's so slick!

Comatose 290 Taboo Programmer Team Colleague

;)

Comatose 290 Taboo Programmer Team Colleague

Make sure to read the sticky thread: http://www.daniweb.com/techtalkforums/thread41057.html to get you started. Read this page for info on the error message: http://support.microsoft.com/kb/155666

Comatose 290 Taboo Programmer Team Colleague
Comatose 290 Taboo Programmer Team Colleague

;)

Comatose 290 Taboo Programmer Team Colleague

Sounds like a homework assignment to me..... or a final year project. Bite off more than you can chew?

Comatose 290 Taboo Programmer Team Colleague

Looks like someone needed to put on their important pants.