dllexport

C++ : inline functions with dllimport/dllexport?

℡╲_俬逩灬. 提交于 2019-11-28 10:31:58
I create a DLL (say CORE.DLL) ,I have classes/functions declared as follows: #ifdef RINZOCORE_SHARED #define RINZO_LIB __declspec(dllexport) #else #define RINZO_LIB __declspec(dllimport) #endif I have defined many inline functions with "dllexport" macro , class RINZO_LIB CVector { public: CVector();//!< default constructor .. real& x();//!< accessor for the x component (can be used as l-value too) real& y();//!< accessor for the y component (can be used as l-value too) real& z();//!< accessor for the z component (can be used as l-value too) CVector& operator=(const CVector& other);//!< the

Call C# DLL from Inno Setup with callback

余生长醉 提交于 2019-11-28 04:13:24
问题 I have a running Inno Setup script, wherein I use innocallback.dll by Sherlock Software. This DLL wraps a procedure of mine so that it can be passed to a C# DLL. I don't want to use this DLL, I want to call my exported C# method directly and pass to it the callback procedure. My question is: How can I pass my Inno Setup procedure ( @mycallback ) to my C# DLL so that I can use it as my delegate / UnmanagedFunctionPointer ? As I said this code works, but I want to use as little external DLL's

Can a standard executable have an export table?

半世苍凉 提交于 2019-11-27 18:38:28
问题 I have an executable written in C that has some functions in it that I would like to use from a c# application. I have written plenty of dlls before and was able to use functions in them by prepending __declspec(dllexport) to the function declaration. Can I do this from an executable? will the executable actually export the function? 回答1: Yes you can! Yes the executable will export the functions. This is not done very often, but it works pretty good. According the Specification (http://msdn

How to dllexport a class derived from std::runtime_error?

…衆ロ難τιáo~ 提交于 2019-11-27 14:46:44
问题 I have set up a library providing an exception class derived from the standard exception: #include <stdexcept> #include <string> class BaseException : public std::runtime_error { public: BaseException( std::string const & msg ); }; So far, so good. Compiles and handles quite well on Unix. Now I am prepping this for compilation into a Windows DLL: #ifdef WIN32 #define MY_EXPORT __declspec(dllexport) #else #define MY_EXPORT #endif #include <stdexcept> #include <string> class MY_EXPORT

Exporting static data in a DLL

守給你的承諾、 提交于 2019-11-27 08:14:37
I have a DLL which contains a class with static members . I use __declspec(dllexport) in order to make use of this class's methods . But when I link it to another project and try to compile it, I get "unresolved external symbol" errors for the static data. e.g. In DLL, Test.h class __declspec(dllexport) Test{ protected: static int d; public: static void m(){int x = a;} } In DLL, Test.cpp #include "Test.h" int Test::d; In the application which uses Test, I call m(). I also tried using __declspec(dllexport) for each method separately but I still get the same link errors for the static members.

How to build a DLL version of libjpeg 9b?

家住魔仙堡 提交于 2019-11-27 07:25:36
问题 I want to build a DLL version of libjpeg 9b. According to the document here, it seems that we need to add a preprocessor __declspec(dllexport) or __declspec(dllimport) before the declaration of each function to be exported, in addition to setting the Configuration Type to "Dynamic Library (.dll)". But this is not an easy job because there are so many functions in libjpeg. So, is there any short-cut or work-around to build a DLL libjpeg without or with little modification of the jpeglib.h? Is

How to use a class in DLL?

点点圈 提交于 2019-11-27 04:05:37
Can I put a class inside a DLL? The class i wrote is this: class SDLConsole { public: SDLConsole(); ~SDLConsole(){}; void getInfo(int,int); void initConsole(char*, char*, SDL_Surface*, int, int, int); void sendMsg(char*,int, SDL_Surface*); void cls(SDL_Surface*); private: TTF_Font *font; SDL_Surface *consoleImg; int width, pos, height, line, size, ctLine; SDL_Surface* render(char*,int); }; I know how to load a DLL and use the function inside a DLL, but how can I put a class inside a DLL? Thank you very much. If you use run time dynamic linking (uses LoadLibrary to load the dll) you cannot

C++ : inline functions with dllimport/dllexport?

Deadly 提交于 2019-11-27 03:39:18
问题 I create a DLL (say CORE.DLL) ,I have classes/functions declared as follows: #ifdef RINZOCORE_SHARED #define RINZO_LIB __declspec(dllexport) #else #define RINZO_LIB __declspec(dllimport) #endif I have defined many inline functions with "dllexport" macro , class RINZO_LIB CVector { public: CVector();//!< default constructor .. real& x();//!< accessor for the x component (can be used as l-value too) real& y();//!< accessor for the y component (can be used as l-value too) real& z();//!< accessor

Is is possible to export functions from a C# DLL like in VS C++?

萝らか妹 提交于 2019-11-26 11:46:25
In VS C/C++ you could use extern "C" __declspec(dllexport) -function declaration- . How do I accomplish this in a C# dll? Is there C# code equivalent to the above code? Edit: More info I am trying to create an add in for Notepad++ and I want to use C#, but the common way I've seen so far is to use legacy C++ code with the above call to export a few of the functions that Notepad++ expects to import and call. There is an example app using C#, but this still requires a loader DLL, which I assume from the comments/answers below is the only way for C#. Unmanaged Exports => https://sites.google.com

How to use a class in DLL?

别等时光非礼了梦想. 提交于 2019-11-26 11:04:22
问题 Can I put a class inside a DLL? The class i wrote is this: class SDLConsole { public: SDLConsole(); ~SDLConsole(){}; void getInfo(int,int); void initConsole(char*, char*, SDL_Surface*, int, int, int); void sendMsg(char*,int, SDL_Surface*); void cls(SDL_Surface*); private: TTF_Font *font; SDL_Surface *consoleImg; int width, pos, height, line, size, ctLine; SDL_Surface* render(char*,int); }; I know how to load a DLL and use the function inside a DLL, but how can I put a class inside a DLL?