Unicode with VPE 3.6

Knowledge exchange related to the VPE Report Engine and PDF Library

Moderator: IDEAL Software Support

Unicode with VPE 3.6

Postby Uwe Keim » Mon Oct 24, 2005 11:06 am

In my project, I just replaced VPE 3.5 with VPE 3.6.

My application runs on Windows XP and is compiled as Unicode (i.e. all internal strings are UTF-16).

Now when calling VPE 3.5 the string parameters of VPE were CHARs (or CHAR-pointers). I converted my unicode strings to ansi strings and passed them to VEP 3.5.

With version 3.6, the parameters of VPE are now TCHARs (or TCHAR-pointers). Therefore I do not need to convert them to ansi strings anymore.

But what happens? When printing a document, only the very first character of a string is printed.

I believe this is due to the fact that VPE 3.6 still interprets the passed strings falsely as ansi and sees the zero upper byte of the second TCHAR in the passed string as the terminating zero.

Question: Could you please comment on this? Is this an issue? Or am I doing something wrong here? Can I work-around this issue somehow?

Thanks
Uwe
Uwe Keim
 
Posts: 12
Joined: Mon Oct 24, 2005 9:26 am
Location: Germany, BW, Göppingen

Postby Uwe Keim » Mon Oct 24, 2005 11:21 am

OK, I did the following workaround (but I feel this is rather a hack than something really usable):

- I converted my internal TCHAR-UTF-16-strings to CHAR-ANSI-strings.
- I passed those CHAR-ANSI-strings with a reinterpret_cast<TCHAR*>() to the VPE-functions.

This works, except that special characters that are only contained within UTF-16 are not being rendered, of course.

There must be a real fix for this, I strongly hope!
Uwe Keim
 
Posts: 12
Joined: Mon Oct 24, 2005 9:26 am
Location: Germany, BW, Göppingen

Postby IDEAL Software Support » Mon Oct 24, 2005 3:19 pm

You are talking about the DLL interface. In fact the parameters of type LPSTR or LPCSTR have been changed to LPTSTR and LPCTSTR for future enhancements.

However, the DLL is still compiled as ANSI version, therefore you can not pass UNICODE strings directly to VPE.

Regards
Thorsten Radde
IDEAL Software GmbH
IDEAL Software Support
 
Posts: 1621
Joined: Thu Nov 18, 2004 4:03 pm


Return to VPE Open Forum

Who is online

Users browsing this forum: No registered users and 16 guests