Quantcast
Channel: VBForums - Visual Basic 6 and Earlier
Viewing all articles
Browse latest Browse all 22154

Strange problems with VB6

$
0
0
Hi,

Recently, I have been working on my own little project and have been having major headaches with VB6 while doing so and the problems only seem to occur when I am working on this particular project. I am not sure if it is because of the code I am using or what but the code shouldn't be executing if I am typing in the IDE should it and not actually running my program?

The is the code that seems to be executing while working on my program:

vb Code:
  1. Public Function KeyboardProc(ByVal idHook As Long, ByVal wParam As Long, ByVal lParam As Long) As Long
  2. If idHook < 0 Then
  3. 'call the next hook
  4. KeyboardProc = CallNextHookEx(hHook, idHook, wParam, ByVal lParam)
  5. Else
  6. Select Case True
  7. Case GetAsyncKeyState(VK_LCONTROL)
  8. frmMain.ActiveControl.Text = (ht.Item(17))
  9. Case GetAsyncKeyState(VK_RCONTROL)
  10. frmMain.ActiveControl.Text = (ht.Item(15))
  11. Case GetAsyncKeyState(VK_LSHIFT)
  12. frmMain.ActiveControl.Text = (ht.Item(16))
  13. Case GetAsyncKeyState(VK_RSHIFT)
  14. frmMain.ActiveControl.Text = (ht.Item(14))
  15. Case GetAsyncKeyState(VK_LALT)
  16. frmMain.ActiveControl.Text = (ht.Item(18))
  17. Case GetAsyncKeyState(VK_RALT)
  18. frmMain.ActiveControl.Text = (ht.Item(21))
  19. End Select
  20. End If
  21. 'call the next hook
  22. KeyboardProc = CallNextHookEx(hHook, idHook, wParam, ByVal lParam)
  23. End Function

and I am confuse as to why it should be doing so when I not running the program.

Another problem I have encountered is VB doesn't seem to recognize the label:

vb Code:
  1. For l = 2 To 37 - 2
  2.  lstCurrentAssign.ListItems.Add Label & l.Caption
  3. Next l

it keeps saying variable undefined.

Also, sometimes I receive:

Run-time error '50304':

An instance of 'frmMain' cannot be created because it's designer window is open.

What is going on? :confused:

Thanks,


Nightwalker

Viewing all articles
Browse latest Browse all 22154

Trending Articles



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