Top Banner
Edition 7.0 The DLL
27

Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Mar 31, 2015

Download

Documents

Anderson Gains
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Edition 7.0The DLL

Page 2: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Introduction

• A look at what’s new in the Dll

• A brief glimpse at “Dll Hell” and how you might minimize your time there

• A look at some development environments

• A look at some applications

• How you get your own copy of the Dll

• What the future holds…

Page 3: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

What’s New

• The Dll now uses the same code as the console version, so the results are identical.

• There are new species in the SMC and NWO version.

• Data supporting the growth equations in the SWO version includes old-growth stands and stands with more hardwoods.

• Lahey FORTRAN compiler (version 9.5) used to generate the files

Page 4: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Why Dll ?

• Link free solution

• Simplicity, clarity, and completeness

• Larger problems can be considered

• Larger spatial regions can be considered

• Consistent platform

Page 5: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Organization

• Three separate files– ORGEDIT: (prepare) data imputation– ORGRUN: (execute) project tree lists– ORGVOL: (volcal) Estimate volume

• They use Microsoft PE/COFF (Portable Executable Common Object File Format)

• They use Microsoft Visual Basic name decorating

Page 6: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Dll “Hell”

• DLL Hell is an official Microsoft term gleaned from their developer network (they would know, they invented it!)

• COFF (originally from DEC) has been modified by Microsoft for WinNT 3 and it continues to change (PE/COFF)– Routines prior to Visual “stuff” 6 will need to “convert” the ‘lib’

• Calling routines ‘decorate’ function and subroutine names in called Dll’s– Familiarize yourself with your environments calling protocols– Use “Alias” to convert names.– Use standard call

• Microsoft compliant lib’s are included but with the infinitude of compilers out there you may need another

Page 7: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

More Hell

• Intel defined an object file standard ‘OMF’ Object Model format.– If your environment uses it you will need to

convert coff2omf should work – unless it is old then you will need to use the

utility “convert”– Borland’s Builder and Delphi also use OMF

Page 8: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Even More Hell

• Name decoration:– Borland utility TDUMP will give the names inside of

the DLL– Dumpbin is Microsoft’s solution– More feature rich programs: PEBrowse, dumpbinGUI,

etc.

• After all of this, your compiler will use its own decoration protocol to call the Dll– Read the instructions (really)

• MS Visual Basic seems to have a benign protocol so we chose to use that one

Page 9: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

And Even More Hell

• Security? There isn’t any!– We don’t include viruses, really!– We don’t format hard drives

• VB solves some problems but causes others– Relatively minor things will break your code

• VB blames almost every problem on calling convention

• It is nearly always lying!

Page 10: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

“Bad Dll Calling Convention”

• Get used to seeing this!• From this you might infer that there is something

wrong with your Dll– There isn’t, its your application

• It means that the stack is confused• Why?

– Optimization for speed will put memory on 4 byte boundaries, sometimes…

– Change in compiler conventions

• No optimization selected in producing the Dll

Page 11: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Tested Environments

• Lahey FORTRAN and C– Version 5

• Microsoft Visual Studio– .NET

• Microsoft Office applications– Office 2003

• Borland’s Builder– Version 5– Version 6

• Intel FORTRAN

Page 12: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

A few forestry details

• No management is included, but the effects are modeled– The user is responsible for filling the management

arrays– Fertilization

• Intensity (pounds of nitrogen)• Timing (both prior and post)• Maximum of 5 fertilizer applications

– Thinning• Intensity (basal area removed)• Timing (both prior and post)• Maximum of 5 thins

Page 13: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Applications

• A simple FORTRAN application

• Spreadsheet

• Access Database (?)

• R (?)

Page 14: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

FORTRAN

Page 15: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

FORTRAN

• Import function with DLL_IMPORT

• Get the name right with Alias– CDEC$ ATTRIBUTES, ALIAS:'_EXECUTE' ::

EXECUTE

• Alias helps in other environments

Page 16: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

The dreaded Office

• This environment is very complex• This environment is constantly changing• Don’t go here! It is evil! The dark side will

draw you in and then it will crush you!• Hire a psychologist, if you don’t get over

your desire then hire a programmer• BIG ASTERIX (*)

– What you are about to see works in Office 2003 and probably no where else

Page 17: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

EXCEL

Page 18: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

EXCEL

• This design borrowed from Jeff Hamann

• But the mistakes are courtesy of me

• Jeff is much too smart to this

• Use ‘R’ it is the future

• Or even better just do it in FORTRAN

Page 19: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

EXCEL

Page 20: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

EXCEL

Page 21: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

EXCEL

Page 22: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

EXCEL

Page 23: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Excel

Page 24: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

The future

• Seeking testers and example generators• Examples will be posted to the ORGANON

web site• FORSight Resources is building a

replacement for the console version• Additional utilities supporting the program

– Wrapper for the GMUG tree structure– Management routine

• What of .NET?

Page 25: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

How to get a copy

• Send a request to:– [email protected][email protected]

Page 26: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

The End

Questions?

Page 27: Edition 7.0 The DLL. Introduction •A look at what’s new in the Dll •A brief glimpse at “Dll Hell” and how you might minimize your time there •A look at.

Well I brought one…

• On average, what fraction of a square n times 2r on a side is covered by n-squared equal sized circles, of radius r, randomly distributed across it? The origin of all circles must fall in the square.