Any ideas on why a custom DLL and Uninstallshield -> shared files removal
would be incompatible?
Thanks in advance for all help
HRESULT UnregisterMyInprocServer(LPCTSTR szFullPathToServer);
/* Name: A::UnregisterMyInprocServer @func
Description: Unregisters an Inproc Server (.DLL, .OCX) by calling
DLLUnregisterServer
This will not work with LocalServers (.EXE files)!
@parm LPTCSTR | szFullPathToServer | Full path to the server
@rdesc HRESULT - S_OK if peach, E_FAIL otherwise */
HRESULT UnregisterMyInprocServer(LPCTSTR szFullPathToServer)
{
HRESULT hRet; // return code HRESULT
HANDLE hDLL; // handle to loaded library
// this is the weird typedef I was talking about
typedef HRESULT (__stdcall * LPFNDLLFUNC1)(void);
// declare an instance variable of it
LPFNDLLFUNC1 MyDllUnregisterServer = NULL;
// sanity check #1, use #include "shlwapi.h" & use shlwapi.lib in the
linker
if (!PathFileExists(szFullPathToServer))
return E_FAIL;
// load the library
hDLL = LoadLibrary(szFullPathToServer);
// other sanity check
if (!hDLL)
return E_FAIL;
// Ok, find the address of the Unregister function
MyDllUnregisterServer = (LPFNDLLFUNC1)GetProcAddress((HINSTANCE)hDLL,
"DllUnregisterServer");
// This should have work if its a COM server (.OCX, .DLL)
if (!MyDllUnregisterServer)
return E_FAIL;
// Unregister!
hRet = MyDllUnregisterServer();
// and free the library, otherwise installshield uninstaller will
complain
FreeLibrary((HMODULE)hDLL);
return S_OK;
}
Just call UnregisterMyInprocServer(_T("c:\\...\\yourcomserver.dll")); and it
should unregister, as well as unmap the com server from the uninstaller
process memory.
----------------------------------------------------------------------------
--------------------------------------------------------
Darlene Ruben <dru...@xvault.com> wrote in message
news:39633...@208.30.171.38...