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
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
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
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.
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
hahahahaha! Yeah, I do seem to pumping out a lot more code lately. Feels good actually. :)
Quote... I should have this implemented later today ...
Later today?! WOW!!!
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.
Thank you Paul. It works perfectly.
I sent you an email with more details.
Regards,
Jean-Pierre
Thanks Jean-Pierre, email received. I will make that small change you suggested.
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.
I use the visual designer with MLG (SLL) now (FireFly v3.62). Here is how I have been doing it...
- Copy MLG.SLL & MLG.INC to your modules folder
- Place MLG definitions in FF_AppStart something like this
' Place your user defined Declares, Constants, and #Include files below this line. FireFly will not
' parse any of your defined #Include files - it simply includes it in the final generated code.
' -------------------------------------------------------------------------------------------------
%MLGSLL = 1
#Link "..\modules\MLG.SLL"
#INCLUDE "..\modules\MLG.INC" - In your form create a CustomControl (ie. customcontrol1)
- In the CustomControl properties the class name has to be MYLITTLEGRID
- In the CustomControl properties the caption has to be the column, row, etc. settings (ie. r50/c8/Z1)
- Last thing you need to do is initialize it. From the code view, click on the customcontrol (ie customcontrol1) and then the init and that will bring up 'Function FORM1_CUSTOMCONTROL1_INIT...'. Here you need to add in MLG_Init so that it looks like this...
Function FORM1_CUSTOMCONTROL1_INIT ( _
ClassName As Asciiz, _ ' windows class
Caption As Asciiz, _ ' window caption
hWndParent As Dword, _ ' handle of parent window
ExStyles As Dword, _ ' extended window styles
Styles As Dword, _ ' standard window styles
nLeft As Dword, _ ' left position of control
nTop As Dword, _ ' top position of control
nWidth As Dword, _ ' width of control
nHeight As Dword _ ' height of control
) As Long
' If your custom control uses CreateWindowEx then use the template below, otherwise
' follow the instructions provided by the Custom Control's author. The Custom Control
' INIT function is called during the %WM_CREATE message for the Form on which the
' Custom Control is created.
Local hWndControl As Dword
'Must do this before creating the control (.dll does this automatically)
MLG_Init
hWndControl = CreateWindowEx( ExStyles, _
ClassName, _
Caption, _
Styles, _
nLeft, nTop, nWidth, nHeight, _
hWndParent, IDC_FORM1_CUSTOMCONTROL1, _
GetModuleHandle( ByVal %Null ), _
ByVal %Null )
'Must do this to unlock the registered version of MLG (remove big X from Grid)
'EDIT: (removed by Moderator)
'It is important that this function return the Windows Handle to the newly created Control *** Do not delete this ***.
Function = hWndControl
End Function
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
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).
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
Ah, yes, right you are. I should have read your post more closely. :)
BTW Pete, I just checked out your website. Very cool stuff! Did you create the software listed there using FireFly?
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
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.
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.
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
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.
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
The MLG_INIT() is the other step I used - forgot that I did it, but it is essential.
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.