BlueLiquidCell Posted November 21, 2010 Report Posted November 21, 2010 Hey Guys I'm making a programm in Delphi and want to have some function in an dll. In that case the programm should write an frequency to Com1. Something like "WriteCom(12345);" The function includes FSUIPC_Write and FSUIPC_Process. When I have the function in the main programm everything works fine. But when I put it in an dll the FSUIPC_Write returns the Error: "Call cannot execute, link not Open" Anyone who knows the problem and can help me? Thanks
Pete Dowson Posted November 21, 2010 Report Posted November 21, 2010 When I have the function in the main programm everything works fine. But when I put it in an dll the FSUIPC_Write returns the Error: "Call cannot execute, link not Open" I'm assuming this is a DLL loaded by your main program, not an FS loaded DLL? If so I have no idea how you've organised everything, so I can't really comment, but it sounds as if the DLL isn't accessing the same variables defining the link as the main program. It is probably best, in any case, do put all of the FSUIPC access code in one place, in the DLL presumably, including the static library if you are using it. Why not use the Debugger which comes with whatever development system you are using? All the code is in your program, so you should easily be able to track the problem down. And even if you are using the pre-compiled LIB files from the FSUIPC SDK the full source is also provided, so you can trace through that too if you wish to compile it in debug mode. Regards Pete
BlueLiquidCell Posted November 21, 2010 Author Report Posted November 21, 2010 Hey Pete Thanks for the fast reply. I'll try to make it a little bit clearer. I have a large main programm, which starts the FSUIPC Link on startup. I wanted to organize the programm and all the functions. Therefore I wantet to put all functions writing or reading from the FSUIPC Link in an external dll. So I just have to open functions from the main programm and get values from the FS. For example a function called "WriteCom" It gets a 5 digit frequency, converts it to the bdcfreq used in FS and writes it into the FSUIPC Offset. The function works fine execpt for the FSUIPC_Write and FSUIPC_Process parts. :-( Hope it gets a little bit clearer now.
Pete Dowson Posted November 21, 2010 Report Posted November 21, 2010 I have a large main programm, which starts the FSUIPC Link on startup. I wanted to organize the programm and all the functions. Therefore I wantet to put all functions writing or reading from the FSUIPC Link in an external dll. So I just have to open functions from the main programm and get values from the FS. If you are using the static FSUIPC interface library, you'd need to export the variables and procedures defined there so that the DLL can call them. If you combined the library in both the main EXE and the DLL, you have two separate copies of everything, and the one won't have the connection made by the other. The easiest way out of this is to only have the library bound into the DLL, and add functions in the DLL to do your FSUIPC Open and Close calls which you then call from the EXE. If you don't do this you'll need to take the source of the library and work out your own way of exporting the needed variables. You cannot have two separate copies and expect them to operate together, they don't know each other. Regards Pete
BlueLiquidCell Posted November 22, 2010 Author Report Posted November 22, 2010 Hey Putting all in the external dll worked. Thanks for the help! Great programm by the way ;-) Christoph
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now