Solved

Calling GdipLoadImageFromFile With Chinese Characters In The Filename

Posted on 2011-03-16
2
749 Views
Last Modified: 2012-05-11
Can anyone please tell me how to call the API: GdipLoadImageFromFile in VB6 and pass it a filename that contains Chinese Characters?

For example:

c:\media\¿¿¿¿¿¿¿¿¿,¿39.JPG

Many thanks
0
Comment
Question by:APE47
2 Comments
 
LVL 22

Accepted Solution

by:
danaseaman earned 50 total points
ID: 35153928

Private Declare Function GdipLoadImageFromFile Lib "gdiplus" (ByVal FileName As Long, hImage As Long) As Long

Call using StrPtr:

GdipLoadImageFromFile StrPtr(sFilename), GpImagePtr

-----

This assumes that you are able to retrieve the Unicode Path + Filename.
You can't do this with Vb6 Dir or FileListBox since these are ANSI controls.

Try this Unicode aware CommonDialog replacement to select the file and pass it to GdipLoadImageFromFile:
http://www.vbforums.com/showthread.php?t=585762

0
 

Author Closing Comment

by:APE47
ID: 35154364
Thankyou very much, this has solved my problem.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
This article will show, step by step, how to integrate R code into a R Sweave document
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

743 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now