ATTENTION

This FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices.


flexsim.com

Go Back   FlexSim Community Forum > FlexSim Software > Q&A
Downloads

Q&A Using Flexsim and building models

  #1  
Old 04-19-2013
Ramesh Pinn Ramesh Pinn is offline
Flexsim User
 
Join Date: Oct 2012
Location: Tampa, FL
Posts: 16
Downloads: 0
Uploads: 0
Thanks: 12
Thanked 2 Times in 2 Posts
Rep Power: 93
Ramesh Pinn is on a distinguished road
Question DLL reference path

I am currently working on incorporating DLLs into my model. However, I am facing the following issue:

Lets say I have 2 DLLs - DLLA.dll and DLLB.dll. DLLA calls DLLB at runtime. Both DLLs reside in a folder, lets say, C:\DLLFolder. When I call DLLA from FlexSim (by providing the above path), it fails to load as DLLB is not found. It loads correctly only when DLLB is in one of the paths where FlexSim looks. For example, <FlexSim installation folder>/program or folder where the model is saved.

I would like to know if there is a way to add a path that FlexSim can look at when it deals with DLLs?

I am attaching a test solution (VS2010) that will essentially replicate this scenario.

1. Extract attached zip file.

2. Open solution inside DLLMaker folder. This solution creates 2 dlls – DllMaker.dll and DLLB.dll once the solution is built successfully.

3. DllMaker is called from FlexSim with an input as shown in testDLLCall.fsm. DllMaker will in turn call DLLB. However, if DLLB is not in the same folder where testDLLCall.fsm, FlexSim will report DllMaker failed to load.

Thanks in advance.
Attached Files
File Type: zip DLL Maker.zip (102.4 KB, 75 views)
File Type: fsm testDLLCall.fsm (52.0 KB, 70 views)
  #2  
Old 04-19-2013
Anthony Johnson's Avatar
Anthony Johnson Anthony Johnson is offline
Manager of Product Development
 
Join Date: Jul 2007
Posts: 440
Downloads: 86
Uploads: 4
Thanks: 171
Thanked 899 Times in 288 Posts
Rep Power: 735
Anthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond reputeAnthony Johnson has a reputation beyond repute
Default

Unfortunately I don't think there's a way to customize the windows search order dynamically at run-time. I usually refer to this msdn topic to figure out what can be done.
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
The Following User Says Thank You to Anthony Johnson For This Useful Post:
Ramesh Pinn (04-22-2013)
  #3  
Old 04-19-2013
Ramesh Pinn Ramesh Pinn is offline
Flexsim User
 
Join Date: Oct 2012
Location: Tampa, FL
Posts: 16
Downloads: 0
Uploads: 0
Thanks: 12
Thanked 2 Times in 2 Posts
Rep Power: 93
Ramesh Pinn is on a distinguished road
Default

Quote:
Originally Posted by Anthony Johnson View Post
Unfortunately I don't think there's a way to customize the windows search order dynamically at run-time. I usually refer to this msdn topic to figure out what can be done.
http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
Thanks for the response Anthony.

From the article in the link, it says dlls in the windows PATH variable should work. I tried that by copying the DLLB to system32 folder. Still have the same issue. Any idea on what I am doing wrong?
  #4  
Old 04-19-2013
Ramesh Pinn Ramesh Pinn is offline
Flexsim User
 
Join Date: Oct 2012
Location: Tampa, FL
Posts: 16
Downloads: 0
Uploads: 0
Thanks: 12
Thanked 2 Times in 2 Posts
Rep Power: 93
Ramesh Pinn is on a distinguished road
Default

Quote:
Originally Posted by Ramesh Pinn View Post
Thanks for the response Anthony.

From the article in the link, it says dlls in the windows PATH variable should work. I tried that by copying the DLLB to system32 folder. Still have the same issue. Any idea on what I am doing wrong?
I am able to get this working by placing the DLLs in Windows\SysWOW64 folder. Since I am using a 64-bit OS, apparently Microsoft in all its wisdom decided to that SysWOW64 folder is the place to hold all 32-bit DLLs while system32 will host 64-bit dlls. Read this for more information on Microsoft's amazingly intuitive naming conventions: http://www.forceflow.be/2012/04/04/t...indows-64-bit/


Thread Thread Starter Forum Replies Last Post
By value or by reference Shahin Gelareh Q&A 0 03-09-2012 03:22 AM
how to get a reference to currently active task LINWEIXU Q&A 1 09-28-2011 11:42 PM
Reference to Item in Processor from OnBreakDown Trigger Eike Schulz Q&A 1 06-02-2011 02:57 PM
Where can I find Programming Language Reference ? Robert Liu Q&A 3 10-26-2009 02:40 AM
Get view reference AlanZhang Q&A 3 03-13-2008 08:51 AM


All times are GMT -6.
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Copyright 1993-2018 FlexSim Software Products, Inc.