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

installers

$
0
0
I downloaded a program called ActualInstaller and wondering if anyone uses it versus the vb6 packager? From what i understand, its not necessary to include vb runtime files with a setup file. True or false??

With the vb6 packager, you must zip the setup file and cab file and LST file for the user to download. It would be nice if they could just download a setup EXE file and not have to bother with unzipping, then running an install.

100% processor usage

$
0
0
Hi Guys.

The program I use for edition models is very CPU hungry, and when it's running normally uses 100% of the processor, running the fan at full tilt.

I looked for various fixes, and the easiest way of slowing the program down was to add a timer, so the program refreshed every 1/2 second or so.

The code I've added sorta works, but the program only refreshes when you click on the main screen, so there is something wrong with my code.

Timer added to main form:

Code:

'New timer added JG 26/3/16
Private Sub Timer1_Timer()
Timer1.Enabled = False
End Sub

Main loop which is the root of the CPU usage problem:
Code:

' MAIN LOOP
Public Sub Main()
'    Timer1.Enabled = True
    ' Create Objects
    Set Graphics = New OGL_Graphics
    Set LoadedModel = New model
   
    ' Load config file
    LoadOptions
   
    ' Initialise all the OpenGL stuff
    ViewType = VIEW_PERSPECTIVE
    Graphics.bRunning = Graphics.Initialise(frm_main.pic_render.hdc)
    frm_main.Show
    SetForegroundWindow frm_main.hWnd
    DoRecentFiles
    frm_main.SetFocus
    'Old code replaced with below JG 26/3/16
    'Do While Graphics.bRunning
    '  Render          ' Update the frame
      '  DoEvents        ' Let Windows Think
    'Loop
   
    ' Finished...Clean Up & Exit
    'Set LoadedModel = Nothing
    'Graphics.CleanUp
    'Unload frm_main
    'End
'New code starts here:

    If Graphics.bRunning Then
       
        Render          ' Update the frame
    Else
    'Finished...Clean Up & Exit
    'Timer1.Enabled = False
    Set LoadedModel = Nothing
    Graphics.CleanUp
    Unload frm_main
    End
End If
   
   
End Sub

I've tried to activate the timer, but when I do, I get a compile error, so I'm doing something wrong.

[RESOLVED] Are all Zip tools compatable with each other?

$
0
0
Question about Zip tools. I've been zipping my files using the zip compress tool on Win7. Now, my other PC has Win10 with 7-Zip. 7-Zip unzips the files again just fine.

Are all Zip tools compatable with each other?

How to print price using different currency

$
0
0
Hey

I have a price stored as currency, and I need to show it using various currencies - USD, ZWD, EUR and GBP. How do I convert the price so that the appropriate symbol and style are used?
Code:

      Dim p As Currency
      p = 423.14156
      Debug.Print p                    '  423.1416
      Debug.Print CCur(p)              '  423.1416
      Debug.Print format(p, "€#.##")    ' €423.14
      Debug.Print FormatCurrency(p)    ' $423.14

Manually replacing the "." with "," and manually adding the "€" is silly, but FormatCurrency doesn't seem to accept a currency or locale setting...

Error Saving Records to Lynx Grid

$
0
0
Name:  err.jpg
Views: 17
Size:  25.9 KB
Code:

Private Sub lyn()
Dim cnuser As New ADODB.connection
Dim rsuser As New ADODB.Recordset

If sempty(Text1.Text) = True Then Exit Sub


Call connection(cnuser, App.Path & "\seeyou.mdb", "endromida")
'Call connection(cnuser, "\\SEEYOU-PC\shared\Seeyou.mdb", "endromida")
Call Recordset(rsuser, cnuser, "SELECT * FROM order_de")

With rsuser
.AddNew
.Fields!fran = Combo1.Text
.Fields!OrID = txtOrdNo.Text
.Fields!Edate = txtDtT.Text
.Fields!cat = Combo2.Text
.Fields!fbcode = Text1.Text
.Fields!Avai = Text11.Text
.Fields!sell = Text31.Text
.Fields!iss = Text21.Text
Call bal
.Fields!bal = Text2.Text
End With


Set cnuser = Nothing
Set rsuser = Nothing

End Sub

Code:

Private Sub cmdSave_Click()
If Len(Trim(txtOrdNo.Text)) <= 0 Then
    MsgBox "Order number cannot be blank!", vbInformation
ElseIf LynxGrid1.Rows < 0 Then
    MsgBox "No items found", vbInformation
Else
    If (txtOrdNo.Text) = True Then
        Call Order
        Call lyn
        MsgBox "new order has been added!", vbInformation, "Done..."
        LynxGrid1.Redraw = False
        LynxGrid1.clear
        LynxGrid1.Redraw = True
    Else
        MsgBox "order number exist!", vbInformation
    End If

End If
End Sub

Attached Images
 

Windows 10

$
0
0
What is the current state of vb6 experience with Windows 10? Are posters using it with W10 and finding that a) vb6 can be installed (rather than remain undisturbed by the 'upgrade') and b) that all their vb6 apps work?

Please respond if you have direct first hand experience.

Many thanks

Image Control > Picture Box | Icon | Alpha Horror

$
0
0
3 days experimenting with various code samples and I still can't find a simple solution to this one:

* I have an icon loaded in an image control.

* I need to resize the icon image and maintain true transparency so I can't lose the icon alpha channel

* This means I can't move the image to a picture box and use TransparentBlt or AlphaBlend or whatever to adjust the size and then copy it back to the image control (at least I haven't been able to thus far).

I'd prefer not to have to kill this mosquito with a tank so I'm hoping someone can point me toward a relatively light solution.

TIA!

[RESOLVED] now im baffled.. dPend directory?

$
0
0
I have a few projects on my PC. A couple using only the the CommonDialog control. No references other than defaults. I noticed in one of my project folders, a folder called dPend containing a dependency file. Opening it revealed information. Such as the following;

Uses1=msvbvm60.dll
Uses2=oleaut32.dll
Uses3=olepro32.dll
Uses4=asycfilt.dll
Uses5=stdole2.tlb
Uses6=COMCAT.DLL
Uses7=msscript.ocx

No other project folders have any of this. Now I know for fact my project doenst use, or include the msscript.ocx, and shouldnt need any of the others on the list above.

Any ideas on what this is?

Connect to rdp various ports

$
0
0
why when using msrdp.ocx, we could not use a port other than 3389 as its msrdp.ocx locked can only use one port is 3389?

Me.AxMsRdpClient21.AdvancedSettings2.RDPPort = 1234
after we run, do not connect to the server

we must return to the default port 3389
Me.AxMsRdpClient21.AdvancedSettings2.RDPPort = 3389
and will run normally.

Error in webautomation using vb6 in windows 10

$
0
0
I am automating a website to fill login details. I have developed that app in vb6 and that was working greatly in windows xp, 7 and 8. Now it is giving error in Windows 10. In windows 10 when I run the exe directly, the login details are not filling.(I get "OnQuit fired" message). However, when I run the exe as Administrator it works properly. This is the vb6 code,
Code:

Private Sub Form_Load()

    Set Web = New SHDocVw.InternetExplorer
    Web.Visible = True
    Web.Navigate "http https://mytestingsite/login.html ", 8
End Sub
Private Sub Web_DocumentComplete(ByVal pDisp As Object, URL As Variant)
On Error GoTo aaa
    'MsgBox "  URL: " & URL
    If URL = "https://mytestingsite/login.html" Then
    Web.Document.getElementById("Login_userName").Value = "abcd"
    Web.Document.getElementById("Login_userName").onchange
    Web.Document.getElementById("Login_password").Value = "123456789"
    Web.Document.getElementById("dateField").Value = "15/09/1954"
    End If
Exit Sub
aaa:
MsgBox Err.Description & "  URL: " & URL
End Sub
Private Sub Web_OnQuit()
    MsgBox "OnQuit fired"
End Sub

My question is why run as administrator is required for simple web automation ? Is it not possible to run application in standard user in Windows 10 ? How to solve this problem ?

Please don’t suggest me to rebuild application in .net ( It will take lot of time to convert my application to .net)

should i really move to an installer??

$
0
0
OK, im about ready to take the plunge and use a professional installer that creates an EXE setup file versus the P&D wizard. I got it all figured out and how to include OCX and DLL's and have them installed in the users system directory, but i'm a little nervous if its gonna install as nice as it does on my PC's. Plus, I wouldnt be including the vb runtime files, as I've read that they are no longer needed after XP.

Location Of Text File Value Sometimes Changes

$
0
0
I am trying to get my code to grab a value from a text file.

This value is always located immediately after a value that has 2 numbers, then a decimal, then 2 more numbers (for example, I want to be able to grab the value of 11.80 from the 1st line, & 5.20 from the 2nd line). The text file would look something like -

