Author Topic: Getting and setting macro defs  (Read 4773 times)

Wanderer

  • Senior Community Member
  • Posts: 557
  • Hero Points: 23
Getting and setting macro defs
« on: November 21, 2008, 01:03:50 PM »
Hello,
Is it possible, from a dll, to get and set macro defs?
I looked for a vsXXXX function, but didn't find one.
Thanks for any hints....

chrisant

  • Senior Community Member
  • Posts: 1410
  • Hero Points: 131
Re: Getting and setting macro defs
« Reply #1 on: November 22, 2008, 11:08:21 PM »
Here is sample code to get a string variable.
That should give you pointers to the API functions to look up for other variations on the pattern.

Code: [Select]
int index = vsFindIndex( "varname", VSTYPE_VAR );
if ( index >= 0 )
{
    VSHVAR hvar = vsGetVar( index );
    DoSomethingWithTheString( vsHvarGetZ( hvar );
}
else
{
    // Failed to find the variable "varname", take appropriate action...
}