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

Oh Lord... 17 years ago... I'm sure it was from searching for programming content.

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

I am so saddened to hear this that I'm at a loss for words. You're in my thoughts and prayers.

SCBWV 71 Junior Poster

Tried that. Oddly enough, Spotlight works on the Lock Screen, but not the desktop.

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

Ugh, I spoke too soon. It's back to adding links. So frustrating. I can't find where Edge is storing the links to perhaps make it read only. Only workaround I can think of is to populate and pin 8 links I like so there's no room for it to add others.

SCBWV 71 Junior Poster

I doubt I can take credit, but I did quite often pester MS through the Feedback. Yes, I imagine with all your development work, Chrome is quite an advantage. I don't have any need for development beyond posting simple pages.

On another note... I hope you're doing well! Can't help using DaniWeb without thinking about Dani.

SCBWV 71 Junior Poster

I like Edge. Adding to Quick Links was my only complaint. Edge has some advantages over Chrome, but I'm sure it's largely a personal preference.

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

I found a script that lets me save and restore positions. Haven't used it to restore yet. I'll see how it does. It may require restarting Explorer, I'm not sure.

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

You haven't posted enough code for me to use in replicating the error. Perhaps attach as zip of files that include your types and definitions.

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

I had this happen before, but not with VLC. It seemed randomly, Explorer would become the foreground app. It happened so frequently, I thought I had a mouse / driver issue. It hasn't happened again for a few months. Perhaps an update fixed it for me.

SCBWV 71 Junior Poster

It's great to hear you're feeling well today. Keeping you in my thoughts and prayers that this is a permanent upward trend!

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

Oh no! I'm saddened to hear that. I wish you and your husband the best and you a speedy recovery.

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 assume you're trying to create a screen compatible DC by passing 0& to CreateCompatibleDC. Perhaps try:

Private Declare Function CreateCompatibleBitmap Lib "gdi32" (ByVal hdc As Long, ByVal nWidth As Long, ByVal nHeight As Long) As Long
Private Declare Function CreateCompatibleDC Lib "gdi32" (ByVal hdc As Long) As Long
Private Declare Function GetDC Lib "user32" (ByVal hWnd As Long) As Long

'then

'Create a device context
 mDC = CreateCompatibleDC(GetDC(0))
'Create a bitmap, compatible with the screen
 mBitmap = CreateCompatibleBitmap(GetDC(0), lngWidth / Screen.TwipsPerPixelX, lngHeight / Screen.TwipsPerPixelY)

You really shouldn't use keywords (Width, Height) as arguments to your CreateMemoryBitmap sub. In the above code, I used lngWidth and lngHeight. Also, I assume these were passed as twip values, so the example above converts them to pixels, which the API expects.

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

I don't know Spanish, so it was difficult for me to follow. As best I can determine, you are trying to use the NAME keyword to rename a file:

Name App.Path & "\inventario\inventario.temp" As App.Path & "\inventario\inventario.txt"

Name returns the name used in code to identify a form, control, or data access object, or returns or sets the name of a font object.

Instead, add a Reference to Microsoft Scripting Runtime, then use:

Dim fso As New FileSystemObject
fso.CopyFile App.Path & "\inventario\inventario.temp", App.Path & "\inventario\inventario.text"
Kill App.Path & "\inventario\inventario.temp"
SCBWV 71 Junior Poster

What code do you have already?

SCBWV 71 Junior Poster

Sorry, I've been out of town for the week and will be gone this weekend, so I can't be of much help. I see you changed the Text Box to an InputBox. I'll see how it behaves when I get back.

SCBWV 71 Junior Poster

Change Text1.Text = myRecord.ID + 1 in Sub LoadRecords to Text1.Text = "1"

SCBWV 71 Junior Poster

It works for me. See attached.

SCBWV 71 Junior Poster

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

SCBWV 71 Junior Poster

Dim Sep as Long
-or-
Dim Sep as Integer

Either one will work. There's some debate as to which you should use, but either will work.

SCBWV 71 Junior Poster

The INSTR function returns a variant, so the return value can be declared as an integer or long.

SCBWV 71 Junior Poster

So 3 records of each number but different data? Sounds like a case for modular arithmetic e.g If X Mod 3 = 0 then...

You didn't say why you're reading the file from the end to the beginning?

SCBWV 71 Junior Poster

I guess I don't understand what you're trying to do. Are you wanting records to be 1 aa, 1 bb, 1 cc, 2 aa, 2 bb, 2 cc?

SCBWV 71 Junior Poster

Try this. I coded the Click event for the list, which populates your text boxes. The New button sets the ID to one greater than the List box contents. Why are you reading the file from the end to the beginning?

SCBWV 71 Junior Poster

Uncomment x = LOF(1) / Len(myRecord)

SCBWV 71 Junior Poster

Try this.