Comatose 290 Taboo Programmer Team Colleague

There are controls for voice recognition with VB6. You have to download these controls. here is a page that has such a control:
http://www.programmersheaven.com/zone15/cat724/
or for using the microsoft voice recognition control:
http://www.martin2k.co.uk/vb6/tips/q3.php

In order to do what you want to do without using a 3rd party tool (which I'm guessing is the case) you'll have to research API calls. The API may not be able to help you, with visual basic, either, since a lot of API calls require the use of pointers, a data type not support with visual basic. You may have to look at coding the IVR backend in a language like C, and then make the front end visual basic. If you don't think your prof would mind, I would use a third party tool.

Comatose 290 Taboo Programmer Team Colleague

I'll do both. Without going into crazy whacky details, a class is basically the base for creating your own objects. In order to do this, you add a "Class Module" to Your VB6 project, and you can build your own object. This object can be anything and do anything... it can have it's own properties, it's own methods, a constructor, and a destructor. In VB you can then instantiate an instance of this class as an object, and use it just like any other object.

and a link:
http://64.233.167.104/search?q=cache:cyfvqLfqL7sJ:www.lexundesigns.com/VB/Examples/Tutorials/Tutorial%2520on%2520VB6%2520Classes%2520and%2520Visual%2520Component%2520Manager/Tutorial%2520on%2520VB6%2520Classes%2520and%2520Visual%2520Component%2520Manager.doc+vb6+class+module+howto&hl=en&start=19

Comatose 290 Taboo Programmer Team Colleague

Ok, Just Make Sure That You Copy The Files PlayMP3.ocx, Playmp3.oca, and PlayMP3.lib into your windows\system32 folder. Then, You can run the .exe from anywhere. I've also included the source code for the mp3 player, so you can modify it/play with it at your own will. Hope this helps you in your endeavor. If you need any further assistance, don't hesitate to ask.

Comatose

Comatose 290 Taboo Programmer Team Colleague

This has been fully commented. I would advise you to change some of the things in it, so that it fits the technique you are using, but, this should be a working copy of what you have been working on.

Comatose 290 Taboo Programmer Team Colleague

There is a way, and I have searched google and hit a few activeX controls that claim to do it.... however, I think you may have to go down to the lowest possible level... and here is the RFC for that: http://www.faqs.org/rfcs/rfc2251.html

The connection string.... I don't know. You'd have to read the RFC and figure it out... it seems fairly complex, however, requiring envelopes and other types of protocol standards.

A Multiple Column Combobox.... I have never seen what, but I'm sure you could use Tab spaces to make the appearance of one. I'll keep researching it... but it doesn't look promising.


I stand corrected, I just found this:
http://support.microsoft.com/default.aspx?scid=kb;en-us;323750

Comatose 290 Taboo Programmer Team Colleague

I'd like to read the requirements. It sounds to me like you could use 1 file for each person that is a record. So, there is a file for rob smith, who lives at 2200 se ave florida.... and another file for robin smithers, who lives at 0022 nw blvd, michigan.... let me see the specifics, and I'll help you out.

Comatose 290 Taboo Programmer Team Colleague

Something you may want to consider is using crystal reports.... I don't like it, but it sounds like it's right up the alley you are walking down. Here is a reference to a code example, using the chart control, though:
http://www.freevbcode.com/ShowCode.asp?ID=1538

Hope this helps.

Comatose 290 Taboo Programmer Team Colleague

What are you doing with the access database? It looks like to me, in your code, that you are mixing access databases with sequential files. Which do you want to use, an access database, or sequential files? You do this for access:

Set db = OpenDatabase(CMDialog1.FileName)

and then this:

OpenFileName = CMDialog1.FileName
Open OpenFileName For Append As #f

What is your ultimate goal? I can help you, but I need to know exactly what you are trying to accomplish.

Comatose 290 Taboo Programmer Team Colleague

Thanx Catweazle, I completely missed that one! :-|

001:

By using the dos prompt, the information that gets display stays on the screen. That's the whole point behind using the dos prompt. The information displayed will stay on the screen. In windows, as soon as you run your perl file, and it finishes, it closes the spawned dos-window that runs the perl file. If you are not very proficient at using DOS, another solution that can be used for testing purposes only is to add a:

$tmpvar = <STDIN>;

Before the program terminates. However, this requires you to hit enter, before the program will quit (if you put it before an exit or die), but it's easy to forget about it being in there... and it isn't really a good method of debugging. The best solution, is to run perl from the command line, passing your program as the parameter.

Comatose 290 Taboo Programmer Team Colleague

Wow... Nice!

Comatose 290 Taboo Programmer Team Colleague

Attached Is How I would do this with a Perl Script. I'm working on doing it in bash shell right now also... but it seems a bit more complicated to me.... maybe I just like the feel of perl better, and so it flows more naturally and easy to me... but I'll keep giving it a go in Shell.

Comatose 290 Taboo Programmer Team Colleague

Well, This isn't the perl forum, so I probably shouldn't have posted that in here (my apologies). In Either language, though, I would read the first file, and compare it to each line of the second file. In perl, I'd read both into arrays, loop through and compare the arrays.

Comatose 290 Taboo Programmer Team Colleague

Sure, you could do that. It just seems like it would be more work in my opinion. Here is the link a sed man page: http://www.rt.com/man/sed.1.html, and a sed tutorial: http://www.selectorweb.com/sed_tutorial.html, and here is info on reading files in Bash: http://www.linuxgazette.com/node/8384.

Comatose 290 Taboo Programmer Team Colleague

I have no idea how you would do that in Shell Scripting. I could do it in Perl fairly easily... but I think that might be a little bit of a task in Shell.

Comatose 290 Taboo Programmer Team Colleague

I would do it when it loads the HTML page to the browser. You can have it do it once it reads it from the form, and have it save it in the file that way, but I like to do most of my formatting on the display side. This gives me the ability to store the data any way I want to.... and then just show it the way the browser wants it.

This is what I would do:

open (GUEST,">$guestbookreal") || die "Can't Open $guestbookreal: $!\n";

for ($i=0;$i<=$SIZE;$i++) {
   $_=$LINES[$i];
   if (/<!--begin-->/) { 

     if ($entry_order eq '1') {
         print GUEST "<!--begin-->\n";
      }
   
     
         print GUEST "$FORM{'realname'}<br>";
      
         print GUEST "$FORM{'username'}";
         

         # /* I Added The Following 2 Lines */
         $story = $FORM{'story'};
         $story =~ s/\n/<BR>/gi;

         # /* I Modified This Line */
         print GUEST "$story";

         print GUEST "<br>\n";
      }
close (GUEST);

I Added Comments where I modifed/added to the script. Let me know your thoughts.

ps: I think you could have left the $story variable out of it, and ran the regex on the hash (associative array), but this allows you to keep the original data read from the file unchanged.... and then must use a new variable for the changes....

Comatose 290 Taboo Programmer Team Colleague

*Just Shakes His Head*

Comatose 290 Taboo Programmer Team Colleague

It's ok, I'm pretty long winded myself!

Welcome to daniweb, and I'm sure you'll be great addition to the community here. Especially if you're coding Perl! :D

What you need to use to solve your problem is called "regex" or "regular expressions". It's very easy to use, but it looks really complicated. Also, regex can be as simple as just matching to see if a string exists within another string, to something as complex as splitting strings into different variables. What you need, to accomplish your task, is called "substitution". Let me give you an example. Say for instance that you have, a variable called $story. This variable will contain paragraphs of data. In order to substitute say \n for <BR>, you could do something like this:

$story =~ s/\n/<BR>/gi;

Let me give you a minor breakdown, without making this a tutorial. $story is your variable, the =~ (without going into bitwise reasoning) says apply the stuff on the right to the variable on the left. You have to tell substitute what variable to work with... =~ is how you do it. The 's' is what lets perl know to use "substitution". The first and second slashes / encase the character to be replaced, and the second and third slashes / encase the character(s) to be replaced with. So, in some kind of english terms, the above regex code would say "use $story, and replace all the \n's with <BR>'s". The 'g' at the end of the …

Comatose 290 Taboo Programmer Team Colleague

:) Nice One.

Comatose 290 Taboo Programmer Team Colleague

Control arrays are a breeze. The tabbed control I think is sp3 of VB6... I could be mistaken, but I think so. Control arrays are nothing more than controls of the same name with a different index. It really makes processing textboxes a lot easier too, so you can do something like:

for I = 0 to textboxname.count -1
     textboxname(I).text = vbnullstring
next I

I'll try it with the tabbed control when I get home (if I remember), but it seems the frame won't work :(

Comatose 290 Taboo Programmer Team Colleague

Yes, If you could give us a more in depth and elaborate description, I'm sure we could be of more help.

Comatose 290 Taboo Programmer Team Colleague

1. With VB5 you can either create an EXE file while you are running VB, or use the separate setupwiz utility to create a .EXE file. The setupwiz way results in a smaller EXE file. Is this the only advantage? Also the setupwiz way results in the program doing something with the registry when your client installs the program. What is this all about?

2. When a program is put on the servers hard disk and then run from a shortcut from another terminal I'm a bit unsure of exactly what happens. Is the program loaded into the terminals RAM, or the Server's RAM? It seems the default place the program put's the files is on the server's hard disk (which is fine). Does this mean the program is in the servers RAM?

Cheers.

Well, creating an EXE with the setupwiz actually goes through to make an entire setup program. With the cute blue screen and the next next next finish buttons. Creating an EXE from within the VB IDE, just makes the EXE, with no dependency files or anything else. Why the EXE is smaller the other way is something I have absolutely no idea how to answer, but I know one is made for installation purposes and one is made for just compiling an EXE.

As for running programs from the server, I'm fairly confident in my resolve to say that the exe gets loaded into the clients (terminal's) ram, and NOT the server. I mean, sure, …

Comatose 290 Taboo Programmer Team Colleague

Well if there is anything else we can help you with, or if you can give us a little more information about exactly what your project does, I'd be glad to help you further. Sorry we couldn't give you an answer that fits your resolve, however.

Comatose 290 Taboo Programmer Team Colleague

One thing I have NOT tried, and I will when I get home from work is to see if you put them in a frame (container) or a tabbed dialog control if it will hold more, since the tabbed dialog control or the frame should be considered the parent.... it might allow for more than 254 per form, but limited to 254 frames or tabs, know what I mean?

Comatose 290 Taboo Programmer Team Colleague
Set objExcel = CreateObject("Excel.Application")
Set objWorkbook = objExcel.Workbooks.Open("C:\PATH2XLS\whatever.xls")
objExcel.Visible = true

Now, you can change between those little tabs at the bottom (sheets) by using:

objExcel.ActiveWorkbook.Sheets(1).Select()

and whatever you do, DO NOT forget to:

set objExcel = nothing
Comatose 290 Taboo Programmer Team Colleague

It works for me ;)

All you should have to do, is modify your sub to contain a doevents, here is the modification:

Sub WaitForMSecs(MSecsVar)
     Dim Starttime As Single
     Starttime = Timer
     Do Until Timer >= Starttime + (MSecsVar / 1000)
          Doevents ' <<--- Added This Line
     Loop
End Sub

Let me know if the doevents fixes your problem. It worked fine on the project I just created and tested.

ps: If you could do me a big favor, and in the future when you post code, add CODE tags around your code. It keeps it formatted and readable. My above post of code is in code tags. IE (with no spaces):

[ CODE ]
Your source code here
[ /CODE ]

:) Thanx in advance.

Comatose 290 Taboo Programmer Team Colleague

You should only need to install the most recent ones. Hang in there with programming in VB, and keep pushing yourself to learn more. Don't feel restricted to VB though... once you get a grip on it, and feel comfortable building apps, move on to something else, like C or Perl. Let me know if my method for loading the word doc works. :)

Comatose 290 Taboo Programmer Team Colleague

I've e-mailed your account, and I think I can help you. Once you return the specifics to me, I will help you with this. I also plan to post the code here, so that others have access to the methods behind how this will work and function...

Comatose 290 Taboo Programmer Team Colleague

I'm not really sure what you mean by showing frames, or what kind of purpose this would serve.... it sounds to me like there will be 3 fames on 1 form. It will start off with showing frame1, 500ms later will show frame2 and hide frame1, then 500ms later, hide 2 and show frame3. At This point it should load a new form, right? Just to clarify, you are talking about the frame control, not frames of an image, right?

Comatose 290 Taboo Programmer Team Colleague

They are whole bunch ocx and dll files that VB uses behind the scenes in order to make the application work. A Few of things include some of the tools that you might use, (some control's) and so forth. Microsoft has or had an EXE that automatically installed the VB runtime files (a cute little setup program), and it was easily downloadable. You could distribute it with your application if you wanted to run a "setup" program, that you had built in VB.

Also, it's a lot easier to use VBS with word. If you know the path to word, you can use shell, but this is much easier:

Dim Word
Set Word = CreateObject("Word.Application")
Set doc = Word.Documents.Add("c:\path2worddoc\somedocument.doc")
Word.Visible = True

That will create a word object, it will add the document of your choice (Given by path in the add method), and then make the word window visible. However, before you make your project close, make certain that you set the references to word and to doc to nothing.... otherwise it will stay loaded, even after your close the document, word and your app. Bad Bad Code. So, in form unload:

set word = nothing
set doc = nothing

That should unload word's process when it's closed. If you really want to use shell, you can, but you have to know the path to word's EXE file, and then you have to pass it the path of the file you want to load. For example, …

Comatose 290 Taboo Programmer Team Colleague

Ok, I realize that writing virus's isn't illegal, but the implications that can come on daniweb because of this post are fairly severe, and it is my opinion that this post be deleted, and the thread locked.

Comatose 290 Taboo Programmer Team Colleague

Hmn. The code looks right. I would try to change it from handling mybase though, to handling the form in question. I'm not sure if that will make a big difference or not, since I don't use .NET, but it would seem to me that the sub should handle keypress event of the form's name.

Comatose 290 Taboo Programmer Team Colleague

Here is Microsoft's Response To Your Question:
http://support.microsoft.com/?kbid=233487

Comatose 290 Taboo Programmer Team Colleague
thedate = Format(Date, "dd/mm/yy")

That line will effectively make the variable "thedate" contain the date in the format you specified :)

Comatose 290 Taboo Programmer Team Colleague

MDI forms are certainly helpful for embedding other forms. Something that a lot of people don't know, is that you can make any window that has an hWnd, the child of another form with a simple API call. So, essentially, even top level windows CAN be MDI, but in practice, this is rude. :)

Comatose 290 Taboo Programmer Team Colleague

The limit is also stillin place on VB6, I have no idea about .net, but I knew for certain that vb6 has that control limit in place (I just clicked about 255 times, on the toolbar to add a button). At button caption 254, I was told it couldn't add any more.

Comatose 290 Taboo Programmer Team Colleague

The only thing that I can think of, is that there has to be something in the registry that holds this information. I mean, VBScript has a method of an object that can get the name of the user currently logged in, but I dunno about retrieving novel's login.... I'll see if I can't find the registry key, but I don't have novel, so it's all google.

Comatose 290 Taboo Programmer Team Colleague

Umn, Thank You.

Here is the updated version of the .pl file, so that they can right click on the link and save as... let me know how this works for you, k? :)

Comatose 290 Taboo Programmer Team Colleague

Well, You could click on start, go to run, type in cmd, and then use the dos interface to run the perl program. You put the #!c:\perl\bin\perl.exe as the very first line in your perl file. I might be confused, but it sounds like you are writing a perl module, and not an actual perl script, because most perl modules end in .pm, or I'm guessing too .ppm. However, if you run the script from the command line, you will see any output that it spits out at you.

Comatose 290 Taboo Programmer Team Colleague

*Yikes*

I'll see what I can do.... let me give you the breakdown of WHY it is this way. The decision then will be yours to make regarding the use of such. The files that the people of the branches want to download (those are in some other folder... like: /var/www/bank/reports/*) Those paths, as far as I know, are NOT accessible to someone surfing the web. In order to make those files accessible, the program copies the file from it's original location, and saves it onto the root of the webserver, but it only does so, AFTER they click the link (the actual HREF of the link, points to the CGI, with the filename as a parameter). When the CGI see's this, (the person clicked a filename) it copies the file to the web server directories, and then redirects the browser to the newly copied file. This was made to aid in security and privacy of those files. However, It is entirely too possible for me to copy all the files to the webserver folders when the links are created, and simply HREF those.... that choice is yours...

Comatose 290 Taboo Programmer Team Colleague

You could post the code, if it's a program with the code. One thing that I like to do is use a dos prompt and try to run the file.... you MIGHT have to load the perl Executable and pass the file as a parameter, something like:

c:\perl\bin\perl.exe myfile.pl

I have it running on my XP box, and I can just double click it, or type the name of the .pl file, as if it were an exe, com or bat. However, the first line of the perl file should be the path to your perl.exe... so:

#!c:\perl\bin\perl.exe

It might be different on your system, I'm not sure, but if none of those solutions work, post your code, and we'll check it out.

Comatose 290 Taboo Programmer Team Colleague

Someone E-mailed Me, Requesting The Source For This, So, Here is the actual script (with modified paths for privacy):

#!/usr/bin/perl

# The Line Above Might Need To Be Changed To Wherever Perl is Located

#################################
# Custom Defined User Variables #
#################################

$logpath = "/home/sites/path2your/logs";
$orgfile1 = "youraccess_log";
$orgfile2 = "cabmirror.youraccess_log";  # Assuming  You Have A Mirror Log

$use_rename = "true";                    # Rename The Original Logfile After The Date is Added?
$use_zip = "true";                       # Use Zip Compression On The Renamed Logfiles?
$remove_original_after_zip = "true";     # Remove The Orignal Logfile AFTER it has been zipped?                              # Or Have a logfile, and a zipped logfile?

###################################
# End of Custom Defined Variables #
###################################

# /* Get The Formated Date For Today */
$today = &get_todays_date;

# /* If We Are Renaming The Original Log File */
if ($use_rename eq "true") {

       # /* Call Sub-Routine To Rename Log File */
       &rename_logfile;

} else {

       # /* Call Sub-Routine To Xerox Log File With New Name */
       &xerox_logfile;
}

# /* If We Are Going To Zip The Log Files */
if ($use_zip eq "true") {
       # /* Call The Sub-Routine To Zip Logfiles of "Today" */
       &zip_logfiles;
}

# /* Stop This Program From Running */
exit;

