Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #7403
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail |
|---|---|
| From | "Uwe Heyer" <uwe.heyer@aristik.de> |
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: TAPI and FormatMessage |
| Date | 7 Nov 2014 21:24:54 GMT |
| Lines | 71 |
| Message-ID | <cc4rl6F8iq5U1@mid.individual.net> (permalink) |
| References | <ae55f9d9-d567-497b-a594-a7860b11819b@googlegroups.com> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=iso-8859-1 |
| X-Trace | individual.net pmGJpEM4+pkFikBvnSWtZw8VsyT5S2yCpYLXharaDV6aMIY8iN |
| Cancel-Lock | sha1:2+nKeHO+tGaI7v6oY2W3gUvXPaE= |
| User-Agent | XanaNews/1.18.1.6 |
| Xref | csiph.com comp.lang.clipper.visual-objects:7403 |
Show key headers only | View raw
Kai Michael Poppe wrote:
>
>
> FUNCTION TapiErrorMessage(dwError AS DWORD) AS STRING PASCAL
>
> LOCAL pMsgBuffer AS PSZ
> LOCAL cMessage AS STRING
>
> FormatMessage(_OR(FORMAT_MESSAGE_FROM_HMODULE,
> FORMAT_MESSAGE_ALLOCATE_BUFFER, FORMAT_MESSAGE_IGNORE_INSERTS),;
> GetModuleHandle(String2Psz("TAPI32.DLL")),; dwError,;
> 0,;
> @pMsgBuffer,;
> 1024,;
> NULL)
>
> cMessage := Psz2String(pMsgBuffer)
>
> LocalFree(pMsgBuffer)
>
> IF Right(cMessage, 2) = CRLF
> cMessage := Left(cMessage, SLen(cMessage) - 2)
> ENDIF
>
> RETURN cMessage
>
> Yet, no matter what dwError I put into the aforementioned function
> from TapiErrorFormatMessage, i only get back empty strings. I tried
> using GetModuleHandle for TAPI, TAPI3 and TAPIUI as DLLs also, but it
> returns 0x0 so there's obviously no difference. Only TAPI32.DLL has a
> ModuleHandle > 0.
>
> I would be grateful for any hints as to make this work in VO.
>
> Regards
>
> Kai
--
Hi Kai,
first of all I would inspect the return code from FormatMessage
if FormatMessage(...) = 0 // Error
? GetLastError() // Get error number
inspect error for description string
using another FormatMessage call
or let us know this error number
else // ok
> 0 == char/byte counter of pMsgBuffer
second, I would use 0 for sizeof(buffer) (your 1024)
Ahoj
-Uwe
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
TAPI and FormatMessage Kai Michael Poppe <kmpams@gmail.com> - 2014-11-07 06:22 -0800 Re: TAPI and FormatMessage "Uwe Heyer" <uwe.heyer@aristik.de> - 2014-11-07 21:24 +0000
csiph-web