I don't see code for allocating a new color, assigning an rgb value to the allocated color, allocating a new scroll markup id, or assigning the allocated color to the allocated scroll markup id.
Here's the basic outline for usage, including the "overhead" calls for allocating everything and setting them up.
#if __VERSION__ >= 17
// Declare variables (not static).
int s_colorScrollMarkup = -1;
int s_markertypeScrollMarkup = -1;
// Macro initialization.
definit()
{
if ( arg( 1 ) != 'L' )
{
s_markertypeScrollMarkup = -1;
}
else
{
if ( s_markertypeScrollMarkup != -1 )
_ScrollMarkupRemoveAllType( s_markertypeScrollMarkup );
}
}
// Demand-initialization for colors; can be called repeatedly.
static void EnsureScrollMarkupInitialized()
{
if ( s_colorScrollMarkup == -1 )
s_colorScrollMarkup = _AllocColor();
_default_color( s_colorScrollMarkup, 0, _rgb( 0xcc, 0xbb, 0x00 ), 0 );
if ( s_markertypeScrollMarkup == -1 )
{
s_markertypeScrollMarkup = _ScrollMarkupAllocType();
_ScrollMarkupSetTypeColor( s_markertypeScrollMarkup, s_colorScrollMarkup );
}
}
// Sample function...
_command void DoIt() name_info(','VSARG2_READ_ONLY|VSARG2_MARK|VSARG2_REQUIRES_MDI_EDITORCTL)
{
EnsureScrollMarkupInitialized();
_ScrollMarkupRemoveAllType( s_markertypeScrollMarkup );
// HERE IS AN EXAMPLE OF ADDING SCROLL MARKUP.
// LINE_NUM = starting line number to mark.
// COUNT_OF_LINES = number of lines to mark.
_ScrollMarkupAdd( view_id, LINE_NUM, s_markertypeScrollMarkup, COUNT_OF_LINES );
}
#endif