question

Sheldon C4 avatar image
0 Likes"
Sheldon C4 asked Phil BoBo edited

dll path error with mandarin chinese

Hi,

I am using customer code with a DLL. If the DLL path contains Mandarin Chinese characters, the DLL file cannot be found.

Example:

// DLL path:  
"D:\測試路徑\AdventurerBoard\AdventurerBoard.dll"  
// << The file cannot be loaded.

// DLL path:  
"D:\AdventurerBoard\AdventurerBoard.dll"  
// << The file can be successfully loaded.

How can I resolve this issue?


FlexSim 24.2.2
module sdkdll
· 9
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Joerg Vogel avatar image Joerg Vogel commented ·
@Sheldon C4, perhaps you can look for a solution in a more general approach in the whole internet. Involved in this are c++, path, path string, chinese characters. I tried this with an AI supported search tool and there has been some answers.
0 Likes 0 ·
Sheldon C4 avatar image Sheldon C4 Joerg Vogel commented ·


But in this case, I just want to connect the DLL in a FlexSim script.


If it were in a C++ environment, I would know how to fix it, but in FlexSim exterally linked, I don’t know how to verify the encoding problem.


No matter whether I input a relative position (e.g., figure 1) or an absolute position (e.g., figure 2), if the DLL path contains Mandarin Chinese characters, it will not connect to the DLL.


below picture

1733907435232.png1733907218310.png


0 Likes 0 ·
1733907218310.png (69.5 KiB)
1733907435232.png (68.5 KiB)
Joerg Vogel avatar image Joerg Vogel Sheldon C4 commented ·
@Sheldon C4, give C++ a try. FlexSim Script language is based on C++.
0 Likes 0 ·
Show more comments
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Sheldon C4,

Thank you for contributing to our community! We couldn't identify a maintained license or subscription linked to your account.

You may need to update your profile information to identify yourself as a license owner or their associate. Check out our article for how to ensure you receive timely support. If you update your profile comment back to let us know - we'll adjust the priority of your post accordingly.

If your current license is expired, please contact your local distributor to renew.

0 Likes 0 ·
Jeanette F avatar image Jeanette F ♦♦ commented ·

Hi @Sheldon C4,

We haven't heard back from you. Were you able to solve your problem? If so, please add and accept an answer to let others know the solution. Or please respond to the previous comment so that we can continue to help you.

If we don't hear back in the next 3 business days, we'll assume you were able to solve your problem and we'll close this case in our tracker. You can always comment back at any time to reopen your question, or you can contact your local FlexSim distributor for phone or email help.

0 Likes 0 ·
Sheldon C4 avatar image Sheldon C4 Jeanette F ♦♦ commented ·

I still haven't been able to resolve this issue. To solve it, I need to determine which C++ file is called by the "externally linked" function, or alternatively, I will need to reverse engineer it myself.

I have contacted the local distributor to discuss this issue and the related licensing matters. However, it appears that finding a solution will not be straightforward in the short term. If any potential solution becomes available, please inform me.

0 Likes 0 ·
Joerg Vogel avatar image Joerg Vogel commented ·
0 Likes 0 ·

1 Answer

Jordan Johnson avatar image
0 Likes"
Jordan Johnson answered Phil BoBo edited

This looks like a bug to me. I suspect we are not handling non-ascii characters in the path correctly. I'll add this issue to the dev list.

· 5
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Phil BoBo avatar image Phil BoBo ♦♦ commented ·

@Sheldon C4 You may also want to use a relative path instead of an absolute path. You can use paths relative to the model or the FlexSim program directory.

I'd also suggest using the Module SDK instead of the DLL Maker.

0 Likes 0 ·
Sheldon C4 avatar image Sheldon C4 Phil BoBo ♦♦ commented ·

To Jordan

Is there any way for me to resolve this issue on my own before the bug is fixed in the new version?

I keep receiving calls from my colleagues asking why the model isn't working, and it’s becoming quite frustrating.


To Phil

Thank you for your suggestions. I will address them in the following two points:

  1. Regarding the use of a relative path
    I used an absolute path to clearly identify the problem. However, the issue persists regardless of whether an absolute or relative path is used.

  2. Module SDK or DLL Maker
    I am using the Module SDK downloaded from the 2024 FlexSim documentation. If there is a version-related issue, please let me know.

Additional Question: Could you clarify the differences between the Module SDK and the DLL Maker? Based on my understanding, the difference is solely related to the version, or are they entirely different products?


1 Like 1 ·
Phil BoBo avatar image Phil BoBo ♦♦ Sheldon C4 commented ·

Without a change to how FlexSim handles loading dlls by path, the way to "resolve this issue on [your] own" is to not use Unicode characters in the path to the dll.

That's one reason why I recommended using the module sdk: it will then find your dll by the name of the module within FlexSim's modules directory rather than an arbitrary path on the computer.

See Module Development

The primary difference between the DLL Maker and the Module SDK is that the Module SDK directly links to FlexSim libraries, which means it has to be updated with the latest version of those libraries for each version of FlexSim. The DLL Maker loads the "dllexport" functions from the application as "dllimport" functions in the dll using their signatures instead of linking directly to the FlexSim libs and using FlexSim headers for function definitions. Because the DLL Maker doesn't link directly, you don't have to recompile your dll for each version of FlexSim.

But the main difference related to this discussion is that module dlls are loaded using a different path mechanism than dll maker dlls, which is why you may be able to resolve your path issue by using a module dll. They're loaded directly from FlexSim's modules folder rather than adding additional paths to the Windows DLL search order, which doesn't seem to be working for Unicode paths based on this discussion.

0 Likes 0 ·
Show more comments