简体   繁体   English

C ++访问冲突:TImage.Picture为null

[英]C++ access violation: TImage.Picture is null

I recently made some minor changes within my c++-builder-project-settings to distribute a built application, however now some kind of initialisation seems to be missing. 最近,我在c ++-builder-project-settings中进行了一些小的更改,以分发已构建的应用程序,但是现在似乎缺少某种初始化。

Before I was using this (worked properly): 在我使用它之前(正常工作):

TPngImage *img=new TPngImage;
img->LoadFromFile(pfad);
Image1->Picture->Assign(img);

However, suddenly I get the error: access-violation... access to 0x0000000. 但是,突然我得到了错误:访问冲突...访问0x0000000。 I checked and noticed that Image1->Picture is Null. 我检查并发现Image1-> Picture为Null。 Image1 is of course a TImage-Object added per designer. Image1当然是每个设计人员添加的TImage对象。 I'm using embarcaderos XE2 16 c++-Builder. 我正在使用embarcaderos XE2 16 c ++-Builder。

Is there a setting for this or could you tell me, what I have to do? 有这个设置吗?或者您能告诉我,我该怎么做? I thought of Image1->Picture=new TPicture(); 我想到了Image1-> Picture = new TPicture(); already, but that is also Null... 已经,但是那也是空的...

It seems that it was my settings... 看来这是我的设定...
Somehow I messed some setting up. 不知何故,我搞砸了一些设置。

I exported the settings of a new project, copied my include-paths, overwrote the settings with the exported one and inserted the includes. 我导出了一个新项目的设置,复制了我的包含路径,用导出的内容覆盖了设置并插入了包含。

Now everything works again. 现在,一切又恢复了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM