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

Positioning a table within a MSWord Document

$
0
0
I've been able to create, modify, and present a table in a Word document, however,
I cannot seem for the life of me figure out how to place in a specific location in the document.
The table always ends up as the 1st item in the document, pushing any existing items down.
I'm sure it's some simple command like Word.ActiveDocument.Table(x).Top....for that matter .Left would be helpful too!
Can anyone enlighten me?

Thanks!

smallest (most portable) device that can run VB6 programs ?

$
0
0
I have a friend who has a few staff, who often are not in the office.
What s the most portable (not cumbersome) device that can run VB6 programs.
Ability to access the web (whilst away from the office) would also be required.

I believe the atom devices are not suitable as they don't run the proper Windows.

Thanks,
Rob

TIP: Large Icon Parsing for Win10+

$
0
0
This may only apply to you that have your own icon parsing routines.

We all know that starting with Vista, 256x256 icons are supported and in PNG format, contained within an icon structure. Well, Win10 introduced 768x768 icon support and, theoretically, any size can be supported now.

Before Win10, we just assumed that 256x256 was largest supported in the icon format. When parsing the icon directory structure and we saw icon dimensions of 0x0, we translated that to 256x256. To support icons greater than 256x256, the icon structure assumptions changed.

If you see 0x0 dimensions, you'll want to jump to the data section of the icon and verify it contains either a BMP or PNG header. From that header, parse out the true dimensions. Many parsers out there do this anyway since most of us were not convinced the icon structure was always created properly, but many parsers would abort/ignore if the size was greater than 256x256 because a) system wouldn't support that b) assumption of corruption/malformation. Obviously you'll need to be aware of system restrictions if calling APIs to create the icon, but if manually displaying it, then system restrictions are not in play.

Of course, you cannot easily add these to the icon section of the VB resource file.

Detect if Im Running In a Virtual Machine & more

$
0
0
Hello,

My software created in vb6 is going to be run on a server with multiple virtual machines. Is there a reliable way to detect if im running on a virtual system, and maybe how many virtual systems are running on a specific server

Thanks

[RESOLVED] VB6 and Excel TextBox Object

$
0
0
I am working with an existing Excel document and VB6. I need to open the document, enter some data into a Textbox object within an excel sheet.

I can open the excel document as normal, but I am having trouble trying to figure out how to reference the textbox object that it contains to add text to it.

Any help with referencing and adding text to a textbox in excel would be awesome.

filling out forms message box, how to double space, separate lines etc

$
0
0
Heres what Id like in a message box. eg:


Heres what id like in a message box. Something like this.

and something like this. Maybe a few more lines of this.

and this here. Then also this below.


Thankyou!


But this is what I get:


Heres what id like in a message box. Something like this.and something like this. Maybe a few more lines of this.and this here. Then also this below.Thankyou!



Anyone know the codes for line spacing?

.elements("TheMessageArea").Value = "Heres what id like in a message box. Something like this.and something like this. Maybe a few more lines of this.and this here. Then also this below.Thankyou!"


lemme know ive search for 45 mins online.. anyone else whos been online for the past 25 years find its not as easy to find answers anymore?? vba html forms fillout message box line spacing.
Returns more how to make a message box in vba than anything.

encrypt and decrypt binary file

$
0
0
hi everybody,

i want to encrypt and decrypt binary file
example of what i want to do is
file1.exe file1Encrypter.exe file1Decrypted.exe
so my program must load file1.exe and encrypt it into file1encrypted.exe and then decrypt it to file1decrypted.exe

i tried with many algorithms and method but alawys corruct my decrupted file

[RESOLVED] Check GetFocus Parent is UserControl.hWnd

$
0
0
How to check current focused Parent is my UserControl.hWnd? I used hardcode to check it,any API can do the job?

Code:

Private Function IsFocused() As Boolean

    Dim lhWnd As Long
    lhWnd = GetFocus
    On Error Resume Next
    IsFocused = (lhWnd = UserControl.hWnd) Or (GetParent(lhWnd) = UserControl.hWnd) Or GetParent(GetParent(lhWnd)) = UserControl.hWnd Or GetParent(GetParent(GetParent(GetFocus))) = UserControl.hWnd
   
End Function

The problem is that when the parent UserControl contains UC1,UC1 hosts UC2,UC2 hosts UC3,...,UCx hosts TextBox. If TextBox got focus, I have to put milti GetParent.

Using ActiveX in the Property of the class

$
0
0
I made a class which load a image on some ActiveX control.
Here is the code sneppet.

Code:

Private m_leadface As LEAD

Property Let FaceTemplate(ByVal newValue As LEAD)
    m_leadface = newValue
End Property

Sub LoadFaceImage()
    m_leadface.Load m_imagepath
End Sub

Following error occurs at m_leadface = newValue in the FaceTemplate property.
Quote:

Object variable or With block variable not set
LEAD is a ActiveX control.
May I chane it to Set m_leadface = newValue?
If use Set keyword, no compile error occurs but I'm not sure if it is correct to use Set keyword inside the property.

QR Code Crystal report 8.5

$
0
0
i want Barcode QR in Cr 8.5 any one can help me??

Display custom control over form borders

$
0
0
Hi guys!

I am trying to create a custom combobox that can display multiple columns.

A problem I have is that i want to show the dropdown list over the form borders or any container borders but I have no idea how to do that.
Is there a Windows API that cand do just that?

For the vb6 combobox this is default behavior, when the list is bigger than the form borders it goes over, and I want my control to be able to do the exact same thing.

Any help would be much appreciated

Thank you

Mysterious VBControlExtender

$
0
0
From my trail, I come to know VBControlExtender has some disadvantages, The Subclassing Procedures in my ActiveX (UC) are not functioning any more. After a thought, it won't support subclassing as it is (some sort of like VBControlExtender + Class = ActiveX).

I check MSDN, there's very limit info. Please educate me.

C#/VB.NET doesn't have such thing, e.g. In .NET, we can do something like Dim ShadeUC as New MyActiveX but VB6 doesn't allow. I have to put ActiveX on the form so that I can use Events,Properties and Methods.

Edited: I Move Subclass procedures from my ActiveX into my Form, now I can do Subclassing. I feel comfortable now:). I don't know whether there's more easier or better way.

Request for VB script to configure VLC as multicast receiver

$
0
0
Hi All,

I am looking for VB script which will invoke VLC and configure as multicast receiver.
Also it should change the channels viewed periodically.

Your inputs are much appreciated.

Thanks,
Rakesh

[RESOLVED] How to open a resource file ?

$
0
0
Hi,
I have loaded a text from notepad to a res file and I intend to get this info in clipboard when a click event is fired. The idea is I don't know how to get back the data stored in that res file. Any attempt to use the LoadResData function failed. I haven't seen samples on net about how a text file could be stored as resource in vb6. Thank in advance for any info.

Cant do a make on a VB6 project

$
0
0
When I try to a File\Make xxxx.exe I get a compile error: Method or data member not found on this line
Dim li As ListItem
For Each li In frmML.lvModelInfo.ListItems
If li.Checked Then <---------
Call AddModelToGroup(frmML.GetModelID(li.Index), lvGroup.SelectedItem.SubItems(1))
End If
Next

Image Editing

$
0
0
Hi!

Please, somebody could indicate a tutorial sowing how to edit images on VB6 using API commands?

Thank you!

Aluizioa

IP Camera in VB6

$
0
0
HI

Has anyone got any ideas on how to capture a pic from an ip camera in vb6,
any help would be great.

Thanks

Reading A Textfile Problem

$
0
0
Hi All

I need some help reading a text file. in the attached text files the one named "Output old.txt" works ok but I need to work with "output new.txt" has you can see the are C and various numbers after the C I want ignore the C and the number after it I am just interested in the number after the tab normally it be a "1" but if this 1 is a "0" then it gets entered in my labels. and also line C50,C51,C52,C53 the info after c50-53 needs to be outputed to another text file. Thanks for your help.

Code:

    Private Function ReadFile(FilePath As String)
Dim i As Integer, FF As Integer, Num As Integer
Dim s As String, ReadLine As String, sLine() As String
  Dim sum As String
  Dim strData As String
  FF = FreeFile
    Open FilePath For Input As #FF
      Do Until EOF(FF)
        Line Input #FF, ReadLine
        s = s & Trim(ReadLine) & ","
      Loop
    Close #FF
   
  sLine = Split(s, ",")
    Num = CInt(Mid(sLine(23), 4, 1))

    Select Case Num
      Case 1
        For i = 3 To 18
          If sLine(i) = "0" Then CHKP1(i - 2).AddItem sLine(i)
       
        Next
       
CHKP1(0).AddItem sLine(19)
LABP11.Caption = CHKP1(1).ListCount
LABP12.Caption = CHKP1(2).ListCount
LABP13.Caption = CHKP1(3).ListCount
LABP14.Caption = CHKP1(4).ListCount
LABP15.Caption = CHKP1(5).ListCount
LABP16.Caption = CHKP1(6).ListCount
LABP17.Caption = CHKP1(7).ListCount
LABP18.Caption = CHKP1(8).ListCount
LABP19.Caption = CHKP1(9).ListCount
LABP1A.Caption = CHKP1(10).ListCount
LABP1B.Caption = CHKP1(11).ListCount
LABP1C.Caption = CHKP1(12).ListCount
LABP1D.Caption = CHKP1(13).ListCount
LABP1E.Caption = CHKP1(14).ListCount
LABP1F.Caption = CHKP1(15).ListCount
LABP1G.Caption = CHKP1(16).ListCount
Label4.Caption = CHKP1(0).ListCount

    sum = Val(LABP11.Caption) + Val(LABP12.Caption) + Val(LABP13.Caption) + Val(LABP14.Caption) + Val(LABP15.Caption) + Val(LABP16.Caption) + Val(LABP17.Caption) + Val(LABP18.Caption) + Val(LABP19.Caption) + Val(LABP1A.Caption) + Val(LABP1B.Caption) + Val(LABP1C.Caption) + Val(LABP1D.Caption) + Val(LABP1E.Caption) + Val(LABP1F.Caption) + Val(LABP1G.Caption)
        Label3.Caption = sum
    sum = Val(Label3.Caption) + Val(Label5.Caption) + Val(Label7.Caption) + Val(Label10.Caption)
        NOK.Caption = sum
    sum = Val(Label4.Caption) + Val(Label6.Caption) + Val(Label8.Caption) + Val(Label11.Caption)
        POK.Caption = sum
     
     
      Case 2
        For i = 3 To 18
          If sLine(i) = "0" Then CHKP2(i - 2).AddItem sLine(i)

        Next
       
CHKP2(0).AddItem sLine(19)
LABP21.Caption = CHKP2(1).ListCount
LABP22.Caption = CHKP2(2).ListCount
LABP23.Caption = CHKP2(3).ListCount
LABP24.Caption = CHKP2(4).ListCount
LABP25.Caption = CHKP2(5).ListCount
LABP26.Caption = CHKP2(6).ListCount
LABP27.Caption = CHKP2(7).ListCount
LABP28.Caption = CHKP2(8).ListCount
LABP29.Caption = CHKP2(9).ListCount
LABP2A.Caption = CHKP2(10).ListCount
LABP2B.Caption = CHKP2(11).ListCount
LABP2C.Caption = CHKP2(12).ListCount
LABP2D.Caption = CHKP2(13).ListCount
LABP2E.Caption = CHKP2(14).ListCount
LABP2F.Caption = CHKP2(15).ListCount
LABP2G.Caption = CHKP2(16).ListCount
Label6.Caption = CHKP2(0).ListCount

    sum = Val(LABP21.Caption) + Val(LABP22.Caption) + Val(LABP23.Caption) + Val(LABP24.Caption) + Val(LABP25.Caption) + Val(LABP26.Caption) + Val(LABP27.Caption) + Val(LABP28.Caption) + Val(LABP29.Caption) + Val(LABP2A.Caption) + Val(LABP2B.Caption) + Val(LABP2C.Caption) + Val(LABP2D.Caption) + Val(LABP2E.Caption) + Val(LABP2F.Caption) + Val(LABP2G.Caption)
        Label5.Caption = sum
    sum = Val(Label3.Caption) + Val(Label5.Caption) + Val(Label7.Caption) + Val(Label10.Caption)
        NOK.Caption = sum
    sum = Val(Label4.Caption) + Val(Label6.Caption) + Val(Label8.Caption) + Val(Label11.Caption)
        POK.Caption = sum
   
   
Case 3
        For i = 3 To 18
          If sLine(i) = "0" Then CHKP3(i - 2).AddItem sLine(i)
     
        Next
       
