1. typedef int (*MYPROC)(LPTSTR);
2. hinstLib = LoadLibrary(TEXT("myputs"));
3. ProcAdd = (MYPROC) GetProcAddress(hinstLib, TEXT("myPuts"));

>1. typedef int (*MYPROC)(LPTSTR);

This declares an alias MYPROC which is a pointer to a function taking an LPTSTR as a parameter and returning an int.

>2. hinstLib = LoadLibrary(TEXT("myputs"));

This is a call to the function LoadLibrary, which is passed the parameter of TEXT("myputs") -- TEXT is likely a macro that may be used to make it a string of wide characters if applicable. The return value of the function is assigned to hinstLib.

>3. ProcAdd = (MYPROC) GetProcAddress(hinstLib, TEXT("myPuts"));

This is a call to the function GetProcAddress, which is passed the parameters of hinstLib and TEXT("myPuts"). The return value of the function is cast to a pointer to a function taking an LPTSTR as a parameter and returning an int, and this result is assigned to ProcAdd.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.