PlanetSquires Forums

Please login or register.

Login with username, password and session length
Advanced search  
Pages: 1 [2]

Author Topic: dll function declare  (Read 4355 times)

Josť Roca

  • Guru Member
  • *****
  • Posts: 3274
Re: dll function declare
« Reply #15 on: June 13, 2016, 05:08:58 PM »

Apparently, if the dll is in the same folder than the application, we don't need an import library!

Good heavens! All the day fighting with these stupid linux tools...

Definitely, I'm unable to get a working import library with the dlltool.exe that comes with the compiler. It creates the library, but the linker fails.

James Fuller

  • Senior Member
  • ***
  • Posts: 305
  • FF3 User
Re: dll function declare
« Reply #16 on: June 13, 2016, 05:39:36 PM »

Jose,
  Well at least you can now test?

I started porting one of the grid examples and get a failure here on MC_TABLECELL

Sub LoadGrid()
    Dim hTable As MC_HTABLE
    Dim tc As MC_TABLECELL
End Sub

James
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3274
Re: dll function declare
« Reply #17 on: June 13, 2016, 06:04:14 PM »

No, I first have to see if I can find a way to get a working library.

Probably it does not understand

Code: [Select]
#ifdef UNICODE
   #define MCTRL_NAME_AW(name) name##W
#else
   #define MCTRL_NAME_AW(name) name##A
#endif

I don't know how it should be in FB.

Josť Roca

  • Guru Member
  • *****
  • Posts: 3274
Re: dll function declare
« Reply #18 on: June 13, 2016, 06:09:32 PM »

To generate the def file I have adapted an old PB tool from 2007. Of course, it only works with 32-bit DLLs. I will see if I can translate it to FB. At least it doesn't GPF like pexports or does nothing like gendef. Apparently, these tools don't fully understand the Microsoft fotmat, specially this one that uses COM.

This is the .def file that I have generated with this tool:

Code: [Select]
LIBRARY mCtrl.dll
EXPORTS
DllGetVersion
mcBeginBufferedAnimation
mcBeginBufferedPaint
mcBeginPanningFeedback
mcBufferedPaintClear
mcBufferedPaintInit
mcBufferedPaintRenderAnimation
mcBufferedPaintStopAllAnimations
mcBufferedPaintUnInit
mcButton_Initialize
mcButton_Terminate
mcChart_Initialize
mcChart_Terminate
mcCloseThemeData
mcCreateDialogIndirectParamA
mcCreateDialogIndirectParamW
mcCreateDialogParamA
mcCreateDialogParamW
mcDialogBoxIndirectParamA
mcDialogBoxIndirectParamW
mcDialogBoxParamA
mcDialogBoxParamW
mcDrawThemeBackground
mcDrawThemeBackgroundEx
mcDrawThemeEdge
mcDrawThemeIcon
mcDrawThemeParentBackground
mcDrawThemeParentBackgroundEx
mcDrawThemeText
mcDrawThemeTextEx
mcEnableThemeDialogTexture
mcEndBufferedAnimation
mcEndBufferedPaint
mcEndPanningFeedback
mcExpand_Initialize
mcExpand_Terminate
mcGetBufferedPaintBits
mcGetBufferedPaintDC
mcGetBufferedPaintTargetDC
mcGetBufferedPaintTargetRect
mcGetCurrentThemeName
mcGetThemeAppProperties
mcGetThemeBackgroundContentRect
mcGetThemeBackgroundExtent
mcGetThemeBackgroundRegion
mcGetThemeBitmap
mcGetThemeBool
mcGetThemeColor
mcGetThemeDocumentationProperty
mcGetThemeEnumValue
mcGetThemeFilename
mcGetThemeFont
mcGetThemeInt
mcGetThemeIntList
mcGetThemeMargins
mcGetThemeMetric
mcGetThemePartSize
mcGetThemePosition
mcGetThemePropertyOrigin
mcGetThemeRect
mcGetThemeStream
mcGetThemeString
mcGetThemeSysBool
mcGetThemeSysColor
mcGetThemeSysColorBrush
mcGetThemeSysFont
mcGetThemeSysInt
mcGetThemeSysSize
mcGetThemeSysString
mcGetThemeTextExtent
mcGetThemeTextMetrics
mcGetThemeTransitionDuration
mcGetWindowTheme
mcGrid_Initialize
mcGrid_Terminate
mcHitTestThemeBackground
mcHtml_Initialize
mcHtml_Terminate
mcImgView_Initialize
mcImgView_Terminate
mcIsAppThemed
mcIsCompositionActive
mcIsMenubarMessage
mcIsThemeActive
mcIsThemeBackgroundPartiallyTransparent
mcIsThemeDialogTextureEnabled
mcIsThemePartDefined
mcMditab_DefWindowProc
mcMditab_Initialize
mcMditab_Terminate
mcMenubar_HandleRebarChevronPushed
mcMenubar_Initialize
mcMenubar_Terminate
mcOpenThemeData
mcOpenThemeDataEx
mcSetThemeAppProperties
mcSetWindowTheme
mcSetWindowThemeAttribute
mcTable_AddRef
mcTable_Clear
mcTable_ColumnCount
mcTable_Create
mcTable_GetCellA
mcTable_GetCellW
mcTable_Release
mcTable_Resize
mcTable_RowCount
mcTable_SetCellA
mcTable_SetCellW
mcTheme_Initialize
mcTheme_Terminate
mcTreeList_Initialize
mcTreeList_Terminate
mcUpdatePanningFeedback
mcVersion

James Fuller

  • Senior Member
  • ***
  • Posts: 305
  • FF3 User
Re: dll function declare
« Reply #19 on: June 13, 2016, 06:23:54 PM »

Jose,
  Attached are 32/64 TinyC utilities to create def files from dll's.
Might be helpful.
James
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3274
Re: dll function declare
« Reply #20 on: June 13, 2016, 06:39:15 PM »

Identical output that the PB tool. But the problem is to know why the library created by dlltool does not work.

Josť Roca

  • Guru Member
  • *****
  • Posts: 3274
Re: dll function declare
« Reply #21 on: June 13, 2016, 06:58:28 PM »

I finally have found reimp.exe

https://sourceforge.net/projects/mingw/files/MinGW/Extension/mingw-utils/mingw-utils-0.3/mingw-utils-0.3.tar.gz/download

I will try it tomorrow.

But if it just creates a def file, then the problem remains.
« Last Edit: June 13, 2016, 07:00:42 PM by Jose Roca »
Logged

James Fuller

  • Senior Member
  • ***
  • Posts: 305
  • FF3 User
Re: dll function declare
« Reply #22 on: June 13, 2016, 07:09:43 PM »

Jose,
  Take a look at #inclib in the help file and then the Compiler Option: -l at the bottom.
I don't think in many cases we even need an import library.
propsys was different in that it has a lot of other stuff in it, but I don't think we need one for mctrl
James
Logged

Josť Roca

  • Guru Member
  • *****
  • Posts: 3274
Re: dll function declare
« Reply #23 on: June 14, 2016, 05:04:14 AM »

I don't care about if this dll needs an import library or not. The ones in which I'm mainly interested are system libraries, and I'm not going to copy these DLLs in each application folder.

The reimp.exe for 32-bit that I have found in the web apparently works. Now I need one for 64-bit.
Pages: 1 [2]