• ### Popular Now

• 14
• 12
• 9
• 10
• 13

#### Archived

This topic is now archived and is closed to further replies.

# Problem with labels in Visual Basic

This topic is 5633 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I'm just learning Visual Basic 6.0. I was working through an tutorial "Stopwatch" application I found on the internet and my first attempt to run the completed application failed with an illegal operation and killed VB. I restarted and created the whole app again (I didn't save it before the original error), saved it, and ran it. Once again, it shutdown VB with an illegal operation. After this I did some testing and found it didn't shutdown with controls like command buttons, but always with text labels and input boxes. And it always gives me an illegal operation, and then when I click OK I get another illegal operation. I was just curious if anyone else has had these kinds of problems. In case it matters, here are the details from both illegal operations: 1st:

VB6 caused an invalid page fault in
module VB6.EXE at 0167:004581f1.
Registers:
EAX=00000000 CS=0167 EIP=004581f1 EFLGS=00010246
EBX=01756854 SS=016f ESP=007ff738 EBP=007ff790
ECX=007ff748 DS=016f ESI=00400000 FS=59d7
EDX=00000000 ES=016f EDI=00000001 GS=0000
Bytes at CS:EIP:
8b 08 ff 51 08 83 a3 9c 00 00 00 00 e9 28 fd ff
Stack dump:
00000000 017476b4 01756854 01756a0c 004032f0 84654416 f900009c 00000044 00000000 00000000 00004190 00403320 00000001 017476b4 00000000 00000001

2nd:

VB6 caused an invalid page fault in
module SSSCC.DLL at 0167:60567702.
Registers:
EAX=00000000 CS=0167 EIP=60567702 EFLGS=00010246
EBX=60480000 SS=016f ESP=03d6fbe4 EBP=03d6fc14
ECX=00000000 DS=016f ESI=03860620 FS=6bc7
EDX=8178d224 ES=016f EDI=00000001 GS=649e
Bytes at CS:EIP:
8b 71 04 85 f6 57 74 23 8b 7c 24 0c 33 d2 8b c7
Stack dump:
03860620 6056b2c9 00000db4 60480000 00000001 03860620 6056b12b 03860620 03860620 03d6fc24 6058d804 00000000 03d6fc30 6057bcd9 03860620 03860620

Thanks in advance, Mark Edit: It might be also worth noting that when I try to cut, copy, or delete a label or input box, I get an error as well. I also get an illegal operation when I try to bring up a form from a saved project with one of these controls on it. [edited by - minion on October 19, 2002 6:02:34 PM]

##### Share on other sites
I think your VB source code would be more useful.

##### Share on other sites
I'll post the code, but VB doesn't just crash with that project. It crashes anytime I use a label or input box.

Here's the code:

    Option ExplicitDim StartTime As VariantDim EndTime As VariantDim ElapsedTime As VariantPrivate Sub cmdEnd_Click()'Find the ending time, compute the elapsed time'Put bothe values in label boxesEndTime = NowElapsedTime = EndTime - StartTimelblEnd.Caption = Format(EndTime, "hh:mm:ss")lblElapsed.Caption = Format(ElapsedTime, "hh:mm:ss")End SubPrivate Sub cmdExit_Click()EndEnd SubPrivate Sub cmdStart_Click()'Establish and print starting timeStartTime = NowlblStart.Caption = Format(StartTime, "hh:mm:ss")lblEnd.Caption = ""lblElapsed.Caption = ""End Sub

Also, here is a list of the controls that cause the problem:
PictureBox, Label, TextBox, CheckBox, ComboBox, ListBox, and Image

Thanks,
Mark Ulrich

[edited by - Minion on October 19, 2002 6:23:29 PM]

##### Share on other sites
i think the best thing to do is to reinstall VB completely. It''ll maybe help.

##### Share on other sites
I''ve tried to reinstall VB and Visual Studio completely with no success. I did notice when I restarted my machine after a reinsallation I got a notice concerning MSSTDFMT.DLL but it''s on my system in the windows\system directory. Might a service pack help me out with this?

##### Share on other sites
I got it working now.. I had to download a new MSSTDFMT.DLL and reinstall again. Thanks for the help.

Mark Ulrich