??????????
????1????????GUID?????????????GUID.h????У?
????2???????????????????洦??
????3????globals.h??????????“#include "GUID.h"”??
????4?????????????:???????????GUID
????????????????????????lr_save_string?????????LoadRunner??????????????????????
char* lr_guid_gen(char* paramName){                         //????GUID????
typedef struct _GUID    {
unsigned long Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
GUID m_guid;
char buf[50];
char pNameStr[50];
CoCreateGuid(&m_guid);
// ??????????
//sprintf (buf?? "{%08lX-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}"?? // ??д
// sprintf (buf?? "{%08lx-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x}"??// Сд
sprintf (buf?? "%08lX%04X%04X%02X%02X%02X%02X%02X%02X%02X%02X"??// Сд
m_guid.Data1?? m_guid.Data2?? m_guid.Data3??
m_guid.Data4[0]?? m_guid.Data4[1]?? m_guid.Data4[2]?? m_guid.Data4[3]??
m_guid.Data4[4]?? m_guid.Data4[5]?? m_guid.Data4[6]?? m_guid.Data4[7]);
lr_save_string(buf?? paramName);
sprintf(pNameStr??"{%s}"??paramName);
return lr_eval_string(pNameStr);
}
Action()
{
char *test;
lr_load_dll("ole32.dll");      //????windows????GUID??API
test=lr_guid_gen("GUID");      //????????lr_guid_gen()????
lr_save_string(test??"GUID");
lr_output_message(test);
lr_output_message("xxxxxxxxxxxxx:%s"??lr_eval_string("{GUID}"));
return 0;
}
?????????1??????GUID????????????????????????д?????2???????????????????????GUID????