• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 289
  • Last Modified:

Delphi Pacifier Form

I have a system which uses Delphi dll's sat on a CAD engine.  On occasions the CAD engine lisp does a lot of processing.

I have an annimated icon on a form I use within the Delphi code but what I need is to be able to display this form from the Lisp code and then keep it displayed until the processing is complete.

Any ideas whether this 1) can be done and 2) how to do it.
0
R_A_Martin
Asked:
R_A_Martin
  • 4
  • 3
2 Solutions
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
why do it from the lisp code ? I have no idea about lisp calling external proc.
But couldn't you display/hide the form before/after running the lisp engine ?
0
 
R_A_MartinAuthor Commented:
You have to call the dll functions from the Lisp code, not the other way round.

I did try creating and displaying a form from the dll, but as soon as you exit the dll function the form closes.

At the moment I am going to use a separate exe which displays just my pacifier form, then control it with windows messages PostMessage ShowWindow etc.

This is not ideal but the tests so far seem to work.
0
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
> I did try creating and displaying a form from the dll, but as soon as you exit the dll function the form closes.
Ok, which means probably that lisp load and unload the dll every time it calls a function. That's strange.
I don't know enough lisp to tell you if there is a way to make sure of that assumption.

> At the moment I am going to use a separate exe which displays just my pacifier form,
> then control it with windows messages PostMessage ShowWindow etc.
Yes, that seems a fair enough workaround. Instead of showwindow/hidewindow, probably that would be better to launch the executable / close it , with 2 functions of your dll. You call them at the begin and end of your lisp code.
The starting function will return the process ID, or the main form handle, used by the closing function, or other functions like setting a progessbar value.

That is probably better than having an application always running, and less problems if you run 2 lisp engine at the same time.
0
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

 
R_A_MartinAuthor Commented:
Thanks for your help.

Lisp only loads the dll's once for each workspace (drawing), they are not unloaded until the CAD engine closes.

I agree with your suggestion to either have the pacifier on or off, only issue I have with that is that sometimes we have a user message part way through a process and in that situation it would be better to be able to hide and show either side of the messagedlg.
0
 
Emmanuel PASQUIERFreelance Project ManagerCommented:
> Lisp only loads the dll's once for each workspace (drawing), they are not unloaded until the CAD engine closes.

Then I see no reason why the form would be closed when exiting a function of the dll, except if you did something wrong within your dll. Can you post the dll source ? the entry points, and creation of the form especially. I don't need to know what you do in your functions, just replace anything that is not related to the form by a comment like
// some treatment here

basically, you can create the form in the load entry point of the dll, destroy it in the unload, and show/hide or change some display within dll functions. That's perfectly normal and I've done that many times
0
 
R_A_MartinAuthor Commented:
The problem I have here is that the Lisp code has a function to load and control the dll, so I cannot really give you the code you need as it's internal.

Perhaps I need to refer it back to the CAD vendor.

Thanks once again
0
 
R_A_MartinAuthor Commented:
Reason for not working was that I had Delphi open with the form in design mode, so the form was found
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now