* * *

Author Topic: Compiling a .dll  (Read 46136 times)

paul_H

  • New member
  • *
  • Posts: 13
Compiling a .dll
« Reply #15 on: March 13, 2006, 11:44:25 pm »
Tried the Forms and Application.Initialize - no luck enabling the buttons.

What is a VST plugin?

In the context of object pascal (Delphi). This is one of the most popular resources.

http://www.tobybear.de/d_template.html

I'm done for tonight.

Thanks for your help so far. :)

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Compiling a .dll
« Reply #16 on: March 14, 2006, 12:07:28 pm »
Quote from: "duncanparsons"
VST and Delphi go very well together.


GREAT !

Were you actually able to create a VST plugin in Dephi that has a GUI and that sends and receives MIDI and and audio data ?

-Michael

mschnell

  • Full Member
  • ***
  • Posts: 131
    • http://www.lumino.de
Compiling a .dll
« Reply #17 on: March 14, 2006, 12:21:45 pm »
Quote from: "paul_H"
LCL is probably not acceptable in a VST plugin application.


But the Delphi VCL is ?!?!?!?!

-Michael

Phil

  • Hero Member
  • *****
  • Posts: 2650
Compiling a .dll
« Reply #18 on: March 14, 2006, 03:27:42 pm »
Quote from: "mschnell"
Quote from: "paul_H"
LCL is probably not acceptable in a VST plugin application.


But the Delphi VCL is ?!?!?!?!

-Michael


I believe the issue here is that the LCL just doesn't work in a library. I haven't tested this on OS X or Linux, but it definitely doesn't work with Windows. The library application "runs", but the GUI is completely unresponsive.

With Delphi, not only does the library application run perfectly, but if you pass the main executable's window handle to the DLL and assign it to the DLL's Application.Handle, the DLL form becomes essentially part of the main program's GUI.

Too bad the LCL doesn't support this powerful feature. Should this be posted as a bug?

Does anyone have any experience using LCL in libraries on OS X or Linux?

duncanparsons

  • Jr. Member
  • **
  • Posts: 83
Compiling a .dll
« Reply #19 on: March 14, 2006, 04:43:55 pm »
Quote from: "mschnell"
Quote from: "duncanparsons"
VST and Delphi go very well together.


GREAT !

Were you actually able to create a VST plugin in Dephi that has a GUI and that sends and receives MIDI and and audio data ?

-Michael


There are quite a number of Delphi VST plugs around.. I've written a few free plugs available at  BetaBugsAudio. I'm mid way through a number of ideas.. the link above for Tobybear is full of delphi audio as well..

it would be great if LCL could be made to work in a dll. It would benefit not just VST, but any plugin writers for any app.

I hope this can be resolved

:)

DSP

paul_H

  • New member
  • *
  • Posts: 13
Compiling a .dll
« Reply #20 on: March 14, 2006, 05:01:51 pm »
Ditto Duncan

Quote from: "paul_H"

P.S. Not using LCL is probably not acceptable in a VST plugin application.


The original quote was as above. It has been miss-quoted in the last few posts.

Quote from: "Phil"
With Delphi, not only does the library application run perfectly, but if you pass the main executable's window handle to the DLL and assign it to the DLL's Application.Handle, the DLL form becomes essentially part of the main program's GUI.


What you describe, I believe, is almost precisely how a VST plug-in is working inside its host application.

LCL is essential for a VST plugin otherwise there is no point to using Pascal (Delphi or Lazarus).

If LCL does not work in a library, as VCL obviously does in Delphi, then this rules Lazarus out as an option for making plugins of any kind that make use of a user interface.

I would tend to suggest, if true, this is either a bug or oversight. I would be happy to see it fixed.

duncanparsons

  • Jr. Member
  • **
  • Posts: 83
Compiling a .dll
« Reply #21 on: March 14, 2006, 06:11:49 pm »
Are there other libraries that could be used - gtk, etc?

Would that be an option? What dependecies would that cause?

AFAIK LCL (like the VCL) binds into an file and shouldn't have any other dependencies (VCL packages excluded here). Does gtk have that kind of dependency?

There must be a method by which LCL will fire up..

I'll start to have aproper play now. I'm installing at home as well as at work!

DSP

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3537
Compiling a .dll
« Reply #22 on: March 15, 2006, 02:44:43 am »
Quote from: "duncanparsons"
Are there other libraries that could be used - gtk, etc? Would that be an option?


Another option is locate what is the problem with LCL on DLLs. You could try a simple example, like showing a message box and see what is the difference between what LCL does and what VCL does.

Gtk is an option, but be aware that there are some issues with it:

* No RAD (This is irrelevant to a component)

* Only really good on Linux, it´s quite bad on Windows due to bugs and on Mac OS X due to requiring X11 and Fink (read: needs to be compiled from source, cannot be downloaded as binary)

* Hard to use. Beliave me, it´s very hard to use Gtk, it was a pain to write a simple component like TTrayIcon. With Windows API I took 2 hours. With Gtk I took 2 weeks. Add poor documentation to that.

* Your existing VCL code won´t work with it. You will need to rewrite

Qt is much easier to use and much better documented, but is only free for GPL software and is quite expensive.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3537
Compiling a .dll
« Reply #23 on: March 15, 2006, 02:46:17 am »
Quote
AFAIK LCL (like the VCL) binds into an file and shouldn't have any other dependencies (VCL packages excluded here). Does gtk have that kind of dependency?


LCL is linked inside your software and calls a native library to do the work.

Gtk is a external library. (the installer of the runtime has 4MBs on Windows)

CWBudde

  • New member
  • *
  • Posts: 24
    • http://www.savioursofsoul.de/Christian
Compiling a .dll
« Reply #24 on: June 19, 2006, 03:45:02 am »
Quote from: "Phil"
I believe the issue here is that the LCL just doesn't work in a library. I haven't tested this on OS X or Linux, but it definitely doesn't work with Windows. The library application "runs", but the GUI is completely unresponsive.

With Delphi, not only does the library application run perfectly, but if you pass the main executable's window handle to the DLL and assign it to the DLL's Application.Handle, the DLL form becomes essentially part of the main program's GUI.

Too bad the LCL doesn't support this powerful feature. Should this be posted as a bug?

Does anyone have any experience using LCL in libraries on OS X or Linux?

Any news here? What is the latest information about using LCL in a DLL? Has it been posted as a bug? How about OSX?

I've ported my VST Plugin Wizard to Lazarus, but without the LCL inside a DLL it's nearly worthless. I'd like to contribute some work, but...

Kind regards,

Christian

CWBudde

  • New member
  • *
  • Posts: 24
    • http://www.savioursofsoul.de/Christian
Compiling a .dll
« Reply #25 on: June 20, 2006, 05:24:40 pm »
If anyone can point me In a direction, than I'd really like to contribute some work. Otherwise it's useless for me (sorry for this bump),

Christian

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3537
Compiling a .dll
« Reply #26 on: June 20, 2006, 05:58:46 pm »
You probably should send an e-mail on the mailling list. There are more developers there that can point you to the right direction.

Phil

  • Hero Member
  • *****
  • Posts: 2650
Compiling a .dll
« Reply #27 on: June 20, 2006, 11:22:41 pm »
Quote from: "CWBudde"

Any news here? What is the latest information about using LCL in a DLL? Has it been posted as a bug? How about OSX?


Recent snapshots of FPC 2.1.1 crash when compiling my libaries, so I can't check to see if there have been any improvements or whether there's any workaround. When they resolve the compiler problem I'll report back.

I don't know if it's been reported as a bug.

I haven't tested it yet on OS X.

Phil

  • Hero Member
  • *****
  • Posts: 2650
Update on using LCL in DLL
« Reply #28 on: July 19, 2006, 10:04:52 pm »
Quote from: "CWBudde"

Any news here? What is the latest information about using LCL in a DLL? Has it been posted as a bug? How about OSX?


See this bug report for sample code illustrating the problems using an LCL form in a DLL:

  http://www.freepascal.org/mantis/view.php?id=7181

The _only_ case I could find where using an LCL form in a DLL works as expected is as follows:

- Windows only (GTK on OS X just crashes with access violation).
- Call DLL only from console app.
- Compile library with stack checking off (apparent FPC bug).

Sorry I don't have better news.

CWBudde

  • New member
  • *
  • Posts: 24
    • http://www.savioursofsoul.de/Christian
Re: Update on using LCL in DLL
« Reply #29 on: July 20, 2006, 06:27:06 pm »
Quote from: "Phil"
See this bug report for sample code illustrating the problems using an LCL form in a DLL:

  http://www.freepascal.org/mantis/view.php?id=7181

The _only_ case I could find where using an LCL form in a DLL works as expected is as follows:

- Windows only (GTK on OS X just crashes with access violation).
- Call DLL only from console app.
- Compile library with stack checking off (apparent FPC bug).

Sorry I don't have better news.

The bug report is a good thing, now we need someone who can adress these items. I'd like to do so, but my knowledge of the LCL is very limited and my time likewise.

Thanks,

Christian

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus