The following example demonstrates how to add a Resource, and then retrieve it.
Resource Example
struct { /* Resource Data Block structure */
ULONG resource_type;
ULONG resource_number;
TEXT variable_info[1016]; /* This holds the Resource Name and Data */
} my_resource;
my_resource.resource_type = 0x10001L; /* 65537*/
my_resource.resource_number = 0xffffffffL; /* c-tree assign # */
strcpy(my_resource.variable_info,"MY!resource");
strcpy(my_resource.variable_info+12,"Actual Resource Data");
if (AddCtResource(datno,&my_resource,
(VRLEN)(8 + 12 + strlen(my_resource.variable_info+12))) == 0) {
printf("\nThe resource has been assigned number %ld",
my_resource.resource_number);
printf("\nThe resource is located at byte offset %ld.",
GetCtResource(datno,"MY!resource", &my_resource,1024L,RES_NAME);
} else
printf("\nCould not add resource. Error #%d",uerr_cod);