This discussion is now closed.
Reply 1
Reply 2
#ifndef __MAIN_H__
#define __MAIN_H__
#define CLASSLIB_API __declspec(dllexport)
#include <iostream>
void CLASSLIB_API PrintText();
void CLASSLIB_API Wait();
#endif
#include "MyClass.h"
void PrintText()
{
std::cout << "Hello World\n";
}
void Wait()
{
std::cin.get();
}
#include "MyClass.h"
int main()
{
PrintText();
Wait();
return 0;
}
Reply 3
Reply 4
Reply 5
Reply 6
Reply 7
void CLASSLIB_API PrintText();
void PrintText()
{
Reply 8
void CLASSLIB_API PrintText();
void PrintText()
{
Reply 9
Reply 10
Reply 11
// This function will be exported from this dll
__declspec(dllexport) int func1()
{
// Lots of fun code
}
// This function is exported from another dll, but we want to use it from here
__declspec(dllimport) int func1();
int internalFunction()
{
// Lots more fun code
// Call to function in other dll
int b = func1();
// Lots more code
}
Reply 12
// This function will be exported from this dll
__declspec(dllexport) int func1()
{
// Lots of fun code
}
// This function is exported from another dll, but we want to use it from here
__declspec(dllimport) int func1();
int internalFunction()
{
// Lots more fun code
// Call to function in other dll
int b = func1();
// Lots more code
}
Reply 13
#ifndef MYDLL_H
#define MYDLL_H
// MYDLL_COMPILE should only be defined when actually compiling MyDll.
// Clients of MyDll must not define this macro
#ifdef WIN32
#ifdef MYDLL_COMPILE
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif
#else
// possibly other platform support, e.g. __attribute__ ((visibility("default")))
#define MYDLL_API
#endif
// Functions provided by MyDll:
MYDLL_API void DoIt();
MYDLL_API void DoMore();
MYDLL_API int func1();
// etc. etc.
#endif
Reply 14
#ifndef MYDLL_H
#define MYDLL_H
// MYDLL_COMPILE should only be defined when actually compiling MyDll.
// Clients of MyDll must not define this macro
#ifdef WIN32
#ifdef MYDLL_COMPILE
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllimport)
#endif
#else
// possibly other platform support, e.g. __attribute__ ((visibility("default")))
#define MYDLL_API
#endif
// Functions provided by MyDll:
MYDLL_API void DoIt();
MYDLL_API void DoMore();
MYDLL_API int func1();
// etc. etc.
#endif
Reply 15
Reply 16
#ifdef MYDLL_COMPILE
#define MYDLL_API __declspec(dllexport)
#else
#define MYDLL_API __declspec(dllexport)
#endif
Last reply 3 months ago
University blocked ethernet because of personal routerLast reply 3 months ago
How do you know if someone's account got hacked or suspended???Last reply 3 months ago
Do you mind foreigners posting stuff in their language on social media?Last reply 6 months ago
My family say I’m stupid for not wanting to spend more than £1.1k on a laptop