Среда: Windows XP SP3, Visual C ++ 2010 Express, шаблон DLL
Я пытаюсь передать аргументы командной строки в мою функцию DLL
Пример: "c: \ Development> rundll32, getpage.dll, GetPage http://www.google.ca"
Когда я передаю следующую строку "http://www.google.ca", я получаю случайные числа (при условии адреса адреса?)
#include "stdafx.h"
#include <string.h>
#include <string>
#include <stdlib.h>
#include <stdio.h>
#include <urlmon.h>
#include <tchar.h>
#include <fstream>
using namespace std;
extern "C" __declspec(dllexport) LPCWSTR __cdecl GetPage(LPCWSTR URL);
BOOL APIENTRY DllMain( HANDLE hModule, DWORD ul_reason_for_call, LPVOID lpReserved ){
return TRUE;
}
LPCWSTR GetPage(LPCWSTR URL){
LPCWSTR status;
HRESULT getpage_status = URLDownloadToFile ( NULL,URL, _TEXT("status.log"), 0, NULL );
/*** Do stuff is working if I pass a static string eg URL = "http://www.google.ca"; I need command line args sent to the function instead***/
return status;