Solved

Calling GdipLoadImageFromFile With Chinese Characters In The Filename

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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

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.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

840 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