DLL z Visual Studio .NET w C++Builderze?

0

Witam,
Potrzebuję użyć biblioteki dll skompilowanej pod Vistal Studio .NET (VC++) w C++Builderze.
Próbowałem dołączyć ją statycznie, czyli najpierw przerobić ją na .LIB, ale IMPDEF.exe i IMPLIB.exe wywalają "Warning: No Exports" dla tej dll'ki
coff2omf.exe wywala: "invalid machine type detected", a tdump.exe:

Turbo Dump Version 5.0.16.12 Copyright (c) 1988, 2000 Inprise Corporation
Display of File MAILSYSTEM.DLL

Old Executable Header

DOS File Size 7000h ( 28672. )
Load Image Size 450h ( 1104. )
Relocation Table entry count 0000h ( 0. )
Relocation Table address 0040h ( 64. )
Size of header record (in paragraphs) 0004h ( 4. )
Minimum Memory Requirement (in paragraphs) 0000h ( 0. )
Maximum Memory Requirement (in paragraphs) FFFFh ( 65535. )
File load checksum 0000h ( 0. )
Overlay Number 0000h ( 0. )

Initial Stack Segment (SS:SP) 0000:00B8
Program Entry Point (CS:IP) 0000:0000

Portable Executable (PE) File

Header base: 00000080

CPU type 80386
Flags 210E [ executable backwards 32bit library ]
DLL flags 0400 [ ]
Linker Version 8.0
Time stamp 468E5E52 : Fri Jul 06 1758 2007
O/S Version 4.0
User Version 0.0
Subsystem Version 4.0
Subsystem 0003 [ Windows character ]
Object count 00000003
Symbols offset 00000000
Symbols count 00000000
Optional header size 00E0
Magic # 10B
Code size 00004000
Init Data size 00002000
Uninit Data size 00000000
Entry RVA 00005F3E
Image base 00400000
Code base 00002000
Data base 00006000
Object/File align 00002000/00001000
Reserved 00000000
Image size 0000A000
Header size 00001000
Checksum 00000000
Stack reserve/commit 00100000/00001000
Heap reserve/commit 00100000/00001000
Number interesting RVAs 00000010
Name RVA Size


Exports 00000000 00000000
Imports 00005EF0 0000004B
Resources 00006000 00000318
Exceptions 00000000 00000000
Security 00000000 00000000
Fixups 00008000 0000000C
Debug 00005E84 0000001C
Description 00000000 00000000
Global Ptr 00000000 00000000
TLS 00000000 00000000
Callbacks 00000000 00000000
Bound Imports 00000000 00000000
Import Addr Table 00002000 00000008
Delayed Imports 00000000 00000000
COM Runtime 00002008 00000048
reserved 00000000 00000000

Object table:

Name VirtSize RVA PhysSize Phys off Flags


01 .text 00003F44 00002000 00004000 00001000 60000020 [CER]
02 .rsrc 00000318 00006000 00001000 00005000 40000040 [IR]
03 .reloc 0000000C 00008000 00001000 00006000 42000040 [DIR]

Key to section flags:
C - contains code
D - discardable
E - executable
I - contains initialized data
R - readable

                                                                         * 

Section: Import
ImportLookUpTblRVA:00005F18
Time Stamp: 00000000
Forwarder Chain: 00000000 (index of first forwarder reference)

Imports from mscoree.dll
_CorDllMain

                                                                         * 

Section: Resources
Flags: 00000000
Time Stamp: 00000000
Major Version: 0000
Minor Version: 0000

Resources:
Type Name Lang Id

[0 named entries, 1 ID entries]
type: Version (16) (next directory @00000018)

[0 named entries, 1 ID entries]
type: Cursor (1) (next directory @00000030)

[0 named entries, 1 ID entries]
type: Unknown (0) (data @00000048)
Offset: 00006058
Size: 000002C0
Code Page: 00000000
Reserved: 00000000

Czyli tak jakby ten dll nie miał żadnych funkcji, ale na pewno ma, bo mam kod tej dll'ki

Próbowałem też dynamicznie:

w Unit1.h dałem:
typedef String (*CREATE)(String login, String haslo);

i Unit1.cpp:
   HINSTANCE dll = LoadLibrary("MailSystem.dll");

    if ( ! dll ) {
        ShowMessage("Nie mozna zaladowac dll");
        return;
    }

    CREATE funkcja = (CREATE)GetProcAddress(dll,"Create"); //(dll,"_Create"); tez nie dziala

    if ( ! funkcja ) {
        ShowMessage("Nie mozna zaladowac funkcji");
        FreeLibrary(dll);
        return;
    }

  ShowMessage((*funkcja)("test123-123test","test123-123test"));
    FreeLibrary(dll);

Niestety tez nie działa (wyświetla "Nie mozna zaladowac funkcji")

Jakiś pomysł?

0

A ta DLL'ka faktycznie eksportuje te funkcje? To, że DLL'ka ma jakieś funkcje nie oznacza, że są one eksportowane...

0
deus napisał(a)

A ta DLL'ka faktycznie eksportuje te funkcje? To, że DLL'ka ma jakieś funkcje nie oznacza, że są one eksportowane...

a jak to sprawdzić/wyeksportowac?
w Visualu nigdy nic nie robiłem

0

Spróbuj zamienić tą linijkę

CREATE funkcja = (CREATE)GetProcAddress(dll,"Create");

na
CREATE funkcja = (CREATE)GetProcAddress(dll,"_Create");

0

Jak to dllka z .net to nie jest to zwykla dll, a assembly, ktore dziala inaczej z tego co sie orientuje. A juz na pewno nie ma exportow zwyklej dll, bo w tym wypadku dziala to zupelnie w inny sposob.

1 użytkowników online, w tym zalogowanych: 0, gości: 1