[问题] 没有.h的dll如何呼叫

楼主: nepholi (我不是砲哥)   2018-12-10 11:00:39
开发平台(Platform): (Ex: Win10, Linux, ...)
Windows10
编译器(Ex: GCC, clang, VC++...)+目标环境(跟开发平台不同的话需列出)
Visual Studio 2017
额外使用到的函数库(Library Used): (Ex: OpenGL, ...)
N/A
问题(Question):
主管从别的team那边拿到了一包DLL的source code
说要更改里面某一个函式的功能
我看了半天改好之后也成功rebuild出 .dll & .lib
想说要自己写测试exe去呼叫才发现这包dll没有entry point那支cpp的header
档案结构大概是
A.cpp (DLLMain在这)
A.def
A.sln (还有其他VS相关档案略过)
B.cpp
B.h
C.cpp
C.h
A.cpp include B.h & C.h
A.def写了
LIBRARY A
EXPORTS
Fun_a
Fun_b
Fun_c
喂入的资料(Input):
N/A
预期的正确结果(Expected Output):
能够让我呼叫dll里面的Fun_a、Fun_b、Fun_c
错误结果(Wrong Output):
没有A.h不知道怎么include dll
可能是我不太能理解def的机制???
程式码(Code):(请善用置底文网页, 记得排版,禁止使用图档)
N/A
补充说明(Supplement):
请指教 谢谢QQ
作者: flyfoxy (飞狐)   2018-12-10 11:57:00
LoadLibrary and GetProcAddress
作者: TeaEEE (爱不趴 不爱趴)   2018-12-10 11:59:00
GetProcAddress
作者: Bencrie   2018-12-10 12:15:00
前两楼是缺 .lib 的时候可以用如果你知道那些 function 要代什么参数就自己刻 header吧
作者: F04E (Fujitsu)   2018-12-10 19:05:00
???不是有source code了?自己生个.h会很难?
作者: soheadsome (师大狗鼻哥)   2018-12-10 20:04:00
nm去找symbol
作者: Killercat (杀人猫™)   2018-12-11 01:14:00
dll的load有两种 一种是静态 一种是动态 你的是后者另外该dll如果是managed dll 可以直接用#import.COM的DLL也能#import 可以看你需求怎么弄
作者: tinlans ( )   2018-12-11 02:39:00
写一行 #import 然后去找找有没有 .tlh 和 .tli 档跑出来
作者: TobyH4cker (Toby (我要当好人))   2018-12-11 10:55:00
managed 都出来了 cool

Links booklink

Contact Us: admin [ a t ] ucptt.com