Syntax
VM_RESULT vm_tag_get_tag(
    VMCWSTR filename, 
    VM_TAG_ID tag_id, 
    void* buffer, 
    VMUINT* buffer_size
);
ContentsIndex
PreviousUpNext
vm_tag_get_tag
Example
Syntax
VM_RESULT vm_tag_get_tag(
    VMCWSTR filename, 
    VM_TAG_ID tag_id, 
    void* buffer, 
    VMUINT* buffer_size
);
Description

Get one tag from a given LinkIt application. This API gets information from VXP files on disk, or the current running VXP application.

Parameters
Parameters 
Description 
VMCWSTR filename 
[IN] Path to a VXP file to retrieve tag from; Pass NULL for current application. 
VM_TAG_ID tag_id 
[IN] Refer to VM_TAG_ID for tag information to retrieve. 
void* buffer 
[OUT] Value of the tag assigned by tag_id. Pass NULL to retrieve required buffer size from buffer_size. Refer to VM_TAG_ID for data type of the tag. 
VMUINT* buffer_size 
[OUT] Required buffer size for the tag information. 
Returns

VM_RESULT. Refer to VM_TAG_RESULT for detailed error codes. 

 

Example
VMINT appVersion = 0;     // Version is VMINT
VMWSTR appName = NULL;    // Application Name is VMWSTR
VMINT reqSize = 0;

// Application version is VMINT, always 4 bytes.
if(VM_IS_SUCCEEDED(vm_tag_get_tag(NULL,
                                  VM_TAG_ID_VERSION,
                                  &appVersion,
                                  sizeof(appVersion))))
{
  vm_log_info("version=%d.%d.%d", (appVersion >> 1) & 0xFF,
                                  (appVersion >> 2) & 0xFF,
                                  (appVersion >> 3) & 0xFF);
}

// Get required buffer size for Application Name information.
if (VM_IS_SUCCEEDED(vm_tag_get_tag(NULL,
                                   VM_TAG_ID_APP_NAME,
                                   NULL,
                                   &reqSize)))
{
  appName = (VMWSTR*)vm_calloc(reqSize);
  if(appName)
  {
      if(VM_IS_SUCCEEDED(vm_tag_get_tag(NULL,
                                        VM_TAG_ID_APP_NAME,
                                        appName,
                                        &reqSize)))
      {
          // You can then proceeed to
      }
  }
}
// free it when reserved
vm_free(tagName);
File

vmtag.h

Group
Created with a commercial version of Doc-O-Matic. In order to make this message disappear you need to register this software. If you have problems registering this software please contact us at support@toolsfactory.com.