WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: JTaylor on May 25, 2020, 08:44:33 AM

Title: SDK - More Error Info
Post by: JTaylor on May 25, 2020, 08:44:33 AM
Is there a way to return More Error Info from the Extender?  I know how to create my own Error codes and return an Error but need to include "More Info" .   If so, a point in the right direction would be appreciated.

Thanks.

Jim
Title: Re: SDK - More Error Info
Post by: td on May 25, 2020, 08:51:38 AM
It's in addons.h:

Code (c) Select
/*---------------------------------------------------------------------------
LONG FARPASCAL DllStoreErrorInfo(HGLOBAL hBatData, LPSTR lpErrorInfo)

  hBatData     =  lpViperStruct->hBatData
  lpErrorInfo  =  error information string to store

  Returns 0 on success, or a positive value on error:
     1  Function failed
     2  GlobalLock(hBatData) failed
-----------------------------------------------------------------------------*/

typedef LONG (FARPASCAL * DLLSTOREERRORINFO) (HGLOBAL, LPSTR);


Note that the function name contains part of the name of the button on the WIL error message box.
Title: Re: SDK - More Error Info
Post by: JTaylor on May 25, 2020, 09:35:45 AM
Excellent.  That did the job.  Thanks.

Jim
Title: Re: SDK - More Error Info
Post by: td on May 25, 2020, 09:41:56 AM
There is an inline template method in WTExtender.h, as well.

Code (c) Select
inline long DllStoreErrorInfo(LPCSTR lpErrorInfo) throw()
{
return m_lpViperStruct->lpfnDllStoreErrorInfo(m_lpViperStruct->hBatData,(LPSTR)lpErrorInfo);
}
Title: Re: SDK - More Error Info
Post by: JTaylor on May 25, 2020, 10:03:12 AM
Yep.  That is what I used.  Thanks again.

Jim