OpenersNotesSection(Spacer1)Details

Sometimes it is useful to provide a form of identification to the other side of the link prior to sending any packet data. MLSetEnvIDString() sets the application's identification string and MathLink will exchange that string with any remote MathLink connection during (NonWLLink[MLActivate(), paclet:ref/c/MLActivate]) time.

MLSetEnvIDString() returns 0 in the event of an error, and a nonzero value if the function succeeds.

MLSetEnvIDString() is declared in the MathLink header file (RefLink[mathlink.h, paclet:ref/file/mathlink.h]).

OpenersPrimaryExamplesSection(Spacer1)Examples  (1)

OpenersExampleSection0(Spacer1)Basic Examples  (1)

#include "mathlink.h"

int main()
{
	MLENV env;

	env = MLInitialize((MLEnvironmentParameter)0);
	if(env == (MLENV)0)
		{ /* unable to initialize the MathLink environment */ }

	if(! MLSetEnvIDString(env, "Your Company Inc. App 25"))
		{ /* unable to set app ID string */ }

	/* ... */	

	MLDeinitialize(env);
	return 0;
}

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(NonWLLink[MLGetLinkedEnvIDString(), paclet:ref/c/MLGetLinkedEnvIDString])}})}})