Solved

Calling GdipLoadImageFromFile With Chinese Characters In The Filename

Posted on 2011-03-16
2
764 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
mapAB Challlenge 35 128
VB6 Compile Compatibility Issue 4 90
vb6 connector to mongodb 2 53
Re-position the objects 7 98
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.
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
The viewer will learn how to implement Singleton Design Pattern in Java.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

867 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

24 Experts available now in Live!

Get 1:1 Help Now