Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Calling GdipLoadImageFromFile With Chinese Characters In The Filename

Posted on 2011-03-16
2
Medium Priority
?
817 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 200 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses

971 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