SCBWV 71 Junior Poster

Retired early as a Dean at an R1 university. For a few years I sold specialized software I wrote. Now I do as I please, when I want, if I want. ;)

Reverend Jim commented: So, single then? +0
SCBWV 71 Junior Poster

MANY years ago I had a Dell Precision Workstation with two CPU sockets and (I believe) the Xeon processor, and error correcting memory. I had a SCSI hard drive, which was very fast for the time. Love the machine, but not close to what is available today performance-wise.

SCBWV 71 Junior Poster

2021 Dell XPS 8940 desktop, Intel i7 10700 2.9 GHz, 16 GB RAM, 1 TB SSD, 1 TB SATA HDD, NVidia GeForce GTX 1660 6 GB, Dell 27" U2720Q display I run at 3840x2160. I'm retired, so I didn't replace my laptop when it suddenly died.

SCBWV 71 Junior Poster

I had to laugh reading this thread AFTER reading the "Writing and speaking clearly" thread. Thanks for the chuckle.

rproffitt commented: Huzzah. +0
SCBWV 71 Junior Poster

I don't understand a few things. There are option buttons and there are check boxes. So I don't know what you mean by "option button checkbox." I also don't know what you mean by "record." Do you mean print? Read values from a file?

I would suggest instead of checking for "1" that you use "If chkExtra(0).Value = vbChecked", which is a VB constant and probably compiles more efficiently.

rproffitt commented: From memory that's a valid example. Let's hope arcon engages and supplies a minimum viable example rather "code is broken." +17
SCBWV 71 Junior Poster

VB6 doesn't support <<. As best I can determine, the C code is shifting bits to the right, then back to the left, effectively clearing the lower 6 bits.

In VB6, you can do the same by:

Dim py As Long
Dim shiftedValue As Long
shiftedValue = py / (2 ^ 6) ' Shift right by 6 positions
shiftedValue = shiftedValue * (2 ^ 6) ' Shift left by 6 positions

Likely, someone could write more efficient code, but this seems to work.

cambalinho commented: thank you so much for all to all +7
SCBWV 71 Junior Poster

I use two - Kroger and Walmart. I want access to the app's features without having to create an account and sign in. I want easy access to the search function with accurate results and convenient options like in stock, out of stock, and sorting. In an app for brick and mortar stored (like Kroger and Walmart), I want accurate inventory information and where to locate the item in the store.

Mark_151 commented: When developing a shopping app, focus on user-friendly navigation, secure payment options, and a seamless checkout process. https://talmee.com/ +0
SCBWV 71 Junior Poster

Good detective work! I really like Windows 11, but the list settings are becoming quite extensive and almost overwhelming. Some of it' quirks can drive a person nuts. The latest for me is Windows desktop Spotlight has quit working, which seems to have been an issue going back couple years for some. I made no changes to my desktop settings. It just booted up to Windows "Bloom" one morning and Spotlight wasn't working. I've tried just about all the suggestions found online to no avail. Anyway, good work.

SCBWV 71 Junior Poster

Interesting read: District Court Ruling I think it raises some questions. It seems while the plaintiff later tried to claim he provided the instructions in his AI model to create the image, his application for copyright was based on his "ownership of the machine." The requirement of human involvement doesn't definitively define to what extent.

SCBWV 71 Junior Poster

This will be interesting to follow through the appeals. If they allow the AI creator to copyright, couldn't the dataset author(s) also claim a copyright? If the AI works can't be copyrighted, then at least a portion would be derivative work not covered by copyright, which I believe is what you're suggesting.

SCBWV 71 Junior Poster

It's standard Edge behavior. It adds a link to pages you visit frequently. I just filled it with pinned links (DaniWeb first ;) ) so there's no room for it to add more links. If they're not pinned it can shuffle or replace a link with something else it thinks is more relevant. So far pinning seems to work.

SCBWV 71 Junior Poster

After complaining for months to MS to stop Edge from adding websites to my Quick Links bar, it seems to have stopped. Nothing was more frustrating than reading some news pages then having to delete a ton of links from Quick Links. Is this your experience?

SCBWV 71 Junior Poster

On a similar note... I have my desktop icons set to medium, align to grid, no Auto Arrange. The first column of icons has an empty space in the 9th slot. Every once in a while, Windows will shift the first column of icons down one position, so the top left icon is empty. Drives an OCD person nuts. Only seems to affect the first column. I do like Windows 11, but some of the quirks...

SCBWV 71 Junior Poster

Windows Insider Blog

It's near the end under [File Explorer]

SCBWV 71 Junior Poster

Well, I found this "Fixed an underlying issue believed to be the cause of File Explorer unexpectedly jumping into the foreground sometimes." posted in the Windows Blog "Announcing Windows 11 Insider Preview Build 23403" posted March 8, 2023. Let's hope.

richards1222 commented: amazing. +0
SCBWV 71 Junior Poster

Well, it's back to happening again - Windows Explorer pops to the foreground app for no reason. Windows 11 Home, 22H2, OS Build 22621.2070, Windows Feature Experience Pack 1000.22659.1000.0. Weird, and not something I can induce to investigate a cause.

SCBWV 71 Junior Poster

The error is in the color value, and I don't know what value would display red. I randomly achieved a gray with the code below, which is improved from your code. I'm not sure why you were assigning a negative value to biHeight, then taking a negative of the negative to achieve a positive. Fixed in the code below.

Private Sub Form_Load()
    Me.Show
    With DIBInf.bmiHeader
        .biSize = Len(DIBInf.bmiHeader)
        .biWidth = 100
        .biHeight = 100
        .biPlanes = 1
        .biBitCount = 32
        .biCompression = BI_RGB
        .biSizeImage = AlignScan(.biWidth, .biBitCount) * .biHeight
        '.biXPelsPerMeter = (GetDeviceCaps(MemhDC, HORZRES) / _
            'GetDeviceCaps(MemhDC, HORZSIZE)) * 1000
        '.biYPelsPerMeter = (GetDeviceCaps(hDC, VERTRES) / _
            'GetDeviceCaps(MemhDC, VERTSIZE)) * 1000
        .biClrUsed = 0
        .biClrImportant = 0
    End With
    MemhDC = CreateCompatibleDC(0&)
    hDIB = CreateDIBSection(MemhDC, DIBInf, DIB_RGB_COLORS, DataPtr, 0, 0)
    Form1.AutoRedraw = True ' Messy, but ok for test
    hOldBMP = SelectObject(MemhDC, hDIB)
    Call RtlFillMemory(ByVal DataPtr, DIBInf.bmiHeader.biSizeImage, &H808080)
    Call BitBlt(Form1.hdc, 0, 0, DIBInf.bmiHeader.biWidth, DIBInf.bmiHeader.biHeight, MemhDC, 0, 0, vbSrcCopy)
    Call SelectObject(MemhDC, hOldBMP)
End Sub
SCBWV 71 Junior Poster

I don't know. RflFillMemory expects a long for the Fill, so perhaps try &HFF&

SCBWV 71 Junior Poster

There are color constants in VB6 for the basic colors. Specifying the color with hex or RGB values allows you to select one of 16,777,216, thus there aren't constants for all of them.

vbBlack 0x0
vbRed 0xFF
vbGreen 0xFF00
vbYellow 0xFFFF
vbBlue 0xFF0000
vbMagenta 0xFF00FF
vbCyan 0xFFFF00
vbWhite 0xFFFFFF
AndreRet commented: Correct answer +15
SCBWV 71 Junior Poster

You're welcome. Good luck.

SCBWV 71 Junior Poster

I'm running Windows 11 22H2 and it works for me. Are you getting an error or is the graphic just not being drawn?

Joaquim_5 commented: is just not been drawed +3
SCBWV 71 Junior Poster

This works.
Class Module:

Private Declare Function CreateDC Lib "gdi32.dll" Alias "CreateDCA" (ByVal lpDriverName As String, ByVal lpDeviceName As String, ByVal lpOutput As String, ByRef lpInitData As Any) As Long
Private Declare Function Ellipse Lib "gdi32.dll" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function SelectObject Lib "gdi32" (ByVal hdc As Long, ByVal hObject As Long) As Long
Private Declare Function DeleteDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function DeleteObject Lib "gdi32" (ByVal hObject As Long) As Long
Private Declare Function Rectangle Lib "gdi32" (ByVal hdc As Long, ByVal X1 As Long, ByVal Y1 As Long, ByVal X2 As Long, ByVal Y2 As Long) As Long

'Declarando variáveis
Public hdcSource As Long
Public hdcDest As Long
Public hbm As Long
Public hbmOld As Long

Public Sub NewImage(IMAGEWIDTH As Long, IMAGEHEIGHT As Long)
    'Criar HDC
    hdcSource = CreateDC("DISPLAY", vbNullString, vbNullString, ByVal 0&)
    hdcDest = CreateCompatibleDC(hdcSource)

    'Criar HBitmap
    hbm = CreateCompatibleBitmap(hdcSource, IMAGEWIDTH, IMAGEHEIGHT)
    hbmOld = SelectObject(hdcDest, hbm)
    Rectangle hdcDest, 0, 0, 100, 100
    Ellipse hdcDest, 0, 0, 100, 100
End Sub

Public Sub DeleteImage()
    'Limpar memória
    SelectObject hdcDest, hbmOld
    DeleteObject hbm
    DeleteDC hdcDest
    DeleteDC hdcSource
End Sub

Form Code:

Dim s As Class1
Private Const SRCCOPY = &HCC0020

Private Declare …
SCBWV 71 Junior Poster

I was able to place the code in a class and it functioned. Make sure the scope (Public vs Private) of your functions and variables are accessible to the code as appropriate.

SCBWV 71 Junior Poster

I see what you're saying. I got a black block (line) after so long of pressing a key. The resulting color is dependent on the DrawMode, but the size is based on your calculations in the rayCasting Sub. I would suggest moving all you can in the rayCasting Sub to outside the For/Next loop. There's no need in Dim'ing variables repeatedly.

SCBWV 71 Junior Poster

It's difficult to determine the cause without seeing the rest of your project. Could it possibly be the DrawMode of the surface on which the line is being drawn?

SCBWV 71 Junior Poster

It works right for me. I changed a few things and made comments in the file.

SCBWV 71 Junior Poster

Well, the immediate problem is you are referencing Text2 in the loop for every record you're trying to save:

MyRecord.Name = "MyName" & "  " & Text2.Text 

The other problem I see (or one that will cause you problems later) is you're using a ListBox and combining record properties into one item to simulate columns:

List1.AddItem myRecord.ID & "  " & myRecord.Name

Use a ListView control set to reportview and separate the ID and Name into listview columns:

    Dim itmx As ListItem
    Set itmx = ListView1.ListItems.Add()
    itmx.Text = Text1.Text
    itmx.SubItems(1) = Text2.Text

There's a long post of similar issues here: Click Here

SCBWV 71 Junior Poster

Happy New Year everyone! Wishing you and yours and happy, prosperous, and healthy new year!

SCBWV 71 Junior Poster

Not to mention line 54 is a mess.

Thao_14 commented: yeah I don't know how to make it shorter +0
SCBWV 71 Junior Poster

Try this. I made significant changes. If you have any questions about the code, let me know.

SCBWV 71 Junior Poster

Sorry. I didn't notice the dates were Day/Month/Year and not Month/Day/Year.

Fixed.

SCBWV 71 Junior Poster

Fixed. I added several comments to the code to help explain. Also added a subroutine for the Combo1_Click event.

Best wishes.

SCBWV 71 Junior Poster

What does the contents of the users.txt file look like? Send a few lines and I'll send you the loop. Also, why are you saving the lines in the nmInfo array?

SCBWV 71 Junior Poster

I think it's wonderful, at nearly 80, that you decided to continue programming. I admire your ambition. I have written countless programs that no one will ever use except me, and I thoroughly enjoyed writing them. Go you!

SCBWV 71 Junior Poster

Has anyone experienced the function Windows SystemParametersInfo reporting a different display resolution after returning from sleep mode? My display is 3840X2160, which the SystemParametersInfo reports accurately. However, upon returning from sleep mode, SystemParametersInfo gives a resolution of 2560x1392, which doesn't match any configuration in the Windows Registry under Computer\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\GraphicsDrivers. The actual screen resolution has not changed - the desktop is 3840X2160, but the function reports 2560x1392.

Waiting a while thinking everything hasn't woken up yet doesn't seem to help. Problematic when your program needs to find the right edge of the screen.

SCBWV 71 Junior Poster

Understood. I was just posting for the many people that have no choice but to maintain VB6 code for love or money. As I understand it, there is still LOTS of critical business code in VB6 for one reason or another. Thus the continued work from MS to ensure VB6/VBA still runs, while not supporting the language or its development.

SCBWV 71 Junior Poster

In case you're wondering, VB6 programs run on Windows 11. Programs with a manifest have the appropriate Windows 11 appearance. The IDE works as well, although it seems to aggravate the known Windows 11 Taskbar flickering issue, but it settles down quickly.

The only issue I have found so far is that command button mnemonics do not appear after pressing the Alt key is you use a manifest. This can be solved by 1) not using a manifest file, or 2) changing the Windows setting to always show mnemonics.

Please note, I started with Windows 10 and upgraded to Windows 11. I assume an original Windows 11 install would work the same.

Best wishes to all.

SCBWV 71 Junior Poster

Try Format$(Number, "##-####"). If you want leading zeros, use Format$(Number, "00-####") or Format$(Number, "00-0000")

To be consistent, you can make the "00-0000" a public constant.

SCBWV 71 Junior Poster

There is no caption in the label to retrieve.

Comatose commented: Good Response! +10
SCBWV 71 Junior Poster
Comatose commented: Nice Find! +8
SCBWV 71 Junior Poster
Comatose commented: Nice Find. +8
SCBWV 71 Junior Poster

You don't have to lock the text box, just set KeyAscii to 0. Also, you need to handle the backspace key to allow users to fix errors:

Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 48 To 57, 8
'Let these key codes pass through
Case Else
'All others get trapped
KeyAscii = 0
End Select
End Sub

Jx_Man commented: Nice Recovery +1
SCBWV 71 Junior Poster

Check for both...

If InStr(Email$, "@") > 0 AND InStr(Email$, ".") > 0 Then
'Valid Email Format
else 'not valid
end if

pranavdv commented: helpful person upto the last query +1
SCBWV 71 Junior Poster

Since it seems the Excel data is populating a text box control, why not use the Change event for the text box to trigger your code?

Qpido commented: Thanks +1