使用new 產生物件?? |
答題得分者是:axsoft
|
tpchen
一般會員 發表:3 回覆:7 積分:2 註冊:2003-08-24 發送簡訊給我 |
|
axsoft
版主 發表:681 回覆:1056 積分:969 註冊:2002-03-13 發送簡訊給我 |
tpchen您好: 請參閱此篇文章試試
Resolving strange runtime errors in my VCL enabled console application. - by Borland Developer Support Staff
http://community.borland.com/article/0,1410,26084,00.html 原文如下:
Resolving strange runtime errors in my VCL enabled console application. - by Borland Developer Support Staff Abstract: A bug in the Console Wizard makes it possible to create a broken project when using the VCL. This document explains the problem and workarounds. Symptoms:
Access violation at application start up or shut down. Access violation when dynamically allocating STL objects. STL strings lose data for no reason. Most likely to happen in VCL enabled console applications created with Console Wizard.
Problem:
Any application that uses the VCL must be compiled with the thread safety compiler setting and linked to the VCL enabled runtime library (cp32mt.lib or cp32mti.lib). The IDE usually takes care of these settings for you, based on the project type you select. Unfortunately, a bug in the Console Wizard makes it possible to create a VCL enabled console project that does not compile for thread safety, but does link to the correct library. Inside the Console Wizard (File | New... | Console Wizard), you'll notice that the 'Multithread' box grays out when you check 'Use VCL' but does not become checked if it was not checked to begin with. Clicking 'OK' when 'VCL' is checked and 'Multithreaded' is not checked causes the error condition.
Solution:
For new projects, make sure 'Multithreaded' is checked if you are using the VCL. For existing projects, you must manually fix the problem in the project file. Open the project file (.BPR file) in an external editor such as notepad. Search for the line beginning with:
/*開心的事情別隱藏在心裡,分享給別人知道會更快樂的*/ /*得到新知識別隱藏在心裡,分享給別人了解會更清楚的*/發表人 - axsoft 於 2003/08/25 00:17:15 |
tpchen
一般會員 發表:3 回覆:7 積分:2 註冊:2003-08-24 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |