我有我的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