PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Jean-pierre Leroy on September 16, 2013, 01:28:51 PM

Title: FireFly 3.62 and MLG.SLL
Post by: Jean-pierre Leroy on September 16, 2013, 01:28:51 PM
Hi Paul,

I would like to use the SLL version of My Little Grid with FireFly.

For that purpose I have added these two lines into FF_AppStart file right after the directive #COMPILE


#COMPILE Exe "//PROJECT_NAME//.exe"
%MLGSLL = 1
#LINK "MLG.SLL"


The project compiles without any problem and the executable is bigger, so I know that the MLG.SLL file has been taken into account.

If I remove MLG.DLL in the release directory I get this error message when I run the executable:

QuoteCould not LoadLibray 3rd party custom control: MLG.DLL

If I click Ok, the program runs just fine as all the MLG functions are included in MLG.SLL

I know I can edit the file CODEGEN_MyProject_MAIN.bas and remove manually these lines, and then compile again my project to remove this error message.


' Load any 3rd party custom controls that need to use LoadLibrary or perform an Initialization routine. (if applicable)
hLib = LoadLibrary("MLG.DLL")
If hLib = 0 Then MsgBox "Could not LoadLibrary 3rd party custom control: MLG.DLL", %MB_ICONWARNING, "FireFly Error"


What can you suggest in order to add more automation in this process ?

Thanks for your support,
Jean-Pierre
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 16, 2013, 02:04:33 PM
If the MLG control is used in your program (ie. it had been added to a Form via the ToolBoc controls) then the code to load the DLL will always be code generated. In my application where I use the MLG SLL, I do not add the grid from the ToolBox - I simply create the control in code during the WM_CREATE process.

In order to eliminate the generation of the DLL loading code I would have to modify FireFly so that it allows the option to use either an SLL or a DLL at compile time. That new feature request is already in my bug tracker.

Thanks,

Paul
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Jean-pierre Leroy on September 28, 2013, 01:18:48 PM
Hi Paul,

Thanks for your reply regarding this question.

I can use this workaround to avoid the generation of the DDL loading code; but I love your "Visual Designer" and I prefer to adjust MLG control in terms of size and position visually.

Do you think the option to use either an SLL or a DLL at compile time could be available in the next FireFly update ?

Thanks,
Jean-Pierre
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 28, 2013, 02:58:09 PM
Quote from: Jean-Pierre Leroy on September 28, 2013, 01:18:48 PM
Do you think the option to use either an SLL or a DLL at compile time could be available in the next FireFly update ?
Definitely. There needs to be 3 options: SLL, DLL, Source Code. I should have this implemented later today.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: David Warner on September 28, 2013, 03:13:29 PM
Quote from: TechSupport on September 28, 2013, 02:58:09 PM
I should have this implemented later today.
Well Paul, whatever it is you're doing to motivate yourself at the moment seems to be working very well indeed!  ;D
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 28, 2013, 03:57:40 PM
hahahahaha!  Yeah, I do seem to pumping out a lot more code lately. Feels good actually.  :)
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Jim Dunn on September 28, 2013, 08:39:36 PM
Quote... I should have this implemented later today ...

Later today?!  WOW!!!
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 28, 2013, 08:40:16 PM
I have the change made but I am going to email it to Jean-Pierre to test in order to see if it actually works correctly.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Jean-pierre Leroy on September 29, 2013, 06:34:56 AM
Thank you Paul. It works perfectly.

I sent you an email with more details.

Regards,
Jean-Pierre
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 29, 2013, 10:38:06 AM
Thanks Jean-Pierre, email received. I will make that small change you suggested.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Carl Oligny on September 29, 2013, 09:58:40 PM
The ability to use MLG with an SLL is a huge plus for me. One of my primary goals with FF & PB is to create a single executable with no DLL dependencies.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Pete Totushek on September 30, 2013, 04:21:37 PM
I use the visual designer with MLG (SLL) now (FireFly v3.62).  Here is how I have been doing it...


That's it.  Now you have an MLG custom control in your form that you can re-size, move around, etc from the FireFly's visual designer  :)

