User Tag List

Results 1 to 9 of 9

Thread: Problem translating extension to UNICODE

  1. #1
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,561
    Mentioned
    257 Post(s)
    Tagged
    4 Thread(s)

    Problem translating extension to UNICODE

    Hi,

    i am trying to convert the webobject extension to UNICODE, but i need some clarification.

    1.- There is any SDK for UNICODE?

    2.- i have doubt concerning the following functions that use LPSTR,


    UpdateFileNames

    void WINAPI DLLExport UpdateFileNames(mv _far *mV, LPSTR appName, LPEDATA edPtr, void (WINAPI * lpfnUpdate)(LPSTR, LPSTR))

    LoadObject
    ImageFilters ____ this one i check and is defined with LPCSTR
    GetDebugItem
    SetTextFont
    GetTextFont

    also the menu function as GetConditionString, i check and can be changed

    It is a rules that i can change LPSTR to LPTSTR and LPCSTR to LPCTSTR?


    3.- The following function belong to Webobject

    long WINAPI DLLExport GetTitle(LPRDATA rdPtr, long param1)
    {
    LPTSTR ret=0;

    ret = (LPTSTR)callRunTimeFunction(rdPtr, RFUNCTION_GETSTRINGSPACE, 0, 1024);

    rdPtr->rHo.hoFlags |= HOF_STRING;

    if(ret)
    {

    ret = (LPTSTR)WebformTitle(rdPtr->hwebf);
    if(ret)
    return (long)ret;
    }
    return (long)_T("");


    }

    I know for sure that works with LPSTR or char*, but seems not to work with LPTSTR, i am doing something wrong?, does RFUNCTION_GETSTRINGSPACE only works with STR?


    Thanks in advance for your help

    Regards,

    EDIT: Thanks for moving this post, after i submit, i realized that i was in the wrong subject forums, my apologies
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  2. #2
    Firecodemonkey

    Join Date
    Aug 2006
    Location
    London, UK
    Posts
    461
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem translating extension to UNICODE

    RFUNCTION_GETSTRINGSPACE allocates a block of memory, nothing more. (Number of bytes is the second argument, so maximum length of a Unicode string is half of that.)

    However, your code doesn't even use the buffer allocated by the function!

    The error is definitely in the WebformTitle function.

  3. #3
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,631
    Mentioned
    229 Post(s)
    Tagged
    3 Thread(s)

    Re: Problem translating extension to UNICODE

    There is a temporary Unicode SDK that I've quickly made some time ago, but it's not 100% checked & completed. Look at UnicodeSDK.txt in the Extensions folder.

  4. #4
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,561
    Mentioned
    257 Post(s)
    Tagged
    4 Thread(s)

    Re: Problem translating extension to UNICODE

    Hi ChrisB and Yves,

    No, i forgot to mention that i return successfully from the function with the correct value (WebformTitle and all function from webbrowser and DOM are original in Wide and translated according _UNICODE flag), the problem occurs after return (long ret point to the string) so is not my function (also is the same function from version 1.0).


    BIG THANKS Yves i will download the SDK and read all to learn how it is done.

    I let you know if i have any further problem.

    Thx again,

    Regards
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  5. #5
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,561
    Mentioned
    257 Post(s)
    Tagged
    4 Thread(s)

    Re: Problem translating extension to UNICODE

    Hi,

    I complete all changes required for UNICODE/_UNICODE, so webobject can be ported but at the end i receive the following error

    1>Generating Code...
    1>Compiling resources...
    1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
    1>Copyright (C) Microsoft Corporation. All rights reserved.
    1>Linking...
    1> Creating library .\Release/Template.lib and object .\Release/Template.exp

    1>Main.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) int __stdcall ExportImageW(class CImageFilterMgr *,wchar_t const *,class cSurface *,unsigned long)" (__imp_?ExportImageW@@YGHPAVCImageFilterMgr@@PB_WP AVcSurface@@K@Z) referenced in function "short __stdcall DoImageURL(struct tagRDATA *,long,long)" (?DoImageURL@@YGFPAUtagRDATA@@JJ@Z)
    1>.\Unicode_Release/KcWebX.mfx : fatal error LNK1120: 1 unresolved externals
    1>Build log was saved at "file://c:\Users\fernando\Documents\MMF2\MMF2SDK\Extension s\KcWebX\Unicode Release\BuildLog.htm"
    1>KcWebX_F - 2 error(s), 0 warning(s)
    ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    i did verify ImgFlt.h and everything seems ok,

    DLLExport32 BOOL WINAPI ExportImageA(CImageFilterMgr* pImgMgr, LPCSTR pFileName, cSurface* psf, DWORD dwFilterID);

    DLLExport32 BOOL WINAPI ExportImageW(CImageFilterMgr* pImgMgr, LPCWSTR pFileName, cSurface* psf, DWORD dwFilterID);

    (in each case, under MSVC2008, i see enable and according the preproccesor flags)

    NOTE: using the mmfs2.lib of date 10-11-2009, dd-mm-yyyy present in MMF2SDK_UNICODE

    ALSO I compiled the ansi version with the new includes and lib with no problem

    but no success with UNICODE(s) flags

    What could be the problem?, does the function exist inside the lib?


    Thx in advance
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  6. #6
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,561
    Mentioned
    257 Post(s)
    Tagged
    4 Thread(s)

    Re: Problem translating extension to UNICODE

    Hi,

    Just to mention this case was resolved.

    The error that appeared in the ExportImage related to ERROR LNK2019 function was related to the flag / Zc: wchar_t in the projects and the SDK template the value is YES, but in my case the right way is NO.

    Regards,
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  7. #7
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleHTML5 Export ModuleSWF Export ModuleUnicode Add-onInstall Creator Pro

    Join Date
    Apr 2008
    Posts
    421
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Problem translating extension to UNICODE


    Hi FVivolo,


    >>>Just to mention this case was resolved<<<

    I am very happy that you could find and resolve the problem. I know very well how frustrating is otherwise.

    Best Regards

  8. #8
    Clickteam Clickteam
    Fernando's Avatar
    Join Date
    Dec 2006
    Posts
    6,561
    Mentioned
    257 Post(s)
    Tagged
    4 Thread(s)

    Re: Problem translating extension to UNICODE

    Indeed!!!

    Thx Ham
    Regards,


    Fernando Vivolo

    ... new things are coming ...

  9. #9
    Clickteam Clickteam

    Join Date
    Jun 2006
    Location
    France
    Posts
    13,631
    Mentioned
    229 Post(s)
    Tagged
    3 Thread(s)

    Re: Problem translating extension to UNICODE

    Ah yes, I forgot to mention it in the explanations.

    If you use MSVC++ 2005 or above you have to set the "Threat wchar_t as Built-in Type" option to "No" in the C++ / Language settings of the project otherwise you'll get link errors if you use functions with text parameters in the DLL.

Similar Threads

  1. Unicode Crashes with LOS Extension
    By iamjot in forum Unicode Export Module Version 2.0
    Replies: 4
    Last Post: 24th May 2012, 08:14 AM
  2. a Unicode extension for MMF2 Dev HWA?
    By ionside in forum Extension Development
    Replies: 3
    Last Post: 9th December 2010, 10:09 PM
  3. Problem translating extension to UNICODE
    By Fernando in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 2nd December 2010, 11:35 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •