PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Anonymous on October 15, 2005, 12:04:49 PM

Title: Forms in DLL's
Post by: Anonymous on October 15, 2005, 12:04:49 PM
I have read some previous posts that placing forms in a DLL is now possiable. Does some one have a simple example of this.

Thanks Blair
Title: Forms in DLL's
Post by: TechSupport on October 15, 2005, 12:17:10 PM
Check out the description in the Help file under "Working with FireFly", "Projects", "Dynamic Link Library (DLL) Projects".

Basically, create a DLL project to put your Form in. Make sure to set that Form's "Export" property.

Create an EXE project and add the declaration for the Form in the DLL.

Show the Form in the DLL like you would any other Form.
Title: Forms in DLL's
Post by: Anonymous on October 15, 2005, 03:38:43 PM
Thanks Paul,

I get seem to get it to work however. What I am simply trying to do is display a form in Excel.

The classical "Hello World!"

When I go to registar the DLL in Excel it says it can't load it.

Any hints?

Thanks
Title: Forms in DLL's
Post by: TechSupport on October 15, 2005, 03:50:05 PM
To be honest, I have no idea because I have never tried to use PB DLL's with Excel so I can not answer your question with 100% confidence. I assume that when you refer "register" the DLL that you are using the built in "References" facility to attach the DLL. That should only be used for ActiveX DLL's (i.e. those created by Visual Basic). PowerBASIC DLL's are the standard Windows DLL's, not ActiveX DLL's.

Also, putting forms in a FireFly created DLL should only be called using a FireFly created EXE (not Excel). This is because the EXE has code builtin that helps display and clean up the form when the form is closed or the application is ended.

In short, I wouldn't try calling FireFly DLL's with embedded Forms from Excel.

Sorry.
Title: Forms in DLL's
Post by: gian young on October 17, 2005, 02:07:05 AM
:wink:

If you wish to use a Power Basic or FireFly generated DLL in Excel then it has first to be declared.

Example:-   Declare Function MyFunction Lib "MYDLL_32.DLL" (ByVal VariableA&, ByVal VariableB$) As Long

To do this Open a NEW Excel file and select the Tools option, from the drop down tools menu select macros and then click the Visual Basic Editor option, this action will result in the opening of the VB Editor screen giving access to further menu options.

With the Visual Basic Editor screen opened select the Insert option from the main menu bar and then click the Module option (ie: Insert Module), this is where we need to add any declarations and other function code to allow Excel to use the DLL's.

We have successfully incorporated our own PB/FireFly created DLL for barcode generation in Excel cells using this method.

Paul's comments about not being able to use an embedded Form in a FireFly generated DLL in Excel are still applicable though. (Unfortunately).

Regards

Gian Young

Dataman Barcode Systems Australia
Title: Forms in DLL's
Post by: Anonymous on October 17, 2005, 10:11:50 PM
Thanks for the comments.

Blair