Hello,

This is the code I've written to install a .prc file to all
users listed (I know, it's not recommended, but I want to
do it anyway :), but it doesn't work!

I've tracked the problem down to the following line in the code below:

if((*PltGetUserPtr)(user_count, szUserName, &nUserNameSize) > 0){

Why isn't this statement fullfilled?

Thanks in advance!

/Bulent Gecer

============================================================================
===============================================================

int user_count;
short nUserNameSize;
TCHAR *szUserName = "";

int  (WINAPI *PltGetUserCountPtr)(void);
int  (WINAPI *PltGetUserPtr)(unsigned int iIndex, TCHAR *pUserBuffer, short
*psUserBufSize);
int  (WINAPI *PltInstallFilePtr)(TCHAR *pUser, TCHAR *pFileSpec);


if (!(lib=LoadLibrary("InstAide.dll")))
  return -1;
 // Install myapp.prc
 PltGetUserCountPtr=(int(WINAPI *)(void))
GetProcAddress(lib,"PltGetUserCount");
 if (PltGetUserCountPtr){
  user_count=(*PltGetUserCountPtr)();
 }
 else
 {
  FreeLibrary(lib);
  return -1;
 }

 while( --user_count >= 0 )


  nUserNameSize = sizeof(szUserName);
  PltGetUserPtr=(int(WINAPI *)(unsigned int iIndex, TCHAR *pUserBuffer,
short *psUserBufSize)) GetProcAddress(lib,"PltGetUser");

  if (PltGetUserPtr){
-->>   if((*PltGetUserPtr)(user_count, szUserName, &nUserNameSize) > 0){
    PltInstallFilePtr=(int(WINAPI *)(TCHAR *pUser, TCHAR *pFileSpec))
GetProcAddress(lib,"PltInstallFile");
    if (PltInstallFilePtr){
     err=(*PltInstallFilePtr)(szUserName,"myapp.prc");
    }
    else
    {
     FreeLibrary(lib);
     return -1;
    }
   }
  }
  else


   FreeLibrary(lib);
   return -1;
  }
 }

FreeLibrary(lib);

============================================================================
====================================================================






-- 
For information on using the ACCESS Developer Forums, or to unsubscribe, please 
see http://www.access-company.com/developers/forums/

Reply via email to