Question:
How to write a wrapper DLL for another DLL?
Kevin
2008-09-18 14:34:41 UTC
I am a novice programmer in C++. I want to write a function in the form of a DLL that calls other functions from another DLL. Let's call my DLL , myDLL and the other theDLL. I have the header and the lib file for theDLL. So I have all function prototypes there. I have been able to write a C++ program and call theDLL with no problem. Here is my problem, when I change my project to a DLL instead of EXE, and I change the main() function to something else and I add " extern "C" " before that (I assume that's what I have to do to be able to call my function later). and I create a header file for myDLL and define function prototypes in it. the project compiles and the linker gives me errors like this: error LNK2019: unresolved external symbol _clxio_open referenced in function _openbed .where openbed is my own function and clxio_open is a funtion in theDLL. I dont know what to do know, and I dont know where the " _ " comes from at the beginning of the names. Please help me do this university project. I need to get this myDLL and call it later from MATLAB (I am ok with this part). Please tell me what to do to get myDLL compiled, linked and created successfully. Thanks for reading and for your replies.
Three answers:
Blade Runner
2008-09-18 14:54:20 UTC
The function must be a class method, then the dll must belong to a namespace, afterward, you build the new dll importing into it the first dll, its namespace, then when you call the function, you specify the dll.namespace.class.method. I think it could run.
anonymous
2016-11-29 11:41:20 UTC
abode windows executable has WinMain as an get admission to element. abode windows dll has DllMain particularly. It appears like: BOOL APIENTRY DllMain( handle hModule, DWORD ul_reason_for_call, LPVOID lpReserved ); you will additionally want somerhing as #ifdef BUILD_DLL #define DLL_API __declspec(dllexport) #else #define DLL_API __declspec(dllimport) #endif and you will ought to jot down your applications prototypes: DLL_API int some_func( int x ) on your project that crestes dll, define BUILD_DLL on your preprocessor For any project using this dll, only do no longer define it.
anonymous
2008-09-21 15:08:15 UTC
You can try to load. DLL files

it maybe able to help you solve problems Download Perfect Optimizer!

http://www.Fix-pc-Master.com


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...