Vb6 How to use a mutex in Visual Basic

I have imported the kernel32 library. So, I have the createMutex function available but I am not quite sure of the various parameters and return values. This is classic Visual Basic, not Visual Basic.NET but I can probably work with either language in the form of an answer.

Why does using Shell to run a .MSI file sometimes fail in VB6?

I am attempting to launch the .NET CF installer from a VB6 app using the following code (for the sake of brevity I have replaced the full path to the installer with "(full path)"): Shell "C:\WINDOWS\system32\msiexec.exe /fa ""(full path)\NETCFSetupv35.msi""" I've run this on four machines so far. On two it works fine, on the other two it fails. When it works, the CF installer just runs. When it fails, the first thing it does is pop up a dialog saying, "The feature you are trying to use is

IsDouble() in VB6?

Is there any IsDouble() function in VB6? If I'm not mistaken, Double data type in VB6 is equivalent to float in SQL Server 2000. Your advice would be much appreciated.

Winsock downloading files - vb6

I'm trying to use Winsock to download some files and save them. In my case, I have a MSHFlexGrid with 2 columns: one with URL and the other with the "path+filename" (where the file is going to be saved). I'm iterating through all rows calling the next function: Public Function DownloadSock(ArqURL As String, ArqDestino As String) As Boolean 'ArqURL is the file URL 'ArqDestino is where the downloaded file is going to be stored, in my hard disc Dim arquivo() As Byte Dim ficheiroID As Integer fic

Vb6 How can I speed up mass-creation of controls at runtime?

I'm stuck with VB6 and I'm using Form.Controls.Add(...) to create a bunch of controls at runtime. Unfortunately this seems to be a very slow process, with heavy flickering. Is there any way to speed up the process? Perhaps it's possible to somehow notify VB6 that I'm doing a mass-insert of new controls.

Vb6 vatab pro 2.0.46 unsetting radio option on tab

I have a vatabpro control version 2.0.46 by Farpoint technologies in VB6 on a form. In the form activate event some code is run to show and hide the certain tabs in the va tab pro control. After this a normal option button on one of the tabs is set to true. When the form is displayed all the radios on the tab are unchecked even though they were explicitly set in code and I can see this happening on a breakpoint. I have a weird feeling i've seen this before and suspect it might be something t

Vb6 Change text characters

i want to replace the alphabets with numbers from a text box and display in the result in another test box.Do not know how to achieve this.Please help. Private Sub Form_Load() txtID.Text = "a s d f" txtSerial.Text = txtID.Text End Sub Private Sub cmdGet_Click() Dim i as Integer fsID = UCase(Replace(txtID.Text, " ", "")) ' Remove all spaces ' For i = 1 To Len(fsID) ch = Mid(fsID, i, 1) ' Decoder ' Next End Su

Compiling legacy VB6 components - make error

OK, so I have the joyous task of writing a command-line build for a bunch of legacy VB6 ActiveX DLLs (so that we can integrate this into our TFS builds). I've installed a copy of VB6 on our build server, and I'm trying, as a first step, to get one of the projects building from the command line thusly: > VB6.EXE /make path\to\project.vbp The result is an error dialog telling me: Unexpected error occurred in code generator or linker. [OK] [Help] Can anyone point me in the direction of a

Vb6 Cannot view code in the object

I'm not sure if this is right, but I can't view the "code behind" in VB6. Everytime I click the "view code" for an object (for example a button), the code does not display. Can you help me with this or any workaround for this? I need to do a breakpoint on this.

Vb6 File and Folder Selector

I want to make a program that does the following: 1) Allow users to select a bunch of files 2) Allow users to select a folder to copy the files into 3) Copy all the files into the specified folder In reality the program needs to do much more than this but that gets the idea across of what I want.

Vb6 SSTab and each tab's child controls

The SSTab does hide/show the child controls by shifting them to/from a negative value. Basically all child controls do have the SSTab control instance as parent HWND. Is there any way to determine the tab index for the child controls - any other than looping the SSTab.Tab property? How does the SSTab instance manage the child controls to tab association?

createObject in VB6 does fails when running exe

I have a VB6 program which tries to run a DLL written in C#. This DLL has a COM interface so I can create an object of a class in it with "CreateObject". The problem is that it runs and works well when I run it from the VB6 IDE, but when I make an EXE and try to run it, it throws the exception: "Automation error. The system cannot find the file specified (-2147024894)." Why is it happening and how can i solve it?

How to debug a VB6 crash?

I have an app that once compiled runs perfectly fine. However, if I start it in VB6 environment, it crashes the IDE constantly and pretty randomly, but only when I take action with the application (e.g. move mouse over it, click on something, move a window, etc...) The application does a lot of things that one does not associate with VB6: SIP, virtual sound card interfaces, audio encoding/decoding, etc...so it could be that, but the crashes seems so random. The crash always occurs in the vba6

