Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Using GeLoadString to load description string

    SDK Help
    0
    20
    1.5k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      On 17/02/2014 at 08:09, xxxxxxxx wrote:

      When using GeLoadString(), you must put the string in the c4d_strings.str file, not your custom plugin file, at least it is so in accordance with my experience.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        On 17/02/2014 at 08:20, xxxxxxxx wrote:

        I put it in c4d_strings.str, but still strNotFound is returned.
        The file is allocated here:
        D:\Program Files\MAXON\CINEMA 4D R15\plugins\solar system kit v10\res\strings_us
        Is that correct?
        Should ABOUT have an ID, different than the resource id?

        // C4D-StringResource
        // Identifier	Text
          
        STRINGTABLE
        {
          ABOUT " Build 01024";
          }
        
        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          On 17/02/2014 at 08:33, xxxxxxxx wrote:

          Have you assigned an enumeration to ABOUT in the c4d_symbols.h file?

          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

            On 17/02/2014 at 08:54, xxxxxxxx wrote:

            I did now, what nothing yet.
            It is recognized by vs, because when I hoover over it tells me:
            enum <unnamed> :: IDS_ABOUT = 10002

            enum
            {
            	// string table definitions
            	IDS_GRADIENTTITLE	= 10000,
            	IDS_TYPE,
                IDS_ABOUT,
                
            // End of symbol definition
            	_DUMMY_ELEMENT_
            };
            
            1 Reply Last reply Reply Quote 0
            • H
              Helper
              last edited by

              On 17/02/2014 at 09:03, xxxxxxxx wrote:

              And you will need to use IDS_ABOUT in your references.  Realize that IDS_ABOUT may already be defined by C4D.  Use something unique like IDS_ABOUT_MYPLUGIN to avoid confusion during compilation and execution.

              1 Reply Last reply Reply Quote 0
              • H
                Helper
                last edited by

                On 17/02/2014 at 10:23, xxxxxxxx wrote:

                Thanks, it is working now.
                So if you have different languages, you must get the LanguageID and set you string accordingly.
                So for example, IDS_ABOUT_US, IDS_ABOUT_DE, etc.?

                1 Reply Last reply Reply Quote 0
                • H
                  Helper
                  last edited by

                  On 17/02/2014 at 15:18, xxxxxxxx wrote:

                  No, just use a different file for the strings, the ID is the same.

                  1 Reply Last reply Reply Quote 0
                  • H
                    Helper
                    last edited by

                    On 18/02/2014 at 02:09, xxxxxxxx wrote:

                    sorry, I do not think so.

                    The res files are language dependent, but c4d_strings.str is not language dependent?

                    1 Reply Last reply Reply Quote 0
                    • H
                      Helper
                      last edited by

                      On 18/02/2014 at 02:50, xxxxxxxx wrote:

                      The whole purpose (at least some of it) if using IDs, is that the IDs remain, you just use different language (strings) files.

                      1 Reply Last reply Reply Quote 0
                      • H
                        Helper
                        last edited by

                        On 18/02/2014 at 03:37, xxxxxxxx wrote:

                        IMO that is correct for .str as part of the resource files.
                        I am now using c4d_symbols.h and c4d_symbols.str, not part of the resource files.
                        I guess that is the only way to use GeLoadString(id)?

                        I also wonder about c4d_symbols.h and c4d_symbols.str. What is the use of them when you have resource files?

                        1 Reply Last reply Reply Quote 0
                        • H
                          Helper
                          last edited by

                          On 18/02/2014 at 03:59, xxxxxxxx wrote:

                          Hi, others here are certainly better to answer this, but I know this much:
                          Look at the folder yourplugin/res/strings_us
                          In this folder you put US English strings.
                          You will have other folders for other languages, of course.
                          The c4d_symbols.str is for strings independent of your classes, "global strings" if you like.
                          The other, class specific strings, have their own *.h, *.cpp, *.res, *.str files.

                          1 Reply Last reply Reply Quote 0
                          • H
                            Helper
                            last edited by

                            On 18/02/2014 at 04:35, xxxxxxxx wrote:

                            Ok, but I thought based on the replies in this post, that GeLoadString(id) only works with c4d_symbols.h and c4d_symbols.str?

                            1 Reply Last reply Reply Quote 0
                            • H
                              Helper
                              last edited by

                              On 18/02/2014 at 04:43, xxxxxxxx wrote:

                              Class-specific strings are automatically loaded with Register...() for your plugin and are associated with its descriptions directly.  Global strings need to use GeLoadString() wherever needed because there is no direct association (in a dialog or the console or statusbar etc.).

                              1 Reply Last reply Reply Quote 0
                              • H
                                Helper
                                last edited by

                                On 18/02/2014 at 04:47, xxxxxxxx wrote:

                                Ok, thanks.

                                Conclusion: Global strings need to use GeLoadString() and are defined in c4d_symbols.h and c4d_symbols.str and are in only one language (not langugae dependent).

                                1 Reply Last reply Reply Quote 0
                                • H
                                  Helper
                                  last edited by

                                  On 18/02/2014 at 06:10, xxxxxxxx wrote:

                                  Originally posted by xxxxxxxx

                                  Conclusion: Global strings need to use GeLoadString() and are defined in c4d_symbols.h

                                  Yes

                                  Originally posted by xxxxxxxx

                                  and c4d_symbols.str and are in only one language (not langugae dependent).

                                  No

                                  1 Reply Last reply Reply Quote 0
                                  • H
                                    Helper
                                    last edited by

                                    On 18/02/2014 at 08:56, xxxxxxxx wrote:

                                    Originally posted by xxxxxxxx

                                    Ok, thanks. Conclusion: Global strings need to use GeLoadString() and are defined in c4d_symbols.h and c4d_symbols.str and are in only one language (not langugae dependent).

                                    Incorrect, c4d_strings.str is _inside_ the folder strings_us so all you do is create another c4d_strings.str in a different language and make sure it is in the correct folder for that language. AIUI Cinema will use the correct one when you call GeLoadString().

                                    1 Reply Last reply Reply Quote 0
                                    • H
                                      Helper
                                      last edited by

                                      On 18/02/2014 at 09:24, xxxxxxxx wrote:

                                      Originally posted by xxxxxxxx

                                      Originally posted by xxxxxxxx

                                      Ok, thanks. Conclusion: Global strings need to use GeLoadString() and are defined in c4d_symbols.h and c4d_symbols.str and are in only one language (not langugae dependent).

                                      Incorrect, c4d_strings.str is _inside_ the folder strings_us so all you do is create another c4d_strings.str in a different language and make sure it is in the correct folder for that language. AIUI Cinema will use the correct one when you call GeLoadString().

                                      As noted, you can support any of the languages which Cinema 4D supports by creating the proper folder for the c4d_symbols.str files (strings_us for English, strings_de for German, strings_fr for French, strings_es for Spanish, etc.).  You use the same IDs but the strings are in another language.

                                      You need to use four-character escape UNICODE to add foreign characters - for instance, \u00a9 is the Copyright symbol.  You can find UNICODE PDFs online.

                                      Finally, to support other languages for direct-string plugins, you use the same folder but put the .str file in a 'description' subfolder, i.e.:

                                      strings_us
                                      --- c4d_symbols.str
                                      --- description
                                      ------ OmyObjPlugin.str

                                      1 Reply Last reply Reply Quote 0
                                      • H
                                        Helper
                                        last edited by

                                        On 18/02/2014 at 11:57, xxxxxxxx wrote:

                                        Originally posted by xxxxxxxx

                                        Incorrect, c4d_strings.str is _inside_ the folder strings_us so all you do is create another c4d_strings.str in a different language and make sure it is in the correct folder for that language. AIUI Cinema will use the correct one when you call GeLoadString().

                                        Thanks, that makes sense.

                                        1 Reply Last reply Reply Quote 0
                                        • H
                                          Helper
                                          last edited by

                                          On 18/02/2014 at 12:05, xxxxxxxx wrote:

                                          Originally posted by xxxxxxxx

                                          You need to use four-character escape UNICODE to add foreign characters - for instance, \u00a9 is the Copyright symbol.  You can find UNICODE PDFs online.

                                          Thanks, valuable information.

                                          1 Reply Last reply Reply Quote 0
                                          • First post
                                            Last post