SP 10-26-2015a 09550 30.85 F 73½ 5 5 5 7 712 31.70 11.80 C Sought Rl Erly-bmpd 1st WindyJac, PjJelyTim, Mc'sDlyLv 8
SP 10-22-2015e 15550 30.75 F 73½ 1 6 5 5 58 31.33 5.20 C Rail Early-crowded 2nd MgaFizz, SlatxPrnc, KowStrkDc 8

I would normally just have my code read so many characters down until it gets to those numbers, but as you see, those numbers don't always stay in the same location.

Thank you.

Can't see the lines.

$
0
0
This is the last bug I have with our 3dz Studio.

The element types of 3 or more nodes all display properly, but the single lines do not drawn, despite having all this code.

Can anyone suggest a fix so it draws a line on screen?


Code:

 
 ' Check what type of element this is
    With m.elem(elem).Elems(piggy)
        Select Case .cod
            Case ELEM_COLOUREDLINE
                ReDim .nod(2)              ' 2 Nodes
                .nod(0) = 0
                .nod(1) = 0
                .crn = 2
                .att(0) = 0                ' Colour Index

Code:

    m.elem(d_e).Elems(d_p).cod = m.elem(s_e).Elems(s_p).cod
    Select Case m.elem(s_e).Elems(s_p).cod
        Case ELEM_COLOUREDLINE
            ReDim Preserve m.elem(d_e).Elems(d_p).nod(2)
            m.elem(d_e).Elems(d_p).crn = 2
            m.elem(d_e).Elems(d_p).nod(0) = m.elem(s_e).Elems(s_p).nod(0)
            m.elem(d_e).Elems(d_p).nod(1) = m.elem(s_e).Elems(s_p).nod(1)
            m.elem(d_e).Elems(d_p).att(0) = m.elem(s_e).Elems(s_p).att(0)

Code:

        Select Case .cod
            Case ELEM_COLOUREDLINE
                ReDim Preserve .nod(2)
                .crn = 2

Code:

Public Enum Elem_Type_3DZ
    ELEM_COLOUREDLINE = 1

Code:

Private Function Parse_Element_3DZ(fnum As Integer, ByRef elem As Element_3DZ)
Dim j As Integer

    ' Get the element code
    Get #fnum, , elem.cod
   
    ' Check for the extra "part"
    If (elem.cod > 6) And (elem.cod <> 255) Then
        elem.part(0) = elem.cod
        Get #fnum, , elem.part(1)
        ' Get the real code
        Get #fnum, , elem.cod
    End If
   
    ' Check what type of element this is
    Select Case elem.cod
        Case ELEM_COLOUREDLINE
            ReDim elem.nod(2)              ' 2 Nodes
            Get #fnum, , elem.nod(0)
            Get #fnum, , elem.nod(1)
            elem.crn = 2
            Get #fnum, , elem.att(0)        ' Colour Index
            Get #fnum, , elem.end          ' Terminator

Code:

        ' Check what type of element this is
        Select Case m.elem(elem).Elems(piggy).cod
            Case ELEM_COLOUREDLINE
                For i = 0 To 1
                    ' Turn on each node
                    .chk_3_select(i).Enabled = True
                    If .chk_3_lock.value = vbUnchecked Then
                        .txt_3_node(i).Enabled = True
                        .upd_3_node(i).Enabled = True
                    End If
                    .txt_3_x(i).Enabled = True
                    .txt_3_y(i).Enabled = True
                    .txt_3_z(i).Enabled = True
                   
                    ' Write the info
                    .wait = True
                    .upd_3_node(i) = m.elem(elem).Elems(piggy).nod(i)
                    .wait = False
                    .txt_3_x(i) = GET_NODE(m, LoadedModel.m_currelem, i).X
                    .txt_3_y(i) = GET_NODE(m, LoadedModel.m_currelem, i).Y
                    .txt_3_z(i) = GET_NODE(m, LoadedModel.m_currelem, i).z
                Next i
               
                .upd_3_att1 = m.elem(elem).Elems(piggy).att(0)
                .lbl_att1.Caption = "Colour:"
                .txt_3_att2 = ""
                .lbl_xmap.Caption = "X Map"
                .cbo_3_type.ListIndex = m.elem(elem).Elems(piggy).cod - 1
                .cmd_3_add.Enabled = False
                .cmd_3_delete.Enabled = False
                .cmd_3_moveup.Enabled = False
                .cmd_3_movedown.Enabled = False

Automating page display of reports that use a flexgrid

$
0
0
Hello
Many years ago a then colleague and myself collaborated in producing a two part program in VB 6, a master program that populates an access database and makes a copy at a remote location and the second part which reads the remote database copy and on selecting a radio button and pressing go reads a report and displays it in a flexgrid
This all works great and there are about 38 reports that can be displayed this way on screen
Every time you close a report page and open another it allows the database to be updated
I now need a little program that will display seven of the reports in the following manner
Open the database display report 1 on screen for x seconds and close the database so it can be updated from the master program
Then replace it by report 2 by opening the database displaying it on screen for x second and closing the database
This continues until report 7 is displayed and then it returns to report 1
It is such a long time since I had to do any programming I am struggling , can any one point me in the right direction

I have VB 6 enterprise running on win 7 and all the programs run on win 7

Many thanks
Rob

dll and ocx? which to package?

$
0
0
I have a form using the common dialog for printing. When i package the app, the deployment wizard includes the comdlg32.ocx file. I've noticed there is also a comdlg32.dll file in SysWow directory. What is the dll used for and should i also include it?

[RESOLVED] 100% processor usage

$
0
0
Hi Guys.

The program I use for edition models is very CPU hungry, and when it's running normally uses 100% of the processor, running the fan at full tilt.

I looked for various fixes, and the easiest way of slowing the program down was to add a timer, so the program refreshed every 1/2 second or so.

The code I've added sorta works, but the program only refreshes when you click on the main screen, so there is something wrong with my code.

Timer added to main form:

Code:

'New timer added JG 26/3/16
Private Sub Timer1_Timer()
Timer1.Enabled = False
End Sub

Main loop which is the root of the CPU usage problem:
Code:

' MAIN LOOP
Public Sub Main()
'    Timer1.Enabled = True
    ' Create Objects
    Set Graphics = New OGL_Graphics
    Set LoadedModel = New model
   
    ' Load config file
    LoadOptions
   
    ' Initialise all the OpenGL stuff
    ViewType = VIEW_PERSPECTIVE
    Graphics.bRunning = Graphics.Initialise(frm_main.pic_render.hdc)
    frm_main.Show
    SetForegroundWindow frm_main.hWnd
    DoRecentFiles
    frm_main.SetFocus
    'Old code replaced with below JG 26/3/16
    'Do While Graphics.bRunning
    '  Render          ' Update the frame
      '  DoEvents        ' Let Windows Think
    'Loop
   
    ' Finished...Clean Up & Exit
    'Set LoadedModel = Nothing
    'Graphics.CleanUp
    'Unload frm_main
    'End
'New code starts here:

    If Graphics.bRunning Then
       
        Render          ' Update the frame
    Else
    'Finished...Clean Up & Exit
    'Timer1.Enabled = False
    Set LoadedModel = Nothing
    Graphics.CleanUp
    Unload frm_main
    End
End If
   
   
End Sub

I've tried to activate the timer, but when I do, I get a compile error, so I'm doing something wrong.

Add text per list item

$
0
0
Hello guys how can I add text to per list items?

For example my list1;

a
b
c

After the click button;

helloa
hellob
helloc

Check box

$
0
0
When I attempt to create an array of check boxes the system does not generate an array nor assigns an index when I attempt to generate additional check boxes with the same name by copy and past the original check box entry. This has always worked before. If I attempt to manually enter the index it is not recognized when attempting to run.

Any suggestion would be appreciated.

[RESOLVED] Please help me to create string

$
0
0
Dear all expert programmers,
Please help me to create procedure below.

Code:

sub GenerateString(pstrString,plngStep)
        iLen=len(pstrString)
        strResult=""
        select case plngstep
                case 1
                case 2
                case 3
                        for i=1 to iLen
                                for j=i to iLen
                                        for k=j to iLen
                                                strResult= strResult &  mid(pstrstring,i,1) & mid(pstrstring,j,1) & mid(pstrstring,k,1) & ","
                                        next
                                next
                        next
                case 50
               
        end select
end sub

Sorry, I found http://www.vbforums.com/showthread.p...ata&highlight=

Please help me to make for faster

$
0
0
Dear all expert programmers,
I want to create big loop to create big array but it is slow. Please help me to make for faster.

Thank you for all post.
Attached Files
Viewing all 21160 articles
Browse latest View live


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