Vb6 Disabling a button and saving it after a restart

Just doing a bit of self teaching on visual basic, I have a list of buttons and when clicked I want to disable then and highlight them as red. I am ok on getting the button functions to work and I understand how to publish the gui as an .exe Is it possible to save it so if i click on the button and it turns red and then i close the .exe and open it again the button stays red?

Want to make a directory inaccessible with vb6

I'm working on a program that will disable access to shared folders on a document server if the hard drive is getting close to being full. Currently, I am just renaming them to something different to prevent the app server from being able to send more documents over. I'm wondering if there is a way to somehow lock down a folder programmatically, either setting it to read only, or disable its share status. From what I've seen, changing a folder to read-only directly in windows doesn't prevent

vb6 call form with name contained in array

I have an Array named Menus. It contains a form name per element. How can I call them dynamically? For example, if Menus(1) = "Login", and Menus(2) = "Logout" I need to say Login.Show but I want to do this using the Array name. I clearly can't do this: Menus(X).Show Is this possible in VB or is there a way around this? Thanks in advance!

A solution for unready drives in vb6

I need a better solution for handling unready drives and want to be able to see and change files in my rw-drive. Unfortunately it always gives drive unready error and the only thing that I can do is handle the error. So far I've done this: My Drive: Private Sub imperialdrive_Change() On Error GoTo I_have_a_baad_feeling_about_this imperialdir.Path = RootPathOnDrive(imperialdrive.Drive) Exit Sub I_have_a_baad_feeling_about_this: If Err.Number = 68 Then MsgBox "The selec

Vb6 Tooltip only shows when running from source

I have a hierarchical flexgrid control with the ToolTipText property set, and when I run from source the tooltip displays as it should. But when I compile it and run that way, the tooltip doesn't display. I've tried to remove anything listening to MouseMove in the hopes that that would fix it, and when I add some code to put the tooltip text into a message box, it appears to be set correctly. Can anyone think of why this would be happening? Update: It appears that the problem arises when I h

How can I remove a line of text from a text file in VB6?

Possible Duplicate: How to read a file and write into a text file? I have a search facility where items are displayed in a ListView. These items are read in from a file. When I select an item in the ListView I want to be able to remove it from the text file as well. At the moment, it is is only removed from the ListView but when I search again it still displays so it isn't being deleted from the text file. Basically my program is a list of products with their barcodes and quantities. Th

Run-time error 429 VB6

I'm having a bit of an issue. I'm trying to run this VB6 application that my company uses, but I get the below popup. Now, I've installed VB6 run-time, I've re-registered the vbalTab6.ocx. After some googling, I've even tried installing Microsoft Office and Access, and installing VB6 IDE. All with no joy. Any ideas? Thanks for any and all help.

How to show zoomed out web browser in vb6.0

This is the code am using for zoomed out web browser Const OLECMDID_OPTICAL_ZOOM = 63 Const OLECMDEXECOPT_DONTPROMPTUSER = 2 Web1.ExecWB OLECMDID_OPTICAL_ZOOM, OLECMDEXECOPT_DONTPROMPTUSER, CLng(35), vbNull when i use the code i get the following runtime error: -2147221248 (80040100): Automation Error Any ideas? Edited: I use the code given by you. It works fine in debug mode once i take exe and run it shows the following error.

Activereports (under VB6) issue