sub get_todays_date
{
       # /* Get The Current Date (Open As A new Thread) */
       open(DT, "date +\%D |");

               # /* Store The Date In Variable $rawdate, and remove any new line characters */
               chomp($rawdate = <DT>);

       # /* Close The "Date" …
Comatose 290 Taboo Programmer Team Colleague

I'm willing to bet that the protocol mismatch is because you are supposed to be using https, and you are using http, I could be mistaken, so give it a shot and let me know.

Also, you don't need LWP, and if you don't want to have it installed (thought it is extremely handy) you can remove that from your server, along with the line of: use LWP, because it's not required. In fact, make sure that you take out the use LWP::Simple, because not only is not needed, I think it's causing problems on your system.

Also, did you make sure to change all the variables at the top of the script, so that they point to your folders, and https paths? Make those changes, and if there is still problems, attach the .pl file in an e-mail to me.

Comatose 290 Taboo Programmer Team Colleague

To my knowledge... NO. You could do it with Multidimensional array, but trying to do it the way above would never work (not in javascript, anyway). An option to consider, is to create your own object, with a bunch of properties, and then create an array of those objects (I think you can do that in Javascript). Then you can loop through just 1 array, and access any number of properties of the object. So, you make the object to have, say, a "tag" property. Then you create an array of that object, loop through the array, and access the .tag property. I hope I haven't confused more than I Have helped. If so, let me know, and I'll post an example when I get home.

Comatose 290 Taboo Programmer Team Colleague

Thanx For That

Comatose 290 Taboo Programmer Team Colleague

alright, it's done. I'm attaching the perl source code. There is 1 spot that you need to focus some attention to... I have my aliases set up to default over-write anything that I try to copy. So, if I try to copy a file to say /home/coma, and the same filename already exists there, my linux setup will automatically over-write the one that's already there. You need to setup your box's alias for whomever the account is that will be running this script to automatically over-write should the file exist. Anyway, I've attached the mock passfile, and the perl file in a .zip file. Let me know how it goes.

Comatose 290 Taboo Programmer Team Colleague

Fareen,

The code is almost done, actually. There are 2 issues, left however, that I am working on resolving. One of those is setting a session cookie, which shouldn't be any kind of problem, but I still need to code that peice. The other, is having the links to the files work to download them. I can fix that issue also, but I'll need a little bit more time. Also, have you modified the password file to contain the business code at the end of the passfile?

Also, the page is very very plain, that will require your HTML touches to make it work for you and your company, but right now this is what I have:

http://www.aftermath.net/~coma/cgi-bin/business.pl

Username, Password: test test

Comatose 290 Taboo Programmer Team Colleague

(hongule) Korean
chumanayo -->> You're Welcome

Comatose 290 Taboo Programmer Team Colleague

Too Cool. The password file will need minor modification, so that we can associate everyone by their branch. So, I'm thinking that 1 line of the password file should look like this:

username <TAB> password <TAB> branch number

IE:

jsmith     mykidsname     003

I'll assume that the password file will look like this (and will build one for testing purpose on my server), and I'll start building some code for it. I'm only going to do very plain HTML within the Perl Script, but I'll comment it all, and make it very easy to know where you will need to modify in order to make it look .... well, like the rest of the site :) I'll start working on that tonight.

Comatose 290 Taboo Programmer Team Colleague

Ok, Now, Each One of those has a folder under /var/www/bank/reports, so
/var/www/bank/reports/inc/*.* is all the inc files. So, all the inc files are clumped together (003incdate, 004incdate, 005incdate) in the same folder right?

So far so good, we need to find a way now, however, to be able to store the branch with the username, or find a way to associate the two of them. Is The password file already made and already setup? Would it hurt to modify that password file? Otherwise, we can create another file (say branch.txt.pl) that will link the two together. Say, line one of the password file is: jsmith <TAB> Password
then in the branch.txt.pl file, make line 1 003 (or whatever branch jsmith is). Do you understand so far?

Comatose 290 Taboo Programmer Team Colleague

Ok, What do you mean dial-up server? I'm saying this perl program is supposed to be a CGI (all web based) right?

B and C are not yes and no questions. I'm saying that I will need a list of all possible names: inc, sal, and whatever else there is.... I'll also need the directory tree where all these .txt files are stored at.

The Password File, How is it delimited: username:password, by comma's or by tabs? You say plain text, so I'm guessing the password is NOT encrypted also.... having it stored in the CGI bin, is generally a bad idea. If you plan to do that, a good idea is to rename it to password.pl, so that the server thinks it's a program, and if someone tries to surf to it, they will get an error message.

Also, Are you saying that the username is assigned which branch based on their name? If so, is this in the password file? Say: branch:username:password?