Stupid VB question...

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

Recommended Posts

I have an application which is running fine on the development machine and installs/runs fine on most machines. However, there is one machine on which the application just shuts down after a specific series of actions. I've traced it down to a single line of code which accesses an ImageList object on the VB form. I've seen that there are various problems with MSCOMCTL.ocx on WinXP, but I haven't seen any issues on Win2000. In fact, the machines on which it works are running Win2000 (5.00.2195 SP2) while the machine on which it breaks is running 5.00.2195 SP4). Any tips?? Thanks!!

Share on other sites
Could you post the line of code (along with the definition of any types you're using) that is crashing? I may be able to check it out.

Share on other sites
Sure, not that it'll help much, but...

Dim Enteris as Long

Enteris = imgList.ListImages.Count

imgList is an ImageList control on the form that has been preloaded with images. I've tested this and any access to the imgList properties/methods causes the shutdown. I've had this line of code, this control in the exact format in this applicaton for over 2 years with no problem. Now, on this one machine I get the issue.

-Kirk

Share on other sites
may want to try changing entries to integer or using CLong() to convert the output of imagelist.count bit, thats all that i can think of, i never had any problems with ms activex controls not working properlly

Share on other sites
One more question :)

Could you show me the code you use to load a picture?

[Edited by - alexmoura on December 1, 2004 4:25:13 PM]

Share on other sites
Do you mean, to load a picture in general? ie. into a picturebox, or load another picture into your imagelist control?

Share on other sites
Whatever is the process you use to load into the imagelist control

Share on other sites
Alright, let's say for example my ImageList control is called "imlMain"

or if you wanna load the picture from another picture source, like a picturebox or image:

I'm pretty sure that will work. Try it out.

You can also add an index as well, not sure if it's required though.

EDIT: You'll have to add a key probably, so that the picture can be identified correctly. Just play around with the code until it works.

Syntax:

Share on other sites
Sorry - just tried the following code on a w2k server sp4 machine:
Private Sub Form_Load()    ImageList1.ListImages.Add , , LoadPicture("e:\temp\bitmap.bmp")    ImageList1.ListImages.Add , , LoadPicture("e:\temp\bitmap.bmp")    ImageList1.ListImages.Add , , LoadPicture("e:\temp\bitmap.bmp")        Dim Enteris As Long    Enteris = ImageList1.ListImages.Count        MsgBox EnterisEnd Sub

and it worked fine - which version of the MSCOMCTL.OCX library are you using? (mine is 6.1.95.45)

Share on other sites
I use the version that ships with Visual Studio 6 Enterprise Edition, which is probably just 6.0 or something.

1. 1
Rutin
26
2. 2
3. 3
JoeJ
20
4. 4
5. 5

• 10
• 9
• 9
• 46
• 41
• Forum Statistics

• Total Topics
631750
• Total Posts
3002067
×