CHKP3(0).AddItem sLine(19)
LABP31.Caption = CHKP3(1).ListCount
LABP32.Caption = CHKP3(2).ListCount
LABP33.Caption = CHKP3(3).ListCount
LABP34.Caption = CHKP3(4).ListCount
LABP35.Caption = CHKP3(5).ListCount
LABP36.Caption = CHKP3(6).ListCount
LABP37.Caption = CHKP3(7).ListCount
LABP38.Caption = CHKP3(8).ListCount
LABP39.Caption = CHKP3(9).ListCount
LABP3A.Caption = CHKP3(10).ListCount
LABP3B.Caption = CHKP3(11).ListCount
LABP3C.Caption = CHKP3(12).ListCount
LABP3D.Caption = CHKP3(13).ListCount
LABP3E.Caption = CHKP3(14).ListCount
LABP3F.Caption = CHKP3(15).ListCount
LABP3G.Caption = CHKP3(16).ListCount
Label8.Caption = CHKP3(0).ListCount

    sum = Val(LABP31.Caption) + Val(LABP32.Caption) + Val(LABP33.Caption) + Val(LABP34.Caption) + Val(LABP35.Caption) + Val(LABP36.Caption) + Val(LABP37.Caption) + Val(LABP38.Caption) + Val(LABP39.Caption) + Val(LABP3A.Caption) + Val(LABP3B.Caption) + Val(LABP3C.Caption) + Val(LABP3D.Caption) + Val(LABP3E.Caption) + Val(LABP3F.Caption) + Val(LABP3G.Caption)
        Label7.Caption = sum
    sum = Val(Label3.Caption) + Val(Label5.Caption) + Val(Label7.Caption) + Val(Label10.Caption)
        NOK.Caption = sum
    sum = Val(Label4.Caption) + Val(Label6.Caption) + Val(Label8.Caption) + Val(Label11.Caption)
        POK.Caption = sum
   
      Case 4
        For i = 3 To 18
        If sLine(i) = "0" Then CHKP4(i - 2).AddItem sLine(i)
         
        Next
       
CHKP4(0).AddItem sLine(19)
LABP41.Caption = CHKP4(1).ListCount
LABP42.Caption = CHKP4(2).ListCount
LABP43.Caption = CHKP4(3).ListCount
LABP44.Caption = CHKP4(4).ListCount
LABP45.Caption = CHKP4(5).ListCount
LABP46.Caption = CHKP4(6).ListCount
LABP47.Caption = CHKP4(7).ListCount
LABP48.Caption = CHKP4(8).ListCount
LABP49.Caption = CHKP4(9).ListCount
LABP4A.Caption = CHKP4(10).ListCount
LABP4B.Caption = CHKP4(11).ListCount
LABP4C.Caption = CHKP4(12).ListCount
LABP4D.Caption = CHKP4(13).ListCount
LABP4E.Caption = CHKP4(14).ListCount
LABP4F.Caption = CHKP4(15).ListCount
LABP4G.Caption = CHKP4(16).ListCount
Label11.Caption = CHKP4(0).ListCount

    sum = Val(LABP41.Caption) + Val(LABP42.Caption) + Val(LABP43.Caption) + Val(LABP44.Caption) + Val(LABP45.Caption) + Val(LABP46.Caption) + Val(LABP47.Caption) + Val(LABP48.Caption) + Val(LABP49.Caption) + Val(LABP4A.Caption) + Val(LABP4B.Caption) + Val(LABP4C.Caption) + Val(LABP4D.Caption) + Val(LABP4E.Caption) + Val(LABP4F.Caption) + Val(LABP4G.Caption)
        Label10.Caption = sum
    sum = Val(Label3.Caption) + Val(Label5.Caption) + Val(Label7.Caption) + Val(Label10.Caption)
        NOK.Caption = sum
        sum = Val(Label4.Caption) + Val(Label6.Caption) + Val(Label8.Caption) + Val(Label11.Caption)
        POK.Caption = sum
     
    End Select
 
 
   
        If sLine(24) = "fff" Then
Open "f:\" & strRX & "\check.txt" For Output As #1
  For i = 3 To 18
        Print #1, sLine(i)
    Next
        Close #1

 
  Open "f:\REJECTS.txt" For Append As #2
  Print #2, strRX & " REJECTED ON " & sLine(19)
  Close #2

        Open "D:\" & strRX & "\REJECTS.txt" For Append As #3
      Print #3, vbLf
        Print #3, strRX & "  REJECTED ON " & sLine(19); " "
     
        For i = 3 To 18
        Print #3, sLine(i);
        Next
        Close #3
         
         
    ViewRejects.ViewList.AddItem strRX & "  REJECTED ON  " & sLine(19)
   
      End If
 
   
End Function

Kind Regards

Steve
Attached Files

[RESOLVED] About RenderPNG function

$
0
0
Hi,
This thread is related to my previous issue regarding how to display a png image in a simple/simplest way. The Api function created by LaVolpe a few years ago www.vbforums.com/showthread.php?582741-RESOLVED-Minimum-code-to-draw-PNG-GDI worked very well in a certain context (within click event) but when I tried to call the same function in the Form_Load event I was surprised to see that the same pics cannot be loaded as before.
I suppose it is something related to the cycle of the Form loading event because it seems the device context hDC has not enough time to be read. Considering this effect, is it possible to call this function properly when the main form is loaded ?

[RESOLVED] Image Editing

$
0
0
Hi!

Please, somebody could indicate a tutorial sowing how to edit images on VB6 using API commands?

Thank you!

Aluizioa
Viewing all 21243 articles
Browse latest View live


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