Jump to content
  • Advertisement
Sign in to follow this  
kirkd

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.

If you intended to correct an error in the post then please contact us.

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 this post


Link to post
Share on other sites
Advertisement
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 this post


Link to post
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.

Thanks for the quick reply!!

-Kirk



Share this post


Link to post
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 this post


Link to post
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 this post


Link to post
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 this post


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

In your code where you want to add the images, type:

iml.ListImages.Add , , LoadPicture("C:\Image.bmp")

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

iml.ListImages.Add , , Picture1.Picture

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:
ListImages.Add Index, Key, Picture

Share this post


Link to post
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 Enteris
End Sub


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

Share this post


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

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!