Skip to main content
1-Visitor
May 12, 2021
Question

ProMdlOriginGet return only part of path that contain ASCII symbols.

  • May 12, 2021
  • 4 replies
  • 2049 views
I am using Creo Parametric - Release 7.0 (connected) 7.0 7.0.2.0

ProMdlOriginGet return only part of path that contain ASCII symbols. If model is stored in D:\QAD\цццццц then ProMdlOriginGet will return only D:\QAD

    4 replies

    24-Ruby III
    May 13, 2021

    @ptc-570499 wrote:
    I am using Creo Parametric - Release 7.0 (connected) 7.0 7.0.2.0

    ProMdlOriginGet return only part of path that contain ASCII symbols. If model is stored in D:\QAD\цццццц then ProMdlOriginGet will return only D:\QAD

    Hi,

    please ask PTC Support.

    15-Moonstone
    May 13, 2021

    I haven't tried it myself yet but what type of parameters do you use?
    In the manual it says

    ProMdlOriginGet ( ProMdl handle, ProPath origin )

     

    ProPath is defined as

    typedef wchar_t ProPath[PRO_PATH_SIZE];

     

    Do you handle the contents of ProPath as wchar_t (double byte character) or do you convert it to a single byte character?

     

    Best regards,

        John Bijnens

    1-Visitor
    May 13, 2021

     ProPath origin returned by ProMdlOriginGet do not contain russian symbols in my case, only english

    15-Moonstone
    May 13, 2021

    Perhaps you can find the information you need in the pdf file "tkuse.pdf" which can be found in the toolkit installation folder.
    There is a chapter in it "Introduction to Unicode Encoding".

     

    Have you already tried to look in detail at the contents of the ProPath variable with a debugger?

    If this doesn't help you further it is probably best to contact PTC support.

     

    Best regards,

        John

    RPN
    18-Opal
    May 13, 2021

    Hi, when you write that you don’t see the Russian characters, where does this happen, message line, debug out, … ?

    14-Alexandrite
    May 19, 2021

    I'm guess, you're trying to convert wchar_t to char directly somewhere, like using ProWstringToString. You cannot convert encoding this way. Use WideCharToMultiByte function (or similar)  before applying this wide string value (of ProPath) to other Toolkit function wich consume narrow char (multibyte).

     

    But there may be many aother reasons, e.g. depending on the Character Set of the project, even the encoding of the source files (such as text files and %s vs %w formatting). Hard to guess, if you don't share any information (piece of code e.g.).

     

    ProMdlOriginGet  itself work correctly (example):

    PetrZemanek_0-1621422256386.png

    PZ