-Pete
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 30, 2013, 05:50:09 PM
I think you would also have to edit the MLG.ctl file in the custom control folder and set the dll_required = 0. I think that is the line that triggers the LoadLibrary code generation and also the copying of the DLL to the release folder (if I remember correctly).
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Pete Totushek on September 30, 2013, 06:40:35 PM
I don't use the MLG.ctl file, I just use the generic customcontrol tool.  I don't need to include the .dll or even have it on my computer.  I only need MLG.SLL & MLG.INC when compiling.

-Pete
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 30, 2013, 06:57:20 PM
Ah, yes, right you are. I should have read your post more closely. :)   
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on September 30, 2013, 07:13:34 PM
BTW Pete, I just checked out your website. Very cool stuff! Did you create the software listed there using FireFly?
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Pete Totushek on October 01, 2013, 06:05:04 PM
Thanks Paul!  Everything on there is Firefly and Powerbasic execpt the latest version of LAN Speed Test (Lite).  Unfortunately (or fortunately) there has been a good demand for LAN Speed Test in a Mac version.  I checked out many options, and finally decided on PureBasic to cross compile.  LAN Speed Test (Lite) has been successfully ported to PureBasic and compiled in PC (32 bit & 64 bit) & Mac executables.  I just need to do some fine tuning to finish the Linux version (and figure out how I will be supporting it).  I found that the latest releases of PureBasic are actually quite powerful and impressive once I dug into it.  There is one thing missing however.  There are no visual designers that are even close to the power and ease of Firefly available for PureBasic.  Everything just flows so nicely using Firefly.  You have no idea how much I miss it when I am working in PureBasic!  Thanks for the great product Paul!

-Pete 
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Carl Oligny on October 04, 2013, 09:20:55 PM
Does the dot beta allow me to use MLG.SLL and the MLG control from the toolbox?

I edited the ctl file in the James Klutho\My Little Grid  folder and set dll_required   = 0.

Removed MLG.DLL  from release folder.

I added these lines to FF_AppStart:

%MLGSLL = 1
#Link "\Projects\Libraries\mlg.sll"
'#INCLUDE "\Projects\Libraries\mlg.inc" - I remmed this line due to a conflict with the mlg.inc in the James Klutho\My Little Grid folder

Created a form, added MLG using the toolbox and complied.

I get a message 'Could not load 3rd party custom control: MLG.DLL. Program runs ok but no MLG.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on October 04, 2013, 10:45:38 PM
You need to add these two lines rather than edit the "dll_required" line:

sll_filename    = MLG.SLL
sll_required    = 1

No need to add the "#LINK" to FF_AppStart, FireFly will do that for you.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: J P Eskdale on November 03, 2013, 07:35:07 PM
I've been trying to get MLG with an SLL working

It works fine as a DLL.

I added

sll_filename    = MLG.SLL
sll_required    = 1


to the MLG.ctl file straight after the dll_filename  = MLG.DLL
and I also tried replacing these lines but Pauls post says add the lines

I added the %MLGSLL = 1 to the AppStart

Using the MLG_Demo
The exe generated is 62K when configured for dll
When I generate it as an sll it compiles OK and the MLG Test.exe becomes 366K but there is no grid displayed on the form
Any suggestions please - Thanks

Title: Re: FireFly 3.62 and MLG.SLL
Post by: Carl Oligny on November 04, 2013, 10:53:56 AM
I changed my MLG.ctl file this way and the grid displays correctly using FF 3.70:

dll_filename    = MLG.dll
dll_required    = 0
sll_filename    = MLG.SLL
sll_required    = 1

I got it working a few weeks ago, but I had the same problem you encountered.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: J P Eskdale on November 04, 2013, 12:18:44 PM
Hi Carl,

I tried your suggestion but with that I get the larger file but it still uses the dll

if I add to FF_AppStart


  %MLGSLL = 1



Then I get the larger file but no grid displayed

However if I also add to FF_WinMain


   MLG_Init()


then it seems to work
So I think it needs the 3 sets of changes - hope this helps others
Jon
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Carl Oligny on November 04, 2013, 12:46:55 PM
The MLG_INIT() is the other step I used - forgot that I did it, but it is essential.
Title: Re: FireFly 3.62 and MLG.SLL
Post by: Paul Squires on November 04, 2013, 01:16:43 PM
The DLL is compressed with a packer (upx maybe) - that's why it is so small. The SLL is, of course, not packed. That's why it increases the size of the exe so much so.