Converter string em AnsiChar

Delphi

23/05/2005

Bom dia, como converte string em AnsiChar? Pois fiz uma função para os botões, mas ao passar parâmetro tipo string, dá o erro de incompatibilidade nos tipos de variáveis:

Função
function  Botoes(cStr,cCaption : string) : string;
begin
   Messagebox( 0 , cStr , cCaption , MB_YESNO + MB_ICONEXCLAMATION);
end;


Erro:
[Error] uCadUsu.pas(195): Incompatible types: ´String´ and ´PAnsiChar´


Grato amigos


Aldus

Aldus

Curtidas 0

Respostas

Rafael Mattos

Rafael Mattos

23/05/2005

Cara se não me engano é assim:

PChar(´String´);


GOSTEI 0
Aldus

Aldus

23/05/2005

Raf, era isso mesmo.

Obrigado

Até


GOSTEI 0
POSTAR