Comatose 290 Taboo Programmer Team Colleague

Hmn, I've had a similar experience, but I found I was able to rename the Shortcut by searching for the text in the registry, and then renaming the REG_SZ. The ClassID (long goofy numbers and letters) will likely be different on your machine, but on my XP home the key/value was found here: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CLSID\{871C5380-42A0-1069-A2EA-08002B30309D}, and simply renaming the (Default) Value To My desired text worked.....

Comatose 290 Taboo Programmer Team Colleague

Yeah, We aren't going to do your work for you..... if you need help, that's one thing.

Comatose 290 Taboo Programmer Team Colleague

Maybe he means build a POS (Point of Sale) Register, Something for teachers to keep track of student's grades, and averages, or something for a hospital, where patience sign in, receive medical care (which gets documented into the DB) and gets discharged....

Comatose 290 Taboo Programmer Team Colleague

A Timer is a control, just like a button, or an option button or some other fun little tool.... here is a little article: http://www.vbdotnetheaven.com/Code/Jun2003/2084.asp You can have it run a function at set intervals....

Comatose 290 Taboo Programmer Team Colleague

Are you sure there is no macro, formula, or function that is forcing the cell to behave this way in the template? Another solution, is to force the change by using "format" on the cell AFTER the paste operation...

Comatose 290 Taboo Programmer Team Colleague

The SetWindowRgn API is the key to this.... check this site: http://www.thescarms.com/vbasic/IrregularForms.asp

Comatose 290 Taboo Programmer Team Colleague
#!/usr/bin/perl

while ($uinput ne "quit") {
        print "# "; $uinput = <>;

        chomp($uinput);

        if ($uinput eq "ls") {
                open(LS, "ls -AF1 |");
                        while (<LS>) {
                                chomp;
                                push @flist, $_;
                        }
                close(LS);

                foreach $file (@flist) {
                        print "$file\n";
                }
        }
}
crestaldin commented: great ! This post has given me a valuable piece of information that I've been trying to get ...Thanks a lot +2
Comatose 290 Taboo Programmer Team Colleague

*Wipes his forehead*

ehem: http://www.netlingo.com/emailsh.cfm

Comatose 290 Taboo Programmer Team Colleague

Is this in XP (there has a been a few threads going around about problems with reading/writing serial ports in XP with VB). Also, I'm not sure if the output is supposed to be a string, or if it's supposed to be those values in hex.....

Comatose 290 Taboo Programmer Team Colleague

How, exactly, do you want to present the differences to the user? By, like, a string position (character 3 of file A and character 3 of B are different)? I can figure out how to pull this off if I know how you want to lay it out....

Comatose 290 Taboo Programmer Team Colleague

This was a bit of a toughy for me...

The If Statement will never be true (it will always run the else) because the trim function returns a string. Period. (Actually, that's only partly true, it returns a Variant of subtype String, but for all intents and purposes, it's a string). Since it returns a string, isnull will never return true, because even if there is nothing in the passed value, trim will then return an empty string (not a null string) and therefore, won't be null.... so, I figured I'd remove the trim statement. Still wouldn't return true for me.... then I realized that you declare the variable in the header of the function as a string.... which, automagically (when created) makes it an empty string. Even if you pass it a null value.

The final solution I found (after trying a myriad of other things) was to change the type declaration to a variant in the function header, and to pass it "null" (not vbnullstring (which is a string), and not vbnull (which is a long)). This successfully returned a true from that if block. Here is how I modified the code:

Public Function Field2Str(strValue As Variant) As String
  If IsNull(strValue) Then
      Field2Str = " "
    Else
     Field2Str = Trim(strValue)
  End If
End Function

and I called it like this retval = Field2Str(Null) . I'd also like to point out that your function doesn't return an empty sting if the value is null, it actually …

Comatose 290 Taboo Programmer Team Colleague

When you make a VB project, it has a bunch of files with it. So, in order to make sure we do this right.... make a new folder (on the desktop for simplicity), open the project in VB, click the file menu, click "save as", and change the folder list in that new window to the new folder you made, and click ok, or save, or whatever the button is.... once you save the project (it should save all the files with it) in the new folder, close out of VB, and find the new folder. Right Click on it, and choose "send to", and then click "Compressed (Zipped) Folder". It will make a file with the same name as the folder, but it will kinda look like a vice (this is assuming that you have windows XP). Attach that to the post.

Comatose 290 Taboo Programmer Team Colleague

Is this a homework assignment? If so, how much do you have coded already?

Comatose 290 Taboo Programmer Team Colleague
For Each ctrl In Controls
    If TypeOf ctrl Is Menu Then
         msgbox ctrl.name & " is a Menu!"
    End If
Next ctrl
Comatose 290 Taboo Programmer Team Colleague

hmn:

for each XFrm in forms
     unload XFrm
next XFrm

?

Comatose 290 Taboo Programmer Team Colleague

Can you tell us what the solution was?

Comatose 290 Taboo Programmer Team Colleague

you could even do those steps in a VB app by itself (although, I don't see the point when the batch file works just fine). You could also make the vb app mess with services using the API

Public Declare Function OpenService Lib "advapi32.dll" Alias "OpenServiceA" (ByVal hSCManager As Long, ByVal lpServiceName As String, ByVal dwDesiredAccess As Long) As Long
Public Declare Function StartService Lib "advapi32.dll" Alias "StartServiceA" (ByVal hService As Long, ByVal dwNumServiceArgs As Long, ByVal lpServiceArgVectors As Long) As Long
Public Declare Function ControlService Lib "advapi32.dll" (ByVal hService As Long, ByVal dwControl As Long, lpServiceStatus As SERVICE_STATUS) As Long
Public Declare Function EnumDependentServices Lib "advapi32.dll" Alias "EnumDependentServicesA" (ByVal hService As Long, ByVal dwServiceState As Long, lpServices As ENUM_SERVICE_STATUS, ByVal cbBufSize As Long, pcbBytesNeeded As Long, lpServicesReturned As Long) As Long

Public Declare Function OpenSCManager Lib "advapi32.dll" Alias "OpenSCManagerA" (ByVal lpMachineName As String, ByVal lpDatabaseName As String, ByVal dwDesiredAccess As Long) As Long
Public Declare Function EnumServicesStatus Lib "advapi32.dll" Alias "EnumServicesStatusA" (ByVal hSCManager As Long, ByVal dwServiceType As Long, ByVal dwServiceState As Long, lpServices As Any, ByVal cbBufSize As Long, pcbBytesNeeded As Long, lpServicesReturned As Long, lpResumeHandle As Long) As Long
Public Declare Function CloseServiceHandle Lib "advapi32.dll" (ByVal hSCObject As Long) As Long

but I think the batch file is an easier, and more effecient way to go.

Comatose 290 Taboo Programmer Team Colleague

Yeah, I'm not sure that the batch file is properly reading the data. A Simple test here (test.bat):

@echo off
echo %1
echo %2

and then the command line test.bat testing1 test2 produce the result of both parameters passed. Are you trying just to have the .bat file run, or are you trying to have it display the contents in a DOS window (which disappears when the app is done with it)?

Comatose 290 Taboo Programmer Team Colleague

Well said, beyond that you could also use the bitblt API call, with device contexts (which, is how making Video games with just VB and API is done). I don't suggest building an app that relies on GDI+, since it's added overhead, and possibly an install requirement for the user using the application, but you are very limited to working with JPEGs in VB6. The bitblt API call will be much faster in processing the images, but chances are you are not going to notice a difference either way.... since delving into the API can become a fairly complex playground, I suggest the code above.

Comatose 290 Taboo Programmer Team Colleague

Beat me too it.... Good job on that solution.

Comatose 290 Taboo Programmer Team Colleague

I'm not 100% sure I know what you are asking.... if I'm missing the mark completely, let me know.... are you looking for an "elseif" type command?

Comatose 290 Taboo Programmer Team Colleague

Not likely. You need much lower level access to hardware than VB can even possibly begin to imagine providing. However, VB is always a great front end to another language.... so write the dirty work in C, and have VB shell it's code...

Comatose 290 Taboo Programmer Team Colleague

hmn.... are you talking about the z-order?

Comatose 290 Taboo Programmer Team Colleague

If you can post the document, (strip it down if necessary) so I can see what is happening (I understand the problem, but can't seem to recreate it), I'll see what I can do.

Comatose 290 Taboo Programmer Team Colleague

If all the templates are (or, if you can make them) stored in the same directory (in the same folder), then you could make VBA gather a list of all the template files in the folder, and display that in a listbox (this would require some redesign, so that you would no longer need/use the explorer in a specific folder). Then, allow the user to select an item in the listbox (a filename) and do whatever you'd like with it....... that's about the closest you can get to it....

Comatose 290 Taboo Programmer Team Colleague

The code you found is for VB6, not VBA. The VB Editor INSIDE of office (excel, word, etc) is VBA (Visual Basic For Applications) which is a stripped down version of actual visual basic. It lacks some major functionality required to be a full-fledged programming language. As far as I can tell, the user forms in VBA don't offer the kind of control for dragging and dropping files from explorer. Visual Basic 6 DOES offer this, but that doesn't help you at all with your problem in VBA. It doesn't even seem like it will allow us to create a drivelist or filelist box control with early or late binding in VBA..... The only way I would imagine doing it, would be with a full-fledged VB app, and having that App use the word document as a backend...

Comatose 290 Taboo Programmer Team Colleague

There really isn't one..... without looking at your project, I couldn't tell you. You'll need to reset all your variables, and all your forms objects, but there is no magic quick reset button.

Comatose 290 Taboo Programmer Team Colleague

I haven't found a strictly OS solution, but a very, very, very small script program (3 lines of code, actually) can overcome this problem. If you build a .vbs file (VbScript file, that runs using WSH [Windows Scripting Host]) you can have it execute a program, and set it's window style to hidden.... just follow these steps:
1) launch notepad
2) Enter The Code Below, Changing The Third Line So It Is The Path To Your cmd file.
3) Click file, save as.
4) Change "Save As Type:" to "All Files"
5) Name the file whatever you want (and save it wherever you want) but make sure you end the name with .vbs

Just remember to change the last line of code, where it says "c:\runme.bat" to whatever the path and filename is of your .cmd file. Here is the code I have:

dim Wsh
set Wsh = WScript.createobject("WScript.Shell")
wsh.run "c:\runme.bat", 0, 0

EDIT: Truth be told, you could probably completely remove the .cmd file, and do everything you do in it, in the .vbs file, and that too would solve the window opening problem.

Comatose 290 Taboo Programmer Team Colleague

The biggest problem I find Scott, is graphic artists. I can write code, that isn't the hard part..... the hard part is getting people who can draw on the computer and/or import their pictures to an electronic file.... remember, sprites are a lot like a flip-book, and even rendering requires graphics in order to work. I've built games, but without a team of graphic artists, it's only a piece of code with moving pictures....

Comatose 290 Taboo Programmer Team Colleague

Thanks for posting the solution, so that others know how to fix similar problems.

Comatose 290 Taboo Programmer Team Colleague

None that I know of.... in fact, to my knowledge, I haven't found VB code that will save a picturebox to a jpg.... all the methods I know of, save the files as bitmaps. I can tell you how to put all the pictures in 1 picturebox, and I can tell you how to save that picture to a .bmp file.... but that doesn't do you any good. Now, I have found this class, but I've never used it before, and it claims to work: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=50065&lngWId=1.

Comatose 290 Taboo Programmer Team Colleague

