Problem loading a JPG into an image control


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 7 of 7

Thread: Problem loading a JPG into an image control

  1. #1
    Join Date
    Oct 2007
    Posts
    2

    Unhappy Problem loading a JPG into an image control

    I have a program that loads pictures into an image control.

    ie -> image1.picture = LoadPicture(filepathandname)

    On my dev machine, an XP PRO with visual studio VB6 installed.
    All works fine.

    Trying to get the program to work on a win98 box keeps creating an illegal operation with reference to Kernel32.

    My installation script indicated that some of the files needed to be replaced. (From standard package and deployment wizzard), and I fear that my VB6 runtimes are now messed up.

    I have tried to replace many of the files, but I keep getting the error. I can load a BMP no problem, but the image control should also be capable of using the JPG format.

    I either need ot understand image control imitations, or someone to help me understand how I can fully uninstall VB6 runtimes and then re-install.

    Help is appreciated

    DPOP

  2. #2
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    kernel32 problem ? it's the core of an operating system, i don't know exactly but seems that the method used to load jpg images in win98 is different than the one used in winxp . have u tried to build the application under win 98 ?
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  3. #3
    Join Date
    Dec 2003
    Location
    San Diego
    Posts
    202
    VB6 was first released in '98, so there is a good chance your Win98 OS is only compatible with VB5. Along the lines of what Amahdy said, maybe you should also check the version of VB that shipped with your version and build of Win98.

    Good luck,
    Michael Sanchez
    Managing Technical Editor
    Forum Moderator
    FreeVBCode.com

  4. #4
    Join Date
    Oct 2007
    Posts
    2

    More background

    Thanks for the suggestions guys.

    For more background...

    VB6 and win 98 are very capable of displaying JPG using a picture object. (I have done so in the past)

    I realized after churning through the code that I was using image boxes. (Auto scale was the reason).

    There might be a limitation of loading a JPG into the image object... but agian I believe that it should be ok.

    The biggest issue is that the compiled project (My winxp box) indicated that one of the DLL's needed updating which is bogus, I unfortunately clicked the ok.... I think that my runtimes and dll's are possibly messed up on my win 98 platform. (I don't want to reload the OS) so.. If anyone knows how to uninstall all vb6 runtimes and associated files it might be the silver bullet that I am lookign for.

    Thanks again

    DPOP

  5. #5
    Join Date
    Apr 2007
    Location
    Sterling Heights, Michigan
    Posts
    8,666
    The only way I know of the uninstall the VB6 runtimes is to uninstall VB6.
    I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
    Please use [Code]your code goes in here[/Code] tags when posting code.
    Before posting your question, did you look here?
    Got a question on Linux? Visit our Linux sister site.
    Modifications Required For VB6 Apps To Work On Vista

  6. #6
    Join Date
    Oct 2005
    Location
    Maady
    Posts
    1,819
    package and deployment will export the exact needed dll's to run the program anywhere, under win98 too, so maybe if you updated any dll, it will export it with your project ... or did u mean reset the vb6 runtimes installed under win 98 ?
    Programmer&Cracker CS
    MyBlog:Blog.Amahdy.com
    MyWebsite:www.Amahdy.com

  7. #7
    Join Date
    Oct 2005
    Location
    Staffordshire, England
    Posts
    101
    I use Win98SE and I don't have any problems using

    Image1.Picture = LoadPicture(filepathandname)

    If you not using VB6 with Service Pack 6.0 then I suggest you update.

    To find what Service Pack you are using watch the splash screen as VB starts up or use Help\About Microsoft Visual Basic....
    I've been programming with VB for 15 years. Started with VB4 16bit Pro, VB5 Pro, VB6 Pro/Enterprise and now VB3 Pro. But I'm no expert, I'm still learning.

    Martin2k

Similar Threads

  1. Image Control problem.
    By Shannon in forum VB Classic
    Replies: 2
    Last Post: 05-15-2006, 02:16 PM
  2. Image problem
    By Jack in forum Web
    Replies: 0
    Last Post: 09-13-2001, 04:29 PM
  3. Script for scrolling
    By Mark in forum Web
    Replies: 3
    Last Post: 08-30-2001, 11:45 AM
  4. Replies: 1
    Last Post: 08-01-2000, 01:51 PM
  5. Problem with using ADO Data Control
    By Kamal in forum VB Classic
    Replies: 0
    Last Post: 06-22-2000, 01:17 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center