Solved

Calling GdipLoadImageFromFile With Chinese Characters In The Filename

Posted on 2011-03-16
2
785 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
How to remove superseded packages in windows w60 or w61 installation media (.wim) or online system to prevent unnecessary space. w60 means Windows Vista or Windows Server 2008. w61 means Windows 7 or Windows Server 2008 R2. There are various …
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.
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…

752 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