我有我的C + + DLL的新问题...我试图导出整个类而不是只有一个方法。但该计划并不想现在就编译因认为全球范围内没有任何的getURL
这里是我的“UrlConnector.h”: 错误:全球范围没有GetUrl
#define ConnectMe __declspec(dllexport)
namespace ConnectHttps { class ConnectMe { void GetUrl(char *url, unsigned int bufferLength); }; }
这里是我UrlConnector.cpp的一部分,是不是编译:
#include "UrlConnector.h"
#include "MyConnectionClass.h"
#include
using namespace std;
namespace ConnectHttps
{
void ConnectMe::GetUrl(char* url, unsigned bufferLength)
{
MyConnectionClass initSec;
string response = initSec.GetResult();
strncpy_s(url, bufferLength, response.c_str(), response.length());
}
}
现在,我想能够从这个创建一个DLL,我想做一个测试程序从dll调用类和方法GetUrl。我正在使用Visual Studio 2010和Visual C++ DLL。
我也设法读取 this from the MSDN和 this tutorial以及,但我似乎无法得到它的工作! 我真的很感激任何帮助!
谢谢你的快速回答...你是#1 – dirbacke 2010-10-28 16:04:22