Comatose 290 Taboo Programmer Team Colleague

What version of windows are you using?

Comatose 290 Taboo Programmer Team Colleague

This Thread Should help you get started and get a grip with automating office applications. This thread actually uses VB, not VBA Macros, but the code is pretty much identical, and should be a breeze to do what you need.

Comatose 290 Taboo Programmer Team Colleague

Well, since UDP is connectionless, you are going to have a heck of a time with traditional tools like that. My personal suggestion, is get wireshark, and set the filters to only deal with UDP, and only deal with the ports in question. Then run wireshark, and keep an eye on it.... when data is either sent to or received from the port, wireshark will show it to you, and I believe pretty much in all the layers of the OSI model (at least up to session and down to data-link). At the very least, this can help you see what information is being transmitted on these ports... which should help narrow down WHAT exactly you are dealing with.

Comatose 290 Taboo Programmer Team Colleague

I believe the closest you can come to that is -t or --tolerant, which will be tolerant of errors.... the problem is, yum is built specifically to handle dependencies, so, you might have your best bet going with a tar ball.

Comatose 290 Taboo Programmer Team Colleague

Sure... I'm not sure how you plan to make the program interact with IE to post the bbcode tags and tutorial, but I would start with getting a list of the used BBcode tags, such as [img] and etc. Then get a textbox (multi-line) and have the program generate the text/bbcode and put it into the textbox. This helps you to verify that the program is properly generating the post data, and while you are working toward automating the posting process (which is a huge discussion in and of itself) you can still use it to copy/cut and paste the data into the already opened IE thread.

Comatose 290 Taboo Programmer Team Colleague
Private Sub Form_QueryUnload(Cancel as Integer, UnloadMode as Integer)
if UnloadMode = vbAppWindows then ' // Windows Is Shutting Down
     ' // Instead Of This Stuff, Send Signal To USB Port
     retval = msgbox("Really Shutdown Windows", vbyesno)
     if retval = vbno then
          AbortSystemShutdown vbnullstring ' // Abort Localhost Shutdown
     end if
end if
end sub
Comatose 290 Taboo Programmer Team Colleague

Is There a masked textbox control on there?

Comatose 290 Taboo Programmer Team Colleague

Hmmm... You could consider adding a "Doevents" inside the loop (to force VB to process "other" events during the loop.) If that doesn't work, it's possible that when it connects to the biblio db, that the connection is makes is a blocking call. In which case, your hands are pretty much tied (unless there is a non-blocking connection call).

Comatose 290 Taboo Programmer Team Colleague

Is this supposed to connect to the website automagically, and upload the new post.... or is it supposed to simply Generate something to be copy and pasted into the forum? If the latter, what is "Password" for?

Comatose 290 Taboo Programmer Team Colleague

I'm seeing a number of potential issues here. One of them is that everything takes place over a network. In order for me to be able to proceed with the debug process, I'll need a copy of the database that you are using (though, if you can make a copy and remove the private entries, and put in test entries, it would be cool).

Comatose 290 Taboo Programmer Team Colleague

Not to distract from your original question (ie: how to run commands from perl) but, if accessing a database is what you want to do, why not simply do so directly from Perl, using say.... The DBI Module?

Comatose 290 Taboo Programmer Team Colleague

It ultimately depends on the version of Windows Media Player you are using. For example, scripting/coding for Windows Media Player 9, is vastly different than for 11. One way to figure out how the control works and behaves, is to add the control to the form, and give it a name like WMP. Then in your code, type WMP. (dot) and it will give you a menu of the methods and properties that the WMP control supports. This should help you to see what should be the next logical step in the process for using the control.

Comatose 290 Taboo Programmer Team Colleague

Certainly. The possibility that an API call, for example, that worked in XP was modified to a different datatype or even name under Vista. Ultimately, I'd need to see the code (at least, the portion of the program that craps out) in order to be able to figure out for sure. I would personally install XP in a virtual machine and see if it works normally, if so, you can bet it has to do with Vista.

Comatose 290 Taboo Programmer Team Colleague
rs1.Fields("item_code").Value = Trim(Grd.TextMatrix(Grd.Row, cItemCode) & " ")
rs1!ProductName = Trim(Grd.TextMatrix(Grd.Row, cItemName) & "")
rs1.Fields("maxofunit") = Trim(Grd.TextMatrix(Grd.Row, Grd.Col) & "") rs1.Update

Hmm.. You sure the second line (ie: rs1!.) is supposed to have the !?

Comatose 290 Taboo Programmer Team Colleague

That link doesn't work correctly (the ...'s in the url are pretty much invalid). If you could resend the link to the code, or use http://tinyurl.com/ to make the link smaller so that the site doesn't truncate the data, it would be greatly appreciated.

Coma

Comatose 290 Taboo Programmer Team Colleague

The best solution to this, from what I can tell, is to have one of those fields (ie: attach_file_name) point to a given file in a designated directory. While it is theoretically possible, saving the bits of the image into the database itself is an awful idea. This ties yours hands in the future when you need to make corrections to the data (ie: renewed drivers license).

Let me know if I'm way off track here, or if this seems like something you are looking for.

Coma

Comatose 290 Taboo Programmer Team Colleague

You can access all the files in a directory (you can get a directory list) like so:

' /* Naturally, Change This For Your Path and Files */
retval = dir("c:\windows\*.doc")
while retval <> "" 
     msgbox retval
     retval = dir
wend

Granted, that will simply pop up an annoying msgbox for every .doc file in the folder, but, you get the idea....

Comatose 290 Taboo Programmer Team Colleague

Ok, let's try to tackle this step by step....

1. There are a number of ways to find data within a string. What we really need to know, is the format of these files.... for example, does the file look like this: 1. c:\windows\somefile.txt or does it look like this: c:\windows\somefile.txt, 1 This is important, because the code is going to be different based on how the first file looks inside. In the first example, you could get item number 5 like so (this also solves the last question, because it loops through the entire file):

' /* This Assumes format: 1. c:\path\file.txt */
open "c:\windows\somefile.txt" for input as #1
     do until eof(1)
          line input #1, tmpvar
          if left(tmpvar, 1) = "5" then
               ' /* Do something here with line 5 of the file */
               msgbox "Line 5 is: " & tmpvar
          end if
     loop
close #1

2. There are a couple of ways to go about extracting data from a string.... if you know the layout of the file, it's easy enough to do something like instr, or split. So, let's say that we have a file, and inside it looks like this: error: c:\somefile.txt is a duplicate , we can do some fancy code, that will extract c:\newfile.txt from that line, with split:

' /* Extract Path From Line of File */
open "c:\newfile.txt" for input as #1
     do until eof(1)
          line input #1, tmpvar
          partsarray = split(tmpvar, " ")
          path = partsarray(1)
     loop
close …
jonc commented: A blinding example of working with text files... just had to add rep for it. +1
Comatose 290 Taboo Programmer Team Colleague

Search google for vb6 control blowfish, which is an excellent encryption method. You can use the control to encrypt the files before you burn the disc, and then at runtime, simply have the control decrypt the file to a temp location on the hard-drive (since you probably will have finalized the CD). Then read it normally, and delete it when you are done.

Comatose 290 Taboo Programmer Team Colleague

Well, a batch file (for the biggest part) is nothing more than a list of DOS commands. Don't get me wrong, there is very little, but some support for if statements and parameters, but it's not powerful. If you are just looking to spawn an app using the batch file, that will work..... but you might as well use shellexecute (vb api). What exactly needs to be done?

Comatose 290 Taboo Programmer Team Colleague

I would say so, but I'm biased to Perl/CGI. It ultimately depends on what you are trying to do. When they click submit, what exactly do you want to happen? For some reason, these aren't listed under Tutorials (where they should be) but, nevertheless, I have written a few tutorials covering basic and simple CGI's with Perl, hopefully to let people see it's power....
http://www.daniweb.com/techtalkforums/thread21269.html
http://www.daniweb.com/techtalkforums/thread21279.html
http://www.daniweb.com/techtalkforums/thread21830.html

Comatose 290 Taboo Programmer Team Colleague

:eek:

Comatose 290 Taboo Programmer Team Colleague

Right, if you want to write a setup, you need to know that older windows systems don't come with the VB Run time files (OR any of the dependency files that you decide to include in your project). On newer windows systems (2k and up) VB Run times come along with the windows installation, so, all you need to really do is build the install just like any other project.... I'm not sure how much there is to install at that point (if most everything is already installed).

A Real Good solution is to simply use the package and deployment wizard that comes with VB6.... it will grab all the dependencies, and give you an installer that will work graphically right off the bat.

Comatose 290 Taboo Programmer Team Colleague

