Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all 21265 articles
Browse latest View live

check version number?

$
0
0
Is there a way for a vb6 application to check the version number of another vb6 application that may be installed on a user computer?

Listview autonumber column

$
0
0
Hello
I have a listview fed from access database.
I want to add a column to my listview in which I set ascending numbers to items displayed on the listview.
And each time I add a new item the Max number is added autmatically.
I want the same as it is done in an autonumber field in access table.
Is that possible?
thank you in advance

how can i use the GDIPLUS?

Sudoku Grid | Textbox & 2-D Arrays

$
0
0
Hello everyone

For my computing science project I decided to make Sudoku but I'm having an issue with a certain algorithm.

Currently in one of my forms I have a grid of size 8x5 (Will be increased to 8x9 but need to first get some sort of algorithm going).

I'm having trouble thinking of an algorithm which will do a comparison between two 2-D arrays, one array will hold the correct values for each cell in the grid (hence the position). The second array will store the values submitted by the user.

The grid is made up of textboxes, starting at txt00 and the next being txt01 and so on.

Is there a way of assigning every textbox to its position in the 2-D Array? Below you'll find what I have so far for my code but I'm stuck on how to proceed.

Private Sub cmdCheck_Click() 'Will do a check when the user clicks on the button

Dim Row As Integer
Dim Column As Integer
Dim GridValues(7, 4) As Integer 'Stores all the correct values in the grid
Dim UserGuess(7, 4) As Integer 'Stores the entered values of each textbox



For Row = 0 To 7
For Column = 0 To 4

Next Column
Next Row

End Sub
____________

Is there a way of doing a loop instead of assigning each textbox 1 by 1 to a position in the 2-D array?

Thank you for reading

[RESOLVED] Batch file, pause, makes me hit 'Enter' twice

$
0
0
I'll justify this as a VB6 question by saying that 99% of my batch files are related to VB6, such as compiling, uploading, etc.

For a while now, my batch files have made me hit 'Enter' twice before continuing from a @pause command. Anyone have any ideas what's going on here?

Thanks,
Elroy

[RESOLVED] VB6, ActiveX DLLs, and memory usage

$
0
0
Something I've never been entirely clear on is why we're limited to 2 gig. As we all know, VB6 uses Longs for memory pointers, and, when treated as an unsigned integers (as they always are when used as memory pointers), these Longs can address precisely 4 gig of memory.

I'm guessing it has something to do with the sign bit being used in certain circumstances, even when being used as a memory pointer, but a clear explanation on this would be appreciated.

Alright, next related question. When using an in-process ActiveX DLL, do we then potentially get access to 4 gig? I'm sure that each component (the main program and then any DLL) would individually be restricted to 2 gig. But it seems like the entire 4 gig would be available in these circumstances.

Does anyone have definitive answers about this?

Regards,
Elroy

[RESOLVED] Difference between two dates

$
0
0
Hello VBForums
Hello everyone
Please if you can help me to resolve this problem
How to calculate the difference between two dates
First date in Text1
Second date in Text2
The result in Text3 by years ans month and days for example ( 25 years 10 months 14 days )
Thank you in advance for help me
Cordially
MADA

[RESOLVED] Keys Management for Grid's Rows

$
0
0
I have applied a KeyManager for a Grid Control. But if the Grid loads millions of records, the Key management is obviously lagging or killing the whole system when I set .KeyIsUnique = True. The concept of Key management is:
SetRowKey function --> Calculate .Hash of Key --> increase Keys() array (Type member: .Hash and .Index) by 1 --> BinarySearch the right Position (actually Sort in ASC)--> insert to the Pos

0 -843663419 4
1 -843597883 3
2 -843532347 2
3 -843466811 1
4 -843401275 0
5 -788455970 5

I noticed the binarySearch is the major reason caused lagging.
Imaging the millions size of Keys(), the BinarySearch for single Key could loop thousands of times. If we add one million Key at one time, the CPU is too busy to lost response.

Code:

