michael@0: // Unicode support by Jim Park -- 08/02/2007 michael@0: michael@0: #include michael@0: #include "tchar.h" michael@0: #include "exdll.h" michael@0: michael@0: HINSTANCE g_hInstance; michael@0: michael@0: HWND g_hwndParent; michael@0: michael@0: // To work with Unicode version of NSIS, please use TCHAR-type michael@0: // functions for accessing the variables and the stack. michael@0: michael@0: void __declspec(dllexport) myFunction(HWND hwndParent, int string_size, michael@0: TCHAR *variables, stack_t **stacktop, michael@0: extra_parameters *extra) michael@0: { michael@0: g_hwndParent=hwndParent; michael@0: michael@0: EXDLL_INIT(); michael@0: michael@0: michael@0: // note if you want parameters from the stack, pop them off in order. michael@0: // i.e. if you are called via exdll::myFunction file.dat poop.dat michael@0: // calling popstring() the first time would give you file.dat, michael@0: // and the second time would give you poop.dat. michael@0: // you should empty the stack of your parameters, and ONLY your michael@0: // parameters. michael@0: michael@0: // do your stuff here michael@0: { michael@0: TCHAR buf[1024]; michael@0: wsprintf(buf,_T("$0=%s\n"),getuservariable(INST_0)); michael@0: MessageBox(g_hwndParent,buf,0,MB_OK); michael@0: } michael@0: } michael@0: michael@0: michael@0: michael@0: BOOL WINAPI DllMain(HANDLE hInst, ULONG ul_reason_for_call, LPVOID lpReserved) michael@0: { michael@0: g_hInstance=hInst; michael@0: return TRUE; michael@0: }