11.07.2015 Views

WEB-ENABLE POWERBUILDER APPS WITH SYBASE EASERVER ...

WEB-ENABLE POWERBUILDER APPS WITH SYBASE EASERVER ...

WEB-ENABLE POWERBUILDER APPS WITH SYBASE EASERVER ...

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Building an Internationalization Framework Basedon Resource DLLsIn my next article I’ll discuss creating an internationalization frameworkbased on resource DLLs that takes care of translating all window controlsand DataWindow objects, as well as resizing them dynamically at runtime toproperly display internationalized text regardless of its length (which variesfrom language to language). It will also cover the differences between resizingregular window controlsand DataWindow elements,which require a totally differentapproach due to theFIGURE 3FIGURE 4Resource string editorProject setupWindows APIs that areinvolved. I’ll also cover thecoding and layout issuesinvolved in developing internationalizedapplications aswell as a few obscurePowerBuilder issues you needto be aware of in order todeliver a professional, polishedproduct. Currently, weare successfully using such aframework in production,supporting three differentlanguages with more to come.SummaryTo recap, you’ve now seen how to use resource DLLs in PowerBuilder codeand how to create them using the LCC-WIN32 Wedit IDE. In other words, youhave everything you need to start fully integrating resource DLLs into yourapplication and using them as a primary means of internationalization. Again,that’s just one use for resource DLLs. Now that you know how to create and usethem, you have another powerful tool to add to your application developmenttoolkit.Stay tuned and happy internationalization! ▼AUTHOR BIOJacek Furmankiewicz is a PowerBuilder R&D supervisor at the Montreal office of STS Systems, an NSB company.His team is responsible for developing applications for some of the largest retailers in North Americaand Europe. Jacek has been using PowerBuilder since version 4.0 in Sybase, Oracle, and Microsoft SQL Serverenvironments.jfurmankiewicz@stssystems.comListing 1stringls_textunsignedlonglul_dll_handle//fill the string variable with spaces – ALWAYS neededwhen working with Windows APIsls_text = Space(512)//load the DLL into memorylul_dll_handle = This.LoadLibraryA("C:\program files\myapp\french.dll")//make sure the DLL loaded properlyIF lul_dll_handle > 0 THEN//fetch a resource string from it, e.g. string # 1045This.LoadStringA(lul_dll_handle,1045,ls_text,512)//unload the DLL from memoryThis.FreeLibrary(lul_dll_handle)END IF//display the text for resource IDsMessagebox("TEST",ls_text)Download the Code!The code listing for this article can also be located atwww.sys-con.com/ pbdj/www.SYS-CON.COM/pbdj/PBDJ volume9 issue417

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!