For n = 1 To 1000000 
    Grid1.Row(n).Key = "Row" & CStr(n)  'call SetRowKey function
Next

I check some commercial Grid control, they also had such problem. It seems no solution. But what is the better way to apply Key management?

[RESOLVED] Listview autonumber column

$
0
0
Hello
I have a listview fed from access database.
I want to add a column to my listview in which I set ascending numbers to items displayed on the listview.
And each time I add a new item the Max number is added autmatically.
I want the same as it is done in an autonumber field in access table.
Is that possible?
thank you in advance

Drag & Drop | Mouse Lag(?)

$
0
0
Hello everyone

Currently working on my project for school but I'm getting this annoying form of mouse lag when I'm dragging controls on the grid, the outline of the object just lags behind my mouse and is incredibly slow.

Another issue is that when I select multiple objects on the grid it starts individually selecting them one at a time until all are selected. This is proving to be very frustrating in designing my interface for the program.

Anyone know why this is happening and how I can fix it?

Thank you

Snowy

Multiple control OCX giving version trouble despite using Binary Compatibility

$
0
0
I have an ocx, let's call it IHateThisThing.ocx, and inside are 2 user controls: ThisOneSucks.ctl and Golden.ctl.

Someone else wrote this originally, but I needed to make a change to Golden.ctl. I needed to change one "InStr" to "InStrRev" and that was it. Done, no problem. Compiled great, using Binary Compatibility matched to the existing ocx that is in production, deployed it and it worked. The problem, however, is when someone tries to do anything that uses ThisOneSucks.ctl, they now get an error message that says "Failed to activate control 'VB.UserControl'. This control may be incompatible with your application. Make sure you are using the version of the control the was provided with your application." To clarify, it does actually say "VB.UserControl" and not "IHateThisThing.ThisOneSucks" as I would expect.

The two things I made sure happened are:
1. Used Binary Compatibility and no warning message was displayed
2. Checked the .VBL file that was generated when the ocx was compiled, the ClsID and the license matched the previous build

I took these same steps when I updated ThingsAreGood.ocx, EverythingIsFine.ocx, and GreatSuccess.ocx, but they only had 1 user control inside. I haven't updated any others that have more than 1 user control so I don't know if it's specific to ThisOneSucks.ctl or if the problem stems from having multiple controls.

I assumed that using Binary Compatibility should have prevented this from happening. In the main project, the controls are used via CreateObject and are not referenced (late binding).

I'm hoping to not need to restart the "compatibility trail" because the main project has the license string hardcoded. I inherited this project from someone that left the company and the production executable is older than the code last checked into SourceSafe so we don't even know what code is compiled into the executable. We're also working on a rewrite so we don't want to spend too much time on the current production version but we do need to be able to push out this change for IHateThisThing.ocx. I do plan to create a setup package and try un/reinstalling over the next 5 days our building is closed, but I don't expect anything to come from that. The posts I've read on the internet for the past week of searching have all said to re-register the ocx (done), reinstall (doing in the next 5 days), and reset the compatibility and start from scratch (can of worms due to main executable).

Any additional advice is appreciated.

Do you develop new database apps in vb6?

$
0
0
Hello guys and girls,

I'm curious, do you develop new database applications in Visual Basic 6.0 (vb6).

If you want, please tell why.

:wave:

Replace statement

$
0
0
I have a string (strxml) which contains "encoding="utf-16" which I want to strip out

