GetBinderyObjectID
Returns a bindery object’s unique identification number (For cross-platform functionality, see Developing NLMs with Cross-Platform Functions ( NDK: NLM Development Concepts, Tools, and Functions) and call NWGetObjectID )
#include <\nlm\nit\nwbindry.h>
int GetBinderyObjectID (
char *objectName,
WORD objectType,
long *objectID);
The objectName and objectType parameters must uniquely identify the bindery object and must not contain wildcard characters. The objectName can be from 1 to 48 characters long, including the NULL terminator. Only printable characters can be used. Slashes, backslashes, colons, semicolons, commas, asterisks, and question marks are prohibited.
#include <stdio.h>
#include <\nlm\nit\nwbindry.h>
main()
{
char objName[48];
WORD objType;
long objectID;
int completionCode;
printf ("Enter Object Name: ");
scanf ("%s", objName);
printf ("\nEnter Object Type: ");
scanf ("%d", &objType);
completionCode = GetBinderyObjectID (objName, objType,
&objectID);
if (completionCode)
{
if (completionCode == 150)
printf ("SERVER OUT OF MEMORY\n\n");
if (completionCode == 239)
printf ("INVALID NAME\n\n");
if (completionCode == 240)
printf ("WILDCARD NOT ALLOWED\n\n");
if (completionCode == 252)
printf ("NO SUCH OBJECT\n\n");
if (completionCode == 254)
printf ("SERVER BINDERY LOCKED\n\n");
if (completionCode == 255)
printf ("BINDERY FAILURE\n\n");
}
else
printf ("\n\nObject ID for %s is... %8lX\n",
objName, objectID);
}