Old 6th August 2011, 17:29   #1
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
nsRichEdit plug-in

* Load a file into a rich edit control (using EM_STREAMIN).
* Provides formatted printing of a rich edit control.
* Allows oneself to add a print button to the NSIS license pages.

http://nsis.sourceforge.net/File:NsRichEdit.zip

Note to JasonFriday13 for CustomLicense plug-in: There are a number of errors in your code (which is one reason why I added my own function to this plug-in).

29: Should be TCHAR* FileName.
42: !FileHandle is not a valid test for an invalid handle (only use INVALID_HANDLE_VALUE).
46, 56, 60: You're not closing the file handle.
87, 88: The amount of memory to allocate should be sizeof(TCHAR) * string_size (because Unicode characters are 2 bytes).
105: You are casting the return value from GetLastError to (const TCHAR*) and pushing it onto the stack. This will (in most cases) cause a crash. To convert an integer to a string, use wsprintf. Besides, I'm not sure why you are using GetLastError because GlobalAlloc does not set it.

I'd recommend using EM_STREAMIN too as right now you are reading the entire license file into memory before setting it.

Stu
Afrow UK is offline   Reply With Quote
Old 8th August 2011, 04:45   #2
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 530
Send a message via ICQ to T.Slappy
Nice, your control replaces original License rich edit or it is only on new page [nsDialogs]?

Cool looking installer with custom design: www.graphical-installer.com
I offer NSIS scripting, C/C++/C#/Delphi programming: www.unsigned.sk
Develop NSIS projects in Visual Studio 2005-2019: www.visual-installer.com
or RAD Studio 2009, 2010, XE-10.3 Rio: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 8th August 2011, 09:18   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It can be used for any existing rich edit control as all it needs is a control handle (it does not create the control itself). It can be one you've added to a nsDialogs page or the existing license page rich edit control (use AddPrintButton for this). The example scripts demonstrate all functions.

Stu
Afrow UK is offline   Reply With Quote
Old 3rd April 2012, 11:41   #4
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 877
Cool, well it's nice to know a better piece of software has come up. My code was written way back when I was first understanding coding in C (initially to fix one of my installer problems). Some of the errors are obvious while others aren't. In fact, it's probably not worth keeping it on the wiki anymore as your plugin is clearly superior.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 is offline   Reply With Quote
Old 21st April 2012, 17:55   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
I have made a note on the wiki page.

Stu
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast 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