User Profile

Collapse

Profile Sidebar

Collapse
tristanlbailey
tristanlbailey
Last Activity: Oct 6 '08, 02:53 AM
Joined: Apr 2 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • tristanlbailey
    replied to progressbar in a project
    Did you look at the link I provided?

    The code in the article should work in VB6.
    See more | Go to post

    Leave a comment:


  • tristanlbailey
    replied to progressbar in a project
    I've just found something that you may be interested in:

    http://vbnet.mvps.org/index.html?code/callback/filebackupcallb ack.htm

    I tried making a simpler version, but it was taking too long. The sample above should be your "cup of tea".
    See more | Go to post

    Leave a comment:


  • tristanlbailey
    replied to progressbar in a project
    Dont' use the code you've found; it's BAD.
    The copy method is repeated 99 times, so it will of course be slow.

    I presume you are using Visual Basic .NET, 2005, or 2008?

    I am currently constructing code for the aforementioned; if you are using something older (i.e. Visual Basic 6 or VBA), please reply promptly.
    See more | Go to post

    Leave a comment:


  • tristanlbailey
    replied to progressbar in a project
    Since your first post wasn't properly typed, I misunderstood.
    It may not have been what you meant, but it's pretty much what you typed.

    I haven't attempted this before, so I don't know if it will work. If it doesn't, you can use the overall structure to work out your own method.

    Create the folder first, so that you have an FSO for it. Enumerate the initial folder's file collection for the total number of files,...
    See more | Go to post

    Leave a comment:


  • tristanlbailey
    replied to progressbar in a project
    The Visual Basic developer environment should offer a progress bar control for you to use. You can get it from the toolbox panel; the same place you got the command button from.
    See more | Go to post

    Leave a comment:


  • I'm still looking for a way of getting the program to pick up the DBT_DEVICEQUERY REMOVE message. I have satisfied the RegisterDeviceN otification function by providing a handle to the USB device, but still can't get the message.

    Here's the updated version:

    Declarations:
    Code:
    Public Declare Function CallWindowProcA Lib "user32" (ByVal lpPrevWndFunc As Long, ByVal hWnd As Long, ByVal Msg As Long, ByVal
    ...
    See more | Go to post

    Leave a comment:


  • Sorry I didn't get back to you quicker; I've been fairly busy over the last few days.

    Have you tried giving an array to the function, and then looping through the array within the function? Using this approach would be much better than the existing one.

    Reply again if you are not sure, and I'll try to provide you with some sample code.
    See more | Go to post

    Leave a comment:


  • Your first post mentions a "ToString" method.
    I don't believe that this exists in VB6, which led me to believe that you were using VB.NET, or at least the code that you were trying to use came from a VB.NET progam.

    We could probably solve this problem a lot quicker if you:

    A: Provided us with the bulk of the code that you are trying to use (or all of it if you are not sure)

    B: Told us...
    See more | Go to post

    Leave a comment:


  • The main Windows Operating System that I use to test programs on is Windows XP. I don't see why this sort of code shouldn't work on Windows XP.

    I plan to use the program on multiple Windows Operating System platform versions (i.e. Windows 98, Me, NT, 2000, etc.), however. I believe all of the necessary API functions exist within each of these versions.
    See more | Go to post

    Leave a comment:


  • Then I presume that the function looks more like this:

    Example:
    Code:
    Public Function RunSP (InputParam1 As String, InputParam2 As String, Optional Var1...)
    If the rest of the parameters have the optional keyword next to them, then you obviously don't need to give them to the function.

    Since the first two parameters are apparently of the "string" type, you need to send two string variables...
    See more | Go to post

    Leave a comment:


  • That's a good idea. I've actually been working on the code for that:

    Declarations:
    [CODE="VB"]
    Public Declare Function CloseHandle Lib "kernel32" (ByVal hObject As Long) As Long
    Public Declare Function CreateFileA Lib "kernel32" (ByVal lpFileName As String, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttri butes As Long, ByVal dwCreationDispo sition As Long,...
    See more | Go to post

    Leave a comment:


  • On the "Public Function RunSP..." line, do any of the InputParams have a type after them?

    For example: InputParam1 As String
    OR InputParam1 As Long

    Usually there is some form of type that is assigned to each parameter in a function. If there isn't, it certainly makes it more difficult to determine which types of variables should be sent to the function as parameters.
    We would need...
    See more | Go to post

    Leave a comment:


  • tristanlbailey
    started a topic USB Device Removal Notifications

    USB Device Removal Notifications

    Hello.

    I'm trying to create a program in Visual Basic 6 that detects when a user is attempting to remove a USB drive, by using the "Safely Remove Hardware" icon on the taskbar. There is supposed to be a message (DBT_DEVICEQUER YREMOVE) that the Windows Operating System broadcasts to applications that are "listening" for it. I'm trying to utilise this message to prevent the removal of the device.

    It...
    See more | Go to post

  • A Standard EXE program will do.
    Remove the form that it puts in automatically for you, and instead add a module (Project > Add Module). Place the previous code I gave you in the module, save the project in the same directory as your clock files, and then try running the program (click the triangular play button).

    Once you are satisfied that the program works, goto "File > Make "your project name"",...
    See more | Go to post

    Leave a comment:


  • Antonopn, I'm not sure if this program would work as a Visual Basic Script. I used Visual Basic 6 to create it, and it works fine with that.

    Do you have Visual Basic 6?
    See more | Go to post

    Leave a comment:


  • Katerina,

    Ha ha, "clock files"... I don't think that this is an actual file type, but it could become one. Anyway;

    In the example I have provided previously, find:
    [CODE=vb]TempStr = Replace(TempStr , ":", ".")[/CODE]
    "TempStr" is the string variable in which you want the replacement text to be stored. Replace is the function in Visual Basic that allows a character...
    See more | Go to post

    Leave a comment:


  • Single clock file?

    Open the clock file in Notepad.
    Goto "Edit" > "Replace".
    In the "Find what" field, type: :
    In the "Replace with" field, type: .
    Click "Replace All".
    In the "Find what" field, type: .3
    In the "Replace with" field, type: .5
    Click "Replace All".
    Goto "File" > "Save"....
    See more | Go to post

    Leave a comment:


  • Although I don't know of the procedure you are trying to call, since there are only two parameters in it, it is probably going to need data sent to both.

    Objects are usually sent to external DLL procedures in the form of a Long data type. This is a variable that holds a unique handle number to the object, which can be retrieved from another DLL procedure.

    How do you know the procedure requires an object? Do you have...
    See more | Go to post

    Leave a comment:


  • [CODE=vb]
    Dim s as string
    Dim s1 as string

    s = "73421482716@bf fsdffhjxyz783dj k"
    s1 = "xyz"

    If InStr(s, s1) Then
    MsgBox("Text Found")
    Else
    MsgBox("Text Not Found")
    End If
    [/CODE]
    See more | Go to post

    Leave a comment:


  • I think I've worked it out...

    For those that are interested in using unicode in a VB6 app, here's some code for you to try out:

    [CODE=vb]
    Option Explicit

    'General Function Declarations
    Private Declare Function CreateWindowEx Lib "user32.dll " Alias "CreateWindowEx A" (ByVal dwExStyle As Long, ByVal lpClassName As String, ByVal lpWindowName As String, ByVal dwStyle As Long,...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...