Einzelnen Beitrag anzeigen

EWeiss
(Gast)

n/a Beiträge
 
#10

AW: Problem with DLL in Delphi

  Alt 22. Aug 2014, 09:04
why your use __cplusplus and __stdcall?

sample..
use
Code:
#ifdef __cplusplus
extern "C" {
#endif
instead of define
Zitat:
__stdcall by Hand
define exports inside your dll is written in Delphi
sample
Code:
#ifndef TAGSLIBDEF
#define TAGSLIBDEF(f) WINAPI f
#endif
Delphi
Code:
TagsLibrary_Free  name 'TagsLibrary_Free@HereTheByteWhichHTAGSHas' Sample (TagsLibrary_Free@4) if HTAGS = Integer
Create the DEF File with DumpBin
dumpbin /exports TagsLib.dll >TagsLib.def

Create a lib
LIB /DEF:TagsLib.DEF

Sample Header
Code:
#ifndef TAGSLIBDEF_H
#define TAGSLIBDEF_H

#include <wtypes.h>

#ifdef __cplusplus
extern "C" {
#endif

#ifndef TAGSLIBDEF
#define TAGSLIBDEF(f) WINAPI f
#endif


// Your Exports Header and so on
BOOL TAGSLIBDEF(TagsLibrary_Free)(HTAGS Tags);
int TAGSLIBDEF(TagsLibrary_Load)(HTAGS Tags, LPWSTR FileName, TTagType TagType, BOOL ParseTags);

#ifdef __cplusplus
}
#endif

#endif
def file should then be
Zitat:
LIBRARY TagsLib

DESCRIPTION 'Tags reader-writer component for Delphi'

EXPORTS
TagsLibrary_AddCoverArt
this is a sample also convert it to your DLL.

sorry for my bad english.
this is for static linking DLL not "dynamic linking"

And
your should disable floating point exception inside Delphi


greets
  Mit Zitat antworten Zitat