Qual è il modo migliore per ottenere i risultati di GetLastError () dopo una chiamata WinAPI in un bel carattere *?

StackOverflow https://stackoverflow.com/questions/1613439

Domanda

Sto scrivendo una DLL che un programma Java usa per chiamare WinAPI in vari modi. Voglio restituire le giuste eccezioni a java ma ho bisogno di un errore WinAPI ben formattato non solo l'int che viene restituito da GetLastError (). Sono sicuro che c'è un bel modo di farlo.

È stato utile?

Soluzione

Usa " FormatMessage " ;; puoi passare il codice di errore come terzo parametro e far sì che FormatMessage assegni lo spazio per te.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top