question

Jason Z avatar image
1 Like"
Jason Z asked Phil BoBo edited

Can Flexsim call a third party dll?

I used to call a dll (named A.dll) which was written by myself in Flexsim, and the A.dll was invoked successfully. However, if I added extra some code in A.dll, which command the A.dll to call B.dll that was written by another programmer (B.dll was not written in the grammar that flexsim specified) , A.dll can not be invoked successfully.

Can Flexsim call a third party dll? Or, in another way, should the B.dll also be written in the grammar that flexsim specified?

dll
5 |100000

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

1 Answer

·
Phil BoBo avatar image
1 Like"
Phil BoBo answered Phil BoBo edited

Yes, you can call a third party dll from a dll built with the FlexSim DLL Maker. That will work just fine.

If you are having trouble with doing that, then you'll need to post more information so that we can duplicate the issue you are having to explain why it is happening. In general, that procedure works fine.

· 7
5 |100000

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

Jason Z avatar image Jason Z commented ·

Thank you for your timely reply. But I still don't know whether the third party DLL should be written with Flexsim DLL maker.

0 Likes 0 ·
Phil BoBo avatar image Phil BoBo ♦♦ Jason Z commented ·

No, it doesn't have to be. Hence: third party DLL. It can come from wherever.

For example, the FlexSim Emulation Module dll connects with various connectivity dlls from third parties, such as libmodbus.dll and OTBx64.dll (the Softing OPC Toolkit).

2 Likes 2 ·
Jason Z avatar image Jason Z Phil BoBo ♦♦ commented ·

Thank you for your detailed explanation. This is my code. I want to know how to call third-party DLLS statically. Picture 1 shows the header code and static library. Picture 2 is the function that calls the DLL. I really appreciate your help!

0 Likes 0 ·
Show more comments

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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