Code center > Suggestions

Notify Icon

<< < (3/9) > >>

Panda:
Just found out that it doesnt work when you build it into an .exe but works fine during debug.

Numsgil:
That's weird.  I don't have any brilliant ideas unfortunately.

bacillus:

--- Quote from: Panda ---Just found out that it doesnt work when you build it into an .exe but works fine during debug.
--- End quote ---
Sounds like threading issues, although even that sounds dubious (is graphics and logic handled in separate threads?). Sometimes all is needed is a tiny time offset and things that refused to work for inexplicable circumstances magically do. The debug scenario is usually a big clue when going step-by-step.

Panda:
I have worked out why it is

--- Code: ---Private Sub OwnerForm_MouseMove(button As Integer, Shift As Integer, X As Single, Y As Single)
    Static rec As Boolean, MSG As Long
    
    MSG = X / Screen.TwipsPerPixelX
    Debug.Print ("WM_LBUTTONUP:" & WM_LBUTTONUP)
    Debug.Print ("MSG:" & MSG)
    Debug.Print ("X:" & X)
    Debug.Print ("Screen.TwipsPerPixelX:" & Screen.TwipsPerPixelX)
    
    If rec = False Then
        rec = True
        Select Case MSG
            Case WM_LBUTTONDBLCLK:
                'RaiseEvent MouseDown(1)
            Case WM_LBUTTONUP:
                RaiseEvent MouseDown(1)
            Case WM_RBUTTONDBLCLK:
                'RaiseEvent MouseDown(1)
            Case WM_RBUTTONUP:
                'RaiseEvent MouseDown(1)

        End Select
        rec = False
    End If
--- End code ---

The "X" changes at different points to different numbers, I am not sure if it changes to the same every single time.

EDIT: Dunno how to fix it though. Bacillus, you where saying something about the threading. I have no idea about the treads. The "X" changes when you start a new simulation both inside and outside the debug and the numbers created are different to eachother everysingle time inside the debug, outside the debug they are the same as eachother, but different from inside the debug.

bacillus:
I'm not sure I understand the connection between mouse events and screen resolution though, and this language (VB?) is uncharted territory for me...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version