大佬教程收集整理的这篇文章主要介绍了TBitmap.Create不能在delphi控制台应用程序中工作,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
E2003 Undeclared identifier: 'Create'
此示例应用程序会再现该问题
{$APPTYPE CONSOLE} {$R *.res} uses System.SysUtils,Vcl.Graphics,WinApi.Windows; procedure CreateBitMap; Var Bmp : TBitmap; Flag : DWORD; begin Bmp:=TBitmap.Create; //this line produce the error of compilation try //do something finally Bmp.Free; end; end; begin try CreateBitMap; except on E: Exception do Writeln(E.ClassName,': ',E.messagE); end; end.
为什么这段代码不能编译?
uses System.SysUtils,WinApi.Windows,Vcl.Graphics;
或者您可以使用完全限定名称声明类型
procedure CreateBitMap; Var Bmp : Vcl.Graphics.TBitmap; Flag : DWORD; begin Bmp:=Vcl.Graphics.TBitmap.Create; try //do something finally Bmp.Free; end; end;
以上是大佬教程为你收集整理的TBitmap.Create不能在delphi控制台应用程序中工作全部内容,希望文章能够帮你解决TBitmap.Create不能在delphi控制台应用程序中工作所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。