DLL Release / Free / Unload after Simulation

Please add any feature requests for Flowcode version 6 here

Moderator: Benj

Forum rules
Only feature requests will be considered here. General questions should not be posted in this forum.
Post Reply
Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

DLL Release / Free / Unload after Simulation

Post by Rudi »

Hi

In FC there is a nice Future with call a Makro as a DLL Function.

Is it possible to release the DLL after the simulation,
because the loaded DLL is Release only, if FC is close and restart.

Closing the Project and make a new Project do not release the DLL.



btw:
I found a litle Bug in Dll

If load a Project with DLL Simulation.
After a change in FC Project and save, the DLL is in Background load.

You can test it, make a simple DLL example .. i take Delphi.

library FCtest;
..
..
..
function calc (d1,d2 : Integer) : Integer;stdcall;
begin
result := d1 / d2;
end;
..
..
exports
calc;
..

begin
showmessage('this is showing after FC Project is new saved');
end.


Thank you
Best wishes
Rudi
;-)

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: DLL Release / Free / Unload after Simulation

Post by Rudi »

Hi guys

after 1 1/2 years wait..

any news in this?
is fc unload the dll if start new project in the coming update?

the loaded project dll blocks in new project.
there must allways restart fc for a new project.

this is not windows reason, this can make controlled by the app too.
would be fine if you managed this in fc now.

txs

rudi

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: DLL Release / Free / Unload after Simulation

Post by Benj »

Hi Rudi,

Sorry for the delay.

I've looked into this and it looks like the DLL macros can be called at any time, even when the simulation is stopped.

For example you can have a property event change macro which in turn calls a DLL macro.

So it looks like for now the best way to unload the DLL is to close Flowcode or open another project. If opening a new project or an existing project that doesn't call the DLL then it should be unloaded. If this doesn't happen then it sounds like a bug.

Rudi
Posts: 666
Joined: Mon Feb 10, 2014 4:59 am
Has thanked: 493 times
Been thanked: 187 times

Re: DLL Release / Free / Unload after Simulation

Post by Rudi »

Hi Benj

txs for response!!
no hurry - but will be fine if this will gone one time ;-)
Benj wrote: Sorry for the delay.
no problem benj!
Benj wrote:
I've looked into this and it looks like the DLL macros can be called at any time, even when the simulation is stopped.
..
yes you are right..
Benj wrote:
So it looks like for now the best way to unload the DLL is to close Flowcode or open another project. If opening a new project or an existing project that doesn't call the DLL then it should be unloaded. If this doesn't happen then it sounds like a bug.
the last - this is the fall/problem benj, the dll is only unload if fc will be close, and reopen.
if you change the project ( project with dll..close, open new project ) the dll is still loaded.

btw but i can live with this..:
if a project has a dll, if open the project ( only load the project nothing do more ) the dll is load with the project.
if the dll has a function "on load" then this function will be call without a makro call at this step/time.
this is ok - but this is not correct 100 procent, because, the dll is call in a step and in a macro, then the dll must load..
but i can live with this. this is a little and not so important.

btw example:
you have a showmessage function in the dll if dll is load.
this showmessage is call if the project with the dll is loaded ( without the macro in this step )
if the showmessage has a timer for unshow then fc processing is..."disturbed"
if this is a "license hint" and wait for a user push" then it can be, that the processing "freezes".
so i change this to not show if dll will load, i changed this with a tag - if a function is called, the tag will check,
if the message was not showed, then the message now show, if the messages was showed ontime, the tag is 0, then
no message comes again...


benj, the first, dll is only unload if fc is close and reopen is not so good.

example:
you develop/debug a dll
then make compile,
then make the dll, example in a fc project folder, example dll-project. name: test.dll

then start fc
then create a project
then insert a icon macro for dll call and load the test.dll from project folder
then run the project
ok.

now the dll is loaded and will be loaded.

example if you change the project
the dll is not unload, this is the problem.

example
if you want create a new function in the dll now in your develop
and try to make compile, the dll is loaded by fc and allow not to override the test.dll
if fc is close, then the dll ( test.dll ) is unload and given free,
now you can compile again the dll.

then must restart fc.

if you make 25x and more start/restart fc ...for develop a dll ..
'crazy' 'horror' ;-) ;-)

..

i hope i have wrote right in english..

best wishes

;-)

rudi ;-)


workaround:
i can shot the dll over handle ( not process manager ), but fc then make a "Protection Fault" - this is normal, because handle is missing then if fc is close.

Post Reply