dll path error with mandarin chinese

dll path error with mandarin chinese

sheldon_c4
Not applicable
761 Views
16 Replies
Message 1 of 17

dll path error with mandarin chinese

sheldon_c4
Not applicable

[ FlexSim 24.2.2 ]

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?


0 Likes
Accepted solutions (1)
762 Views
16 Replies
Replies (16)
Message 2 of 17

joerg_vogel_HsH
Mentor
Mentor
@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
Message 3 of 17

sheldon_c4
Not applicable


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
Message 4 of 17

joerg_vogel_HsH
Mentor
Mentor
@Sheldon C4, give C++ a try. FlexSim Script language is based on C++.
0 Likes
Message 5 of 17

Jeanette_Fullmer
Community Manager
Community Manager

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
Message 6 of 17

sheldon_c4
Not applicable

Does any document writing about "how to writing C++ in externally linked or any where"?

I try to writing C++ in externally linked, but it didn't work.

0 Likes
Message 7 of 17

joerg_vogel_HsH
Mentor
Mentor
You have been asking questions about SDK for two years. It is a C++ environment. Flexscript works in this same environment. Then work arounds of common C++ are suitable solutions for problems. Since you seems to be an expert in this field more than I am, I am ending this conversation. I hope you get answers. Good luck.
0 Likes
Message 8 of 17

Jeanette_Fullmer
Community Manager
Community Manager

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
Message 9 of 17

sheldon_c4
Not applicable

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
Message 10 of 17

JordanLJohnson
Autodesk
Autodesk
Accepted solution

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.

.


Jordan Johnson
Principal Software Engineer
>

0 Likes
Message 11 of 17

philboboADSK
Autodesk
Autodesk

@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.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 12 of 17

sheldon_c4
Not applicable

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?


Message 13 of 17

philboboADSK
Autodesk
Autodesk

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.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 14 of 17

joerg_vogel_HsH
Mentor
Mentor
0 Likes
Message 15 of 17

sheldon_c4
Not applicable

I use model sdk is the same consequent, Actually I rebuilt it in the clear windows environment, but it still didn't work.


I follow the user manure module sdk > quick start download module_template.zip, and follow the direction to set up module SDK, but if the path with mandarin Chinese it still can't found the dll file.

If the problem can't solve by user, please let me know it will be up date in which revision, I will let my college know.


I used the model SDK in the same way as before. In fact, I even rebuilt it in a clean Windows environment, but the issue still persists.

I followed the user manual for the [module SDK > quick start] by downloading module_template.zip from the Quick Start section and setting up the module SDK according to the provided instructions. However, if the file path contains Mandarin Chinese characters, the DLL file still cannot be found.

If this issue cannot be resolved by the user, please inform me in which revision it will be updated, so I can notify my colleagues accordingly.

0 Likes
Message 16 of 17

philboboADSK
Autodesk
Autodesk

However, if the file path contains Mandarin Chinese characters, the DLL file still cannot be found.

That's expected. That's what this whole post is about.

As I've already explained above, the whole purpose of recommending using the Module SDK is to AVOID using Unicode characters in the path. Stop using Mandarin Chinese characters in the path if you want to load the dll!

If you want to load a DLL, then DON'T use Unicode characters in the path. Reference the DLL using the Module SDK, the same as the rest of the modules in FlexSim do, such as Conveyor.dll, AStar.dll, and ProcessFlow.dll, which are referenced using the syntax explained in the documentation linked above and shown in the image below.

1737591997439.png

However, if the file path contains Mandarin Chinese characters, the DLL file still cannot be found.

If this issue cannot be resolved by the user, please inform me in which revision it will be updated, so I can notify my colleagues accordingly.

It can be resolved by the user by NOT using Mandarin Chinese characters in the file path.



Phil BoBo
Sr. Manager, Software Development
0 Likes
Message 17 of 17

jonah_kendellR47TC
Autodesk
Autodesk
This has been fixed in version 24.0.10 released today.
0 Likes