I have to modify an old VB6 program that uses ActiveReports 2.0 at work and I am having some problems (BTW I have never used this program before and only have a basic knowledge of VB6)... I have to make some text boxes biggers which is pretty easy to do but as soon as I move them a whole section of text (and not simply the content of that text box) disappear. I have noticed that it was in some sort of section (sorry, I don't know how they call that) which englobed those text boxes so I made i

Vb6 how to export VB project to dll

Is there any way to export VB project to DLL? I just found only way to export VB project (VB6) as .exe file. Please help me if you have experience about that.

Vb6 Publisher could not be verified while opening an exe from UNC path

I am getting the error "Publisher could not be verified. Are you sure you want to run this software" while opening an exe from UNC path. when I am trying to open an exe from UNC path (\abcserver\apps). There were two possible solutions but didn't work as I want. This is an application accessing by 50+ people from the network share. As per the given solutions on the forums, I've added the intranet security to the zone with all options on. (------Open Internet Explorer | Tools | Internet Option

VB6 Store a Decimal Number

I am trying to do a calculation in a function to work out a percentage. However the percentage variable comes out as 0. What am I doing wrong? Public FullLoopNum as Integer Public ReportPercentage As Integer Public ReportRecordNum As Integer Public Function WebOutput ReportRecordNum = 1 FullLoopNum = 4 ReportPercentage = (ReportRecordNum \ FullLoopNum) ReportPercentage = ReportPercentage * 100 End Function

Vb6 How to get a string between 2 known words

My problem is to get a string as described above ! In my case 1234;0020001212;6565656AEBCD698798832 The string,I want is "0020001212" , My known words are ";". I tried Mid() but my value is not stable , variable ! so, please help me to find this answer. Thank y

Vb6 MULTIPLE STEP OLEDB OPERATION GENERATED ERRORS

when i tried to connect to sql database it is giving me the following error MULTIPLE STEP OLEDB OPERATION GENERATED ERRORS MY CODE IS Public Sub connect(sql As String) Security Info=False" con.Open "Provider=Microsoft.SQLSERVER.CE.OLEDB.4.0;Data Source=" & App.Path & " \HMS.sdf;" If rs.State Then rs.Close rs.Open sql, con, adOpenKeyset End Sub

Vb6 Add multiple records in ADO .Net without an iterator

I am working on a legacy ADO .Net code in VB6. The current code iterates through a dictionary and creates a new record for the RecordSet, rs, for each key in the dictionary. This is the current code (rs is a record set): For Each k In dictionary.Keys rs.AddNew rs(field1) = value1 rs(field2) = dictionary(k) rs.Update Next I want to optimize the above code and add the records in a batch. Something like this: Dim fieldOne As New Collection Dim fieldTwo As New Collection Dim

Vb6 exe command not recognised in win32 folder

I have placed a mycmd.exe file in system32 folder under windows directory. Strange thing is that this is accessible from command prompt but when i access this file as a shell command from my VB6 application it shows is "not recognized as an internal or external command" I am running VB project as run as administrator and using win8 64bit. Thanks for the anticipated help!!

Vb6 How could I add events on dynamically-created array of controls?

First of all, I am using VB6, not VB.Net. Now, I am trying to add events on dynamically-created array of controls. But when I try to add the WithEvents keyword to my array of controls, I get a "Compile Error: Expected: As" error. Here's my code: Option Explicit Dim WithEvents btnNumbers() as CommandButton Private Sub Form_Load() ReDim btnNumbers(1 to 10) as CommandButton Dim i as Integer For i = 1 To UBound(btnNumbers) Then Set btnNumbers(i) = Controls.Add("VB.CommandB

VB6 code not running on other machines with "Error in loading DLL" error

I modified my vb6 project to support unicode by using CyberActiveX UniListView100 (UniListView.ocx) controller. I updated my listview with uniListview and project is working well on my machine. But when I try to run it on another machine, it is giving 'Error in Loading DLL' error right after I click on the 'Step into' or 'Start' button. Once I tried with VB Common Controls Replacement 1.4 Library and the similar scenario happened there as well, code is only running on the machine where it crea

VB6 Included Tick Mark in XMLHttp request

I am working on some http requests and have hit a problem, one of the requests uses a tick mark (or "check mark") in the post params and I am struggling in VB6 to create it, it is a JSON post via Xmlhttp : {"utf8":"✓"," When I try to create the post query I am unable to send this character as VB6 see's it as a question mark, hence it does not know what the character is. Just wondered if anybody has come across this and managed to resolve it ? Thanks in advance for any help. Potman

Vb6 Looping through MsFlexGrid rows

I have a question about MsFlexGrid VB6. I have a grid containing coordinates of objects vertices. So for example, if I have 4 objects each one with 3 vertices, the number of rows is 4*3=12. What I would like to do is: Loop through every three rows (the number of vertices) and get the maximum value and then have it appear in a MsgBox and then move to the next three vertices and do the same. Is this possible?

How to make VB6 console application which prints output to the command prompt

I want to make command line VB6 application which prints its result to the command prompt (similar as printf in C). However, none of the found solutions does not work for me. I have VB6 SP6, Windows 7 x64. I tried How to write to a debug console in VB6? to accomodate this, but in this line Public SIn As Scripting.TextStream compiler returns an error: User-defined type not defined Why this is not workin? Is there a way to do it? I would prefer API solution (system independent).

Vb6 Is there any serial communication software for VB 6.0,?

I am compiling a VB 6 code which requires serial communication from ports. For performing serial communication, I need some software tool like SAX Commstudio Active X or MSComm.ocx. But the problem is I have downloaded Sax Commstudio Active X from the commstudio official website, but that was a trial version for 1 day only. then i tried to download the same software from http://visualstudiogallery.msdn.microsoft.com/en-us/ But the link is unavailable. Now I am really in a fix how to get any of

Vb6 visual basic adodc - category - multiple record with the same key

Well i'm trying to create a form in VB6 to control my database that was created by access, i did everything and everything went perfect,until i notice that if you enter the same "ID" i get an erreur from access that there is multiple Ids with the same number,since i activated the primary key in access so it doesn't allow that,so what i'm trying to do is when the user move from the Id cell to other cell,visual basic scan the id cell first and check if there is no other id with the same number,if

  1    2   3   4   5   6  ... 下一页 最后一页 共 17 页