Difference between revisions of "Talk:Beginner's Basic Plugin Guide"

From Winamp Developer Wiki
Jump to: navigation, search
(Questions and TODO)
(Questions and TODO)
Line 12: Line 12:
  
 
* For the "cannot convert parameter from 'const char [x]' to 'LPCTSTR'" error, which option from the [http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/c1b08c0a-a803-41c3-ac8c-84eba3be1ddb MSDN FAQ] should we actually use? Is it better to change the project settings to use a multi-byte character set?
 
* For the "cannot convert parameter from 'const char [x]' to 'LPCTSTR'" error, which option from the [http://social.msdn.microsoft.com/Forums/en-US/vclanguage/thread/c1b08c0a-a803-41c3-ac8c-84eba3be1ddb MSDN FAQ] should we actually use? Is it better to change the project settings to use a multi-byte character set?
 +
 +
I would not change the project settings and instead use the L"" or _TEXT constructs to indicate that the strings are wide strings.  Winamp programmers prefer to be even more specific and actually call the MessageBoxW() or MessageBoxA() methods to make it absolutely clear as to which function and what form the input is in (this would make the project switch meaningless).  Since Winamp is a very popular application around the world it is best to use UNICODE. 
 +
 +
Having said that, Winamp is also ancient (in computer years) and so every once in a while you might run across Winamp functions that do not handle UNICODE and will require ASCII strings.
 +
 
* Why do some people put their 'extern "C" __declspec' code in the header and others in the .cpp? Does it matter?
 
* Why do some people put their 'extern "C" __declspec' code in the header and others in the .cpp? Does it matter?
  
 
==Next Steps==
 
==Next Steps==
 
I think a good extension of this article would be to answer the user's question of "Okay, now what?". If we could give them hints about where to go next, possibly depending on the type of plugin they want to write, that might be useful. This may just involve fleshing out the guide articles for each type of plugin and then linking to those... unless someone can think of something better? --[[User:Culix|Culix]] 14:54, 10 June 2009 (UTC)
 
I think a good extension of this article would be to answer the user's question of "Okay, now what?". If we could give them hints about where to go next, possibly depending on the type of plugin they want to write, that might be useful. This may just involve fleshing out the guide articles for each type of plugin and then linking to those... unless someone can think of something better? --[[User:Culix|Culix]] 14:54, 10 June 2009 (UTC)

Revision as of 18:51, 2 July 2009

Is this format okay?

Hey everyone, this is my first work with any Winamp plugin code and my first edits to the wiki. Sorry if anything is in the wrong format or wrong place. Please feel free to move or work on it; I'm open to suggestions on how to improve. --Culix 02:29, 10 June 2009 (UTC)

Questions and TODO

I still have a few questions about writing plugins. These should probably be filled into the guide at some point. --Culix 02:34, 10 June 2009 (UTC)

  • How do the naming conventions work for plugins? It seems more complicated than simply naming your file 'gen_*' or 'ml_*'.
The answer to this is complicated, as so much with Winamp.  The prefix is actually used by Winamp.exe to find plugins and identify what type they are.  There is another way to create plugins that does not require the prefix.  This second way is called Wasabi.  Wasabi is a way to 'share' code among components of a software system (i.e., Winamp).  Wasabi dlls do not need the prefix.  We'll get to Wasabi if we keep writing these kinds of tutorials.  Is there something specific about the prefixes that leads you to believe that there is a 'real' answer?  Maybe I can investigate further.


  • For the "cannot convert parameter from 'const char [x]' to 'LPCTSTR'" error, which option from the MSDN FAQ should we actually use? Is it better to change the project settings to use a multi-byte character set?

I would not change the project settings and instead use the L"" or _TEXT constructs to indicate that the strings are wide strings. Winamp programmers prefer to be even more specific and actually call the MessageBoxW() or MessageBoxA() methods to make it absolutely clear as to which function and what form the input is in (this would make the project switch meaningless). Since Winamp is a very popular application around the world it is best to use UNICODE.

Having said that, Winamp is also ancient (in computer years) and so every once in a while you might run across Winamp functions that do not handle UNICODE and will require ASCII strings.

  • Why do some people put their 'extern "C" __declspec' code in the header and others in the .cpp? Does it matter?

Next Steps

I think a good extension of this article would be to answer the user's question of "Okay, now what?". If we could give them hints about where to go next, possibly depending on the type of plugin they want to write, that might be useful. This may just involve fleshing out the guide articles for each type of plugin and then linking to those... unless someone can think of something better? --Culix 14:54, 10 June 2009 (UTC)