http://www.daniweb.com/techtalkforums/thread41057.html is also a good tutorial on ADO. You should do a lot of research into databases, and interfacing Databases with VB before undertaking such a large-scale app.... because there is a lot to know about it.

Comatose 290 Taboo Programmer Team Colleague

well, you can give the file some obscure name, but then anybody who is on the curious side (like myself) will find it..... you can encrypt it, using a control like the blowfish control, or you can make your own cipher.... but any time the password file is accessible it's subject to being cracked (brute force attacks at the very least).

If you can make sure that there is an internet connection on the machines that this CD will be used on, then it's easy enough to make it retrieve the username/password info from a server (which also gives you the power to change the username and password, if you have access to a server). Let me know if I can help.... or if you meant something else altogether.

Comatose 290 Taboo Programmer Team Colleague

How exactly are you drawing the lines? I would suggest looking into API calls on GDI, to speed up your graphic drawing.

Comatose 290 Taboo Programmer Team Colleague

You should check out the sticky post at the top of this forum: http://www.daniweb.com/techtalkforums/thread41057.html, that will give you a good foot hold on dealing with databases from within VB

Comatose 290 Taboo Programmer Team Colleague

If I'm not mistaken, though, harry5341, the mscomm control was obsoleted come (what was it, 2k?) when they removed the API calls for in and out calls of the port..... meaning that it won't work in windows 2k and above. If you are in 98 though, it should work fine.

Comatose 290 Taboo Programmer Team Colleague

Do you want a batch file, or a VB program? Batch files wait for a program to finish before moving to the next line, but I'm not so sure you can use sendkeys, or anything like that with a batch file..... give me some more info, and I'll see what I can do.

Comatose 290 Taboo Programmer Team Colleague

Are you talking about setting processes priority (such as high medium and low) in windows?

Comatose 290 Taboo Programmer Team Colleague

That's Because you have to tell EOF the file handle that you want it to check for EOF of.... for example:

open "c:\autoexec.bat" for input as #1
'  / * do this until eof returns true on handle 1 */
do until eof(1)
     ' /* Read Data From File */
     line input #1, tempvar
loop
Comatose 290 Taboo Programmer Team Colleague

While this method will work, it is not the best way to go about doing it.... creating an object gives your application an infinite amount of control over the excel instance, whereas shelling excel only gives you control over opening it.

Comatose 290 Taboo Programmer Team Colleague

Shell

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

You'll find VB to be pretty slow doing this too, unless you go overboard on speed optimization of strings. If you had it using a database (the dictionary as a database) then you could have it return all words that are starting with the first alpha letter after a space (or something similar), and then gradually filter through the words....

Comatose 290 Taboo Programmer Team Colleague

If I understand what you are asking, you are wanting a program to display a list of all the .dll files currently loaded and in use by each program (this really isn't the forum for that, unless of course you want VB code to do that.)? I wrote a utility (lost the code, but it's taken from the hitman source) that does this. http://www.aftermath.net/~coma/downloads/ and download ModScan.exe, which will load a window with the current processes. If you double click one of the processes, it will expand to a list of the .dll's the process is using. If you are looking to find information about a .dll, google usually does an outstanding job of giving you the proper information about each a file (just type the filename into google).
The app also generates a file on the root of the C drive (I know, I was lazy and hard-coded the path) called tppscan.log, which you can open in your favorite text editor, which contains a list of each running process and it's respective .dll's.

Comatose 290 Taboo Programmer Team Colleague

GreekWord1 EnglishWord1 Notes1
GreekWord2 EnglishWord2 Notes2
, EnglishWord3 Notes3
GreekWord3 EnglishWord4 Notes4
GreekWord4 EnglishWord5 Notes5
. EnglishWord6 Notes6
GreekWord5 EnglishWord7 Notes7
GreekWord6 EnglishWord8 Notes8
? EnglishWord9 Notes9
GreekWord7
GreekWord8
GreekWord9

The above made-up example above may lose its formatting here but I think you will get the drift. Column A has a list of 9 Greek words WITH punctuation in separate cells making a total of 12 cells in column A. Column B & C are the English translation and notes for each Greek word. What I want to do is insert blank cells in Columns B & C to correspond with the punctuation so that the English words and notes properly align with their correct Greek word. I am not a programmer and so my attempt at the macro below does not work.

Sub Macro1()
Dim x As Integer
For x = 1 To 12
If RxC1 = "," Or RxC1 = "." Or RxC1 = "?" Then 'test if punctuation occurs
Range(Cells(x, 2), Cells(x, 3)).Select 'if punctuation occurs select cells in columns 2 & 3 for row in question
Selection.Insert Shift:=xlDown 'insert cells moving all cells down
End If
Next x
End Sub

Part of the problem with the macro, is that you can't insert a variable into an object name like that...... I know that you would expect it to say something like:
if R1C1 = "," …

Comatose 290 Taboo Programmer Team Colleague

I would, but I don't want to have to go through the whole setup and account creation process!!!

Comatose 290 Taboo Programmer Team Colleague

The question I have is, are you actually trying to make a .swf (shock wave flash) file, or are you just trying to make VB MIMIC (act like) a .swf file?

Comatose 290 Taboo Programmer Team Colleague

Yup. VB6 has also the ability to use the "createobject" function for late binding of objects. Which basically means, that any program (including office 2k / 2003) that has a public base class IS ACCESSIBLE from vb6.....

Comatose 290 Taboo Programmer Team Colleague

When my program runs on a machine
with XP sp2 installed and with off 2003 the following goes wrong

In a table in Word f.e.

3 rows

the 1 row is good with the data i presume
row 2 has two sentences the 1 line has the coorect data and the next sentencehas the data what also is in row 1
row 3 has 3 sentences , the 1 line is correct
the next two lines has the data of row 1 and row 3

Somebody knows how to solve this , or how this happen

When i have the same progran running on a Xp sp1 off 2003 pc
everything goes well ?

I'm guessing it has something to do with the way the grid is displaying the data..... but if the file was fine before you installed SP2, and then got intermingled afterward, I wouldn't have any idea why that happened..... are there macro's that run in that file?


I've solved my problem. When I changed regional settings to English (United states) or German everything works OK, but when I set it to something unusual (other language besides English, German, Franch, etc.) I get the error 3011 again.
I hope this can help.

Best regards,
Faik

Thank you for posting the solution to your problem so that others can receive assistance from your experience, the help is always greatly appreciated.

Comatose 290 Taboo Programmer Team Colleague

So you solved it huh? Would you posting your solution?

Comatose 290 Taboo Programmer Team Colleague

You probably can't do it with the excel object..... if the excel object DOES offer security setting attributes, then you'd have to do it with an external script, like a .vbs or an exe.

Comatose 290 Taboo Programmer Team Colleague

How is the macro going to change the security settings, if the settings don't allow macros?

Comatose 290 Taboo Programmer Team Colleague

Doevents will allow windows to do things, such as repaint the progress bar. The timer control makes things fire at a given interval, true, and maybe the thunderdll's will get around to it between interval events, but doevents a good way to make those events happen.

Comatose 290 Taboo Programmer Team Colleague

No, and if there was, we probably wouldn't help you figure it out..... even if your motives are pure, we don't endorse cracking-like code here.

Comatose 290 Taboo Programmer Team Colleague

Not unless the emulator has an API or Object that you can use to hook keystrokes. On it's own, it doesn't offer keyhook abilities. For that, you'll need a full-fledged language. I suppose it would be possible to make some kind of keyhook class, and use createobject within the VBScript to instantiate an instance of a keyhook object, but you'll have to do all the keyhook work from a full language.

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

Rock On!

Comatose 290 Taboo Programmer Team Colleague

There are a lot of possibilities when it comes to this.... first though, since more and more programs are becoming "intelligent", a whole lot of them remember recent files used, so are you looking for a specific MRU (such as for internet explorer, or for the "run" option on the start button)?

Two major solutions are
Pretty Easy:
Just boot the system normally (naturally, if you are concerned that there may be some kind of fail-safe in place or self-destruct code, use the more complicated method, but if you are fairly certain that the system is safe, then you could download something like an MRUViewer [[url]http://www.aftermath.net/~coma/daniweb/mruviewer.zip[/url]]) which allows you to see the IE History, cookies, cache, along with the run MRU.


Complicated:
If you are afraid that the PC which has been taken is equipped to clean up it's mess, or to "self-destruct" when you boot it, then you might want to take this approach.
Assuming that the NTFS drive isn't encrypted, you could boot the PC with a secondary OS from a liveCD (something like Knoppix, PHLAK, or STD). With this in mind, you'll need to be a little bit comfortable using a Unix System, in which you would mount the NTFS hard-drive, and copy the registry files to a portable device, like a floppy, or thumb drive....

If you give me a bit more detail on what you are looking at …