I have tried Replace(strxml, "encoding="utf-16", "") but this fails. I think its because of the quotes around utf-16

popup menu

$
0
0
I have vesta operating system on my pc when I tried to make an popup menu in form by vb6 i'm not find arabic font and when I tried to write by arabic letter it's apear like "ÔÑßÉ ÌÑíä áÇíÊ áÊÌÇÑÉ ÇáÇÏæÇÊ ÇáßåÑÈÇÆíå."

how can I solve it

thank's

Move UDT with many dynamic sng arrays to similar UDT w dbl arrays

$
0
0
I can certainly do this, but I'm wondering if anyone has any "tricks" I'm overlooking.

Also, as an FYI, the arrays will either be dimensioned as (1 to 51) or not dimensioned. I currently do it with loops, but I'm wondering if there's a better way.

Code:


Option Explicit

Public Type SingleVersion
    HipFlexExtMoment() As Single
    HipAbAdductMoment() As Single
    HipRotationMoment() As Single
    KneeFlexExtMoment() As Single
    KneeValgVarMoment() As Single
    KneeRotationMoment() As Single
    DorsiPlanFlexMoment() As Single
    FootAbAdductMoment() As Single
    FootRotationMoment() As Single
End Type

Public Type DoubleVersion
    HipFlexExtMoment() As Double
    HipAbAdductMoment() As Double
    HipRotationMoment() As Double
    KneeFlexExtMoment() As Double
    KneeValgVarMoment() As Double
    KneeRotationMoment() As Double
    DorsiPlanFlexMoment() As Double
    FootAbAdductMoment() As Double
    FootRotationMoment() As Double
End Type

Sub Test()
    Dim sv As SingleVersion
    Dim dv As DoubleVersion

    ' Do stuff to sv that puts data in it.


    ' Now, I want to move sv to dv.
    ' This is my question. <-----------------



End Sub

In many ways, I guess the question boils down to whether there's a "trick" in getting a Single dynamic array into a Double dynamic array. And then, if that "trick" or another "trick" can be expanded to the entire UDT.

Elroy

EDIT1: Just FYI, I've only given you a piece of the entire UDTs.

What to learn? A level lower than WinHttpRequest

$
0
0
I have been using WinHttpRequest for some time. As far as I know, WinHttpRequest stores cookies automatically, one doesn't have to do anything about it. However, what if now I want to set out to do it myself and have more control over what data is sent and what data is received, and how they are processed?

Last day of month ...

$
0
0
I have VarMonth=1, and VarYear=2016

how to calculate the last day of this 2 var?

in this case VarLastDay=31/01/2016

Caret Position

$
0
0
Hello All,:wave:

Somebody please help me as I need some help in Visual Basic 6.0 coding.

The problem is, I have created a textbox with a custom caret. But at present, the position of the caret is at the top and above the letters or characters as seen in the image below.
Name:  Cursor.jpg
Views: 7
Size:  13.4 KB

I want it to be at the bottom of the letters or characters similar to what we have in a Command Prompt Window. My code is as follows. I have used API functions.

Code:

Private Declare Function CreateCaret Lib "user32" (ByVal hwnd As Long, ByVal hBitmap As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function ShowCaret Lib "user32" (ByVal hwnd As Long) As Long


Private Sub Text1_GotFocus()
    Call CreateCaret(Text1.hwnd, 0, 16, 1)
    Call ShowCaret(Text1.hwnd)
End Sub

Somebody please reply with code in visual basic 6.0...

Thanks in advance...
Attached Images
 

Backcolor in statusbar panel

$
0
0
Hi all,

I know there is no such property for a single panel in a statusbar.
But I need to have a panel for which I can set certain colors.
Also it must display text.

I tried this:
Having a picture, the text printed into it, and then set as panel.picture.
The panel.text itself is empty.
Problem:
I can't find out the height of the panel to adjust the picture height.
There is only the .left property.
Of course I need to know this to print the text on the correct position...

Any better ideas?

Karl

P.S.: I use Krool's Common Control Replacement.

Sudoku Project | Grid Number Generation Algorithm

$
0
0
Hello everyone

Currently working on my Sudoku program, I'm using a control array for 81 textboxes and I was wondering if there is a simplistic algorithm that will generate numbers on the grid depending on the difficulty.

For example:

-Easy: Large amount of numbers generated

-Medium: Typical amount of numbers generated in a Sudoku puzzle

-Hard: Fewer numbers generated on the grid

The numbers generated need to be correct so the puzzle can be solved. Anyway of doing this?

Thanks
Viewing all 21265 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>