Let strsql = "SELECT * from bids where bidno ='" & temp & "'" is not the solution, try something like: strsql = "SELECT * from bids where bidno = " & chr(34) & chr(34) & temp & chr(34) & "'" & chr(34) EDIT: Nevermind, I totally missed the mark on that one! :eek: try something like this (I don't know what bidno is supposed to be, either an integer, or a long, or a double, or what): Let strsql = "SELECT * from bids where bidno ='" & cint(temp) & "'"

Comatose 290 Taboo Programmer Team Colleague

Which version of VB are you using firstly? Is it VB6? Also, what is webform.vb? Is it a project file that you made in visual basic?

Comatose 290 Taboo Programmer Team Colleague

Like, by having all the images side by side? If you can give me a better description, I can see what I can do.

Comatose 290 Taboo Programmer Team Colleague

Can you please explain more what you mean about cpu scheduling?

Comatose 290 Taboo Programmer Team Colleague

The method you are using is incorrect. By using the shapes collection, and then accessing the Select function, makes it the same as if you hold down shift and click a control. It just highlights the control, as if it were text, or a cell, or some other object. In order to actually check one of the box, you need to access it directly, using the .value property, as such:

ActiveSheet.CheckBox6.Value = 1
ActiveSheet.CheckBox7.Value = 1
ActiveSheet.CheckBox3.Value = 1

Something important to note here, is that you use boolean logic to represent the check mark... for example, replacing the = 1 to = 0 would take the check mark out of the box....

Comatose 290 Taboo Programmer Team Colleague

The macro is stored/saved inside of the excel document. He might have macro's disabled (or may not trust you, so wouldn't run your macro), in which case it wouldn't load it..... but the macro is saved in the file.... so if you attach the .xls document to a post here, we can download it and see what it's doing....

Comatose 290 Taboo Programmer Team Colleague

I might not understand you completely, but if you are asking what I think you are asking, setting a global variable should work among all forms. I just want to make sure that you are using VB6, and not VB.Net or VB express..... Because I don't believe VB6 has a GlobalFunctions Object.

Comatose 290 Taboo Programmer Team Colleague

If you post the macro code, we can help you out a little bit more.

Comatose 290 Taboo Programmer Team Colleague

I want to give a thumbs up to Yomet here.... Keep up the good work.

Comatose 290 Taboo Programmer Team Colleague

hmn, You could try something like:

if me.visible = true then
    ' /* Do Stuff To Read The Port */
    doevents
end if
Comatose 290 Taboo Programmer Team Colleague

I believe destroy is a method available in *nix too.

Comatose 290 Taboo Programmer Team Colleague

In the code I posted, retval (the variable) will be blank if the user pressed cancel. Hence the code:

if retval = "" then 
    ' /* Cancel Pushed, Or Left Blank */
    msgbox "You Entered Nothing..."
Comatose 290 Taboo Programmer Team Colleague

Well, you can redesign the windows interface with VB, sure. You can not, and I'll say this again, for good measure, you CAN NOT build an OS with VB. In order to build an OS, it requires low level hardware access (to the processor, to RAM, file management, etc). If you want to replace explorer.exe, you can do that, but a better solution, is to have your VB app actually terminate explorer.exe, and load everything yourself. Keep in mind, when you write your own "shell", you won't have a system tray, a taskbar, a desktop (no start button). Your app has to supply it all. There is a program, bb4win, which does this.

Comatose 290 Taboo Programmer Team Colleague

I would ensure that you have the vbruntime files updated. Date is an internal VB command, so there should be no issues with it.

Comatose 290 Taboo Programmer Team Colleague
retval = inputbox("type stuff")
if retval = "" then 
    ' /* Cancel Pushed, Or Left Blank */
    msgbox "You Entered Nothing..."
else
    ' /* They Typed Stuff */
    msgbox retval
end if
Comatose 290 Taboo Programmer Team Colleague

Hmn, that seems pretty strange.

Comatose 290 Taboo Programmer Team Colleague

Can you define which ones should be removed? Anything that is not:
2005/11/11 17:50:58, Event:Access, Door:entry, Card No.:2345, Description:266:55732
Right?

Comatose 290 Taboo Programmer Team Colleague

Cool! Thanks for posting the solution.

Comatose 290 Taboo Programmer Team Colleague

How are you going to decide which row? The user has a listbox, and the listbox has all this same information? Will they be deleting the row date, time, cardno or description?