Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 17th April 2012, 05:09   #1
lloydtech
Junior Member
 
Join Date: Mar 2011
Posts: 20
NSIS Unicode issues

Hi,

I am writing a plugin to meet my customized requirements. This is how the plugin fn. structure look like.
code:

extern "C" void __declspec(dllexport) AddMyUser(HWND hwndParent, int string_size,TCHAR *variables, stack_t **stacktop,extra_parameters *extra)
{
g_hwndParent=hwndParent;
EXDLL_INIT();
{
wchar_t password[512]=L"\0";
wchar_t username[2048]=L"\0";

if(popstring(username)==1||popstring(password)==1)
{
....
}
USER_INFO_1 ui;
ui.usri1_name =username;
....
....



The popped username and password does not seems to correctly popped as a unicode string. I have written this plugin to add a new user (I know plugins are already available in NSIS), when I give the command "net user" in command prompt it shows some junk characters. I am using visual studio 2010 and and the build setting is "use unicode character set". And I am calling the plugin fn. from NSIS script as follows

code:
MyNSISPlugin::AddMyUser "StdUser" $Password


while compiling I am getting the following warning also
code:
>C:\Program Files\Microsoft Visual Studio 10.0\VC\include\tchar.h(268): warning C4005: '_vstprintf' : macro redefinition
1> h:\myplugin\nsis\nsis_tchar.h(41) : see previous definition of '_vstprintf'



Where could be the mistake?

Thanks for your help,
Lloyd
lloydtech is offline   Reply With Quote
Old 19th April 2012, 11:13   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,203
Have you linked against the correct plug-in library? Just changing the character set alone is not enough.

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump