How to create a dll for an opengl window?
I have wrote an application with an openGL window, for some reason, I need to change it completely to a dll, how to begin my program?
Wow. You've given us exactly enough information to... Ask for more information!
Why do you need a dll? The only reason I can think of is that you are trying to hook into another process' WndProc, and that begs further questions.
Why do you need a dll? The only reason I can think of is that you are trying to hook into another process' WndProc, and that begs further questions.
Quote:Original post by wyanh
[...] for some reason, [...]
I guess if he tells us he will have to kill us.
So, wyanh, I'm assuming that you are using C++.
The header should look like this:
#ifndef __MAIN_H__#define __MAIN_H__//add normal includes here, like#include <windows.h>/* To use this exported function of dll, include this header * in your project. */#ifdef BUILD_DLL #define DLL_EXPORT __declspec(dllexport)#else #define DLL_EXPORT __declspec(dllimport)#endif#ifdef __cplusplusextern "C"{#endifint DLL_EXPORT SomeFunction (it's parameters);#ifdef __cplusplus}#endif#endif // __MAIN_H__
and the cpp file:
#include "that header.h"int DLL_EXPORT SomeFunction (it's parameters){ //implementation}
Then in the compile settings you should find what you are compiling, like in MSVC you go to project's properties and under "General" there is a field named "Configuration Type" where you can select a dll.
I use mfc build the opengl window, my team need to put the window into the C# window forme, like a ActiveX, just give the ActiveX several parametres. but the Activex program I built before build failed on the leader's window7 system, (I build it on windows xp system),so,the leader ask me do a dll,with the functions same to an ActiveX.
You should probably ask on the general programming questions since your question is about how to make a dll. Of course, the best thing to do is to search on the internet and then if you are having problems, ask a more specific question.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement