Click to See Complete Forum and Search --> : Error in User.exe


MightyPolar
February 10th, 2000, 03:21 PM
I am working on a program in VB5 and when I try to run it to debug, I get the following error about 80% of the time (I compiled the program and get this everytime I try to execute it...)

SRCG caused a divide error in module USER.EXE at 0004:00005f67.
Registers:
EAX=0002dd52 CS=17af EIP=00005f67 EFLGS=00000202
EBX=00020004 SS=34d7 ESP=000081ea EBP=006b81fa
ECX=176f0002 DS=16bf ESI=00020001 FS=1247
EDX=00010002 ES=34d7 EDI=0000682e GS=2def
Bytes at CS:EIP:
f7 fb ca 06 00 66 5b 66 59 66 5a 66 58 66 53 67
Stack dump:
176f5cc1 00060004 9ba07a38 00000413 0aa2824e 34d782a4 5d100003 82c034d7 82a4006b 006b82c4 004182a8 00000000 4e840000 000000d2 f3640000 0041006b

If anyone has any sugesstions, please let me know. e-mail me at groverjr@imap3.asu.edu, and thanks.

Graduate Assistant
Arizona State University

Weasel
February 10th, 2000, 03:41 PM
Post the source (or the beginning of the source) for the 1st module or function run.

MightyPolar
February 10th, 2000, 03:54 PM
Here is some code I picked up to set the columns of my listboxes, I think it may be what is causing the error. I tried removing the code and running and compiling several times and I no longer got the error. However, I need a way to set the columns on listboxes, so if anyone has any suggestions...

Private Declare Function SendMessage Lib "User32" Alias "SendMessageA" (ByVal hWnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const LB_SETTABSTOPS = &H192

Public Sub SetListBoxTabs(lst As ListBox, ParamArray Tabs() As Variant)
Dim lngTabs() As Long
Dim var As Variant
Dim intPos As Integer
ReDim lngTabs(1 To UBound(Tabs) + 1)

For Each var In Tabs
intPos = intPos + 1
lngTabs(intPos) = CLng(var)
Next

var = SendMessage(lst.hWnd, LB_SETTABSTOPS, UBound(lngTabs()) + 1, lngTabs(1))
End Sub


Graduate Assistant
Arizona State University

February 10th, 2000, 10:25 PM
[Weasel]
You're definately adding them the hard way. Look at the ListBox object in VB, it has a method for adding an item. Also, if it's set in stone you can enter it at design time.

.AddItem (Item as String, [index as ?]) is the method.

MightyPolar
February 11th, 2000, 12:31 AM
I figured it out anyway, but I was not simply adding items to the list... I was trying to set the tabs field so that the list displayed in columns (and not the columns that are given in the listbox properties...). So, again, I don't know what you brought up adding items to a list... that wasn't what the problem was about. But, thanks anyway.

-James R. Grover
--------------------------------------------------------------------------------
Graduate Assistant
Arizona State University