debug assertion failed winocc.cpp line:138 好不容易下载到一个程序,不能打开,大大们帮我一下吧!急!

debug assertion failed winocc.cpp line:138 好不容易下载到一个程序,不能打开,大大们帮我一下吧!急!,第1张

这个应该是创建窗口代码的问题。

ASSERT是断言,是C++中用于调试的一个宏。其原理如下:检查传入参数是否为FALSE(即0),如果是则在stderr中输出错误并d窗提示,伪代码如下:

void myassert(int canshu){

if(canshu){

return

}

else{

//进行d窗和输出

}

}

好的,进入正文。

其报错部位代码为ASSERT(::IsWindow(m_hWnd))

由m_hWnd可判断出此程序使用MFC编写,而IsWindow函数用于判断窗口是否有效,传进判断句柄。若窗口有效则输出TRUE,否则为FALSE。

下面是MSDN对该函数的解释:

IsWindow function (winuser.h)

10/13/2021

2 minutes to read

Is this page helpful?

Determines whether the specified window handle identifies an existing window.

Syntax

C++CopyBOOL IsWindow(   [in, optional] HWND hWnd )

Parameters

[in, optional] hWnd

Type: HWND

A handle to the window to be tested.

Return value

Type: BOOL

If the window handle identifies an existing window, the return value is nonzero.

If the window handle does not identify an existing window, the return value is zero.

Remarks

A thread should not use IsWindow for a window that it did not create because the window could be destroyed after this function was called. Further, because window handles are recycled the handle could even point to a different window.

Examples

For an example, see Creating a Modeless Dialog Box.

那么,可以看出,由于某种原因,句柄或者句柄对应的窗口无效,导致IsWindow返回了FALSE,而ASSERT收到了返回值FALSE,判断该函数出错,因此报错。

总结,这应该是程序编写者的代码在创建窗口时出错,应该向程序作者反馈。

改好程序如下:

#include

<iostream>

#include

<string>

using

namespace

std

int

main()

{

string

word

while

(

cin

>>

word

)

{

if

(word=="g")

break//错误主要在这行,if后面条件要放括号里,

//g是一个字符串的话要用引号引起来,break语句后面还少了个分号

else

cout<<

"word

read

is:

"

<<

word

<<

'\n'}

cout

<<

"ok:

no

more

words

to

read:

bye!\n"

return

0

}

Lesson 1 A private conversation

课文内容:

Last week I went to the theatre. I had a very good seat. The play was very interesting. I did not enjoy it. A young man and a young woman were sitting behind me. They were talking loudly. I got very angry. I could not hear the actors. I turned round. I looked at the man and the woman angrily. They did not pay any attention. In the end, I could not bear it. I turned round again. ‘I can't hear a word!’ I said angrily.

‘It's none of your business, ’ the young man said rudely. ‘This is a private conversation!’

Notes on the text 课文注释

1 go to the theatre,去看戏。

2 got angry,生气。

3 turn round,转身,也可用turn around。

4 pay attention,注意。

5 I could not bear it.我无法忍受。 其中的it是指上文中的那对男女大声说话又不理会作者的愤怒目光。

6 none of your business,不关你的事。

参考译文:

上星期我去看戏。我的座位很好,戏很有意思,但我却无法欣赏。一青年男子与一青年女子坐在我的身后,大声地说着话。我非常生气,因为我听不见演员在说什么。我回过头去怒视着那一男一女,他们却毫不理会。最后,我忍不住了,又一次回过头去,生气地说:“我一个字也听不见了!”

“不关你的事,”那男的毫不客气地说,“这是私人间的谈话!”

Lesson 2 Breakfast or lunch? 早餐还是午餐?

课文内容:

It was Sunday. I never get up early on Sundays. I sometimes stay in bed until lunchtime. Last Sunday I got up very late. I looked out of the window. It was dark outside. ‘What a day!’ I thought. ‘It's raining again. ’ Just then, the telephone rang. It was my aunt Lucy. ‘I've just arrived by train, ’ she said. ‘I'm coming to see you. ’

‘But I'm still having breakfast, ’ I said.

‘What are you doing?’ she asked.

‘I'm having breakfast, ’ I repeated.

‘Dear me, ’ she said. ‘Do you always get up so late? It's one o'clock!’

Notes on the text 课文注释

1 on Sundays,指每个星期日。星期几的前面用介词on。

2 What a day!多么糟糕的天气!这是一个省略的感叹句。完整的句子应该是What a day it is!英语中的感叹句常用what开头,后面紧跟一个名词或名词性短语(包括连系动词),然后是主语和谓语,句尾用感叹号。

3 I'm coming to see you.在这句话中现在进行时用来表示近期按计划或安排要进行的动作。

4 Dear me!天哪!这也是一个感叹句。

参考译文

那是个星期天,而在星期天我是从来不早起的,有时我要一直躺到吃午饭的时候。上个星期天,我起得很晚。我望望窗外,外面一片昏暗。“鬼天气!”我想,“又下雨了。”正在这时,电话铃响了。是我姑母露西打来的。“我刚下火车,”她说,“我这就来看你。”

“但我还在吃早饭,”我说。

“你在干什么?”她问道。

“我正在吃早饭,”我又说了一遍。

“天啊,”她说,“你总是起得这么晚吗?现在已经1点钟了!”

Lesson 3 Please send me a card

课文内容:

Postcards always spoil my holidays. Last summer, I went to Italy. I visited museums and sat in public gardens. A friendly waiter taught me a few words of Italian. Then he lent me a book. I read a few lines, but I did not understand a word. Every day I thought about postcards. My holidays passed quickly, but I did not send cards to my friends. On the last day I made a big decision. I got up early and bought thirty-seven cards. I spent the whole day in my room, but I did not write a single card!

Notes on the text 课文注释

1 a few words,几句话。

2 lent me a book中,lent是“借出”的意思。我们常说lend sb.sth.或lend sth.to sb.。borrow是“借入”的意思,常用的结构是borrow sth.或borrow sth.from sb。

参考译文

明信片总搅得我假日不得安宁。去年夏天,我去了意大利。我参观了博物馆,还去了公园。一位好客的服务员教了我几句意大利语,之后还借给我一本书。我读了几行,但一个字也不懂。我每天都想着明信片的事。假期过得真快,可我还没有给我的朋友们寄过一张明信片。到了最后一天,我作出了一项重大决定。我早早起了床,买来了37张明信片。我在房间里关了整整一天。然而竟连一张明信片也没写成!

Lesson 4 An exciting trip 激动人心的旅行

课文内容:

I have just received a letter from my brother, Tim. He is in Australia. He has been there for six months. Tim is an engineer. He is working for a big firm and he has already visited a great number of different places in Australia. He has just bought an Australian car and has gone to Alice Springs, a small town in the centre of Australia. He will soon visit Darwin From there, he will fly to Perth. My brother has never been abroad before, so he is finding this trip very exciting.

Notes on the text 课文注释

1 He has been there for six months. 他在那儿已经住了6个月了。关于动词的现在完成时,可以参看第1册第83至87课。

2 a great number of…, 许多…,用于修饰复数可数名词。

3 in the centre of…, 在……中部。

参考译文

我刚刚收到弟弟蒂姆的来信,他正在澳大利亚。他在那儿已经住了6个月了。蒂姆是个工程师,正在为一家大公司工作,并且已经去过澳大利亚的不少地方了。他刚买了一辆澳大利亚小汽车,现在去了澳大利亚中部的小镇艾利斯斯普林斯。他不久还将到达尔文去,从那里,他再飞往珀斯。我弟弟以前从未出过国,因此,他觉得这次旅行非常激动人心。

Lesson 5 No wrong number 无号码错误之虞

课文内容:

Mr. James Scott has a garage in Silbury and now he has just bought another garage in Pinhurst. Pinhurst is only five miles from Silbury, but Mr. Scott cannot get a telephone for his new garage, so he has just bought twelve pigeons. Yesterday, a pigeon carried the first message from Pinburst to Silbury. The bird covered the distance the first three minutes. Up to now, Mr. Scott has sent a great many requests for spare parts and other urgent messages from one garage to the other. In this way, he has begun his own private‘telephone’service.

Notes on the text

课文注释

1 from Silbury:介词from作“距……”“离……”讲,常与away连用。如: It is far (away) from here. 离这里很远。

2 up to now (=up till now), 到现在为止;作时间状语,句子的时态多用现在完成时。

3 a great many, 许多的,其中great表示数量很大;只能同可数名词的复数连用。

参考译文

詹姆斯·斯科特先生在锡尔伯里有一个汽车修理部,现在他刚在平赫斯特买了另一个汽车修理部。平赫斯特离锡尔伯里只有5英里,但詹姆斯·斯科特先生未能为他新的汽车修理部搞到一部电话机,所以他买了12只鸽子。昨天,一只鸽子把第一封信从平赫斯特带到锡尔伯里。这只鸟只用了3分钟就飞完了全程。到目前为止,斯科特先生从一个汽车修理部向另一个发送了大量索取备件的信件和其他紧急函件。就这样,他开始了自己的私人“电话”业务。

Lesson 6 Percy Buttons

课文内容:

I have just moved to a house in Bridge Street. Yesterday a beggar knocked at my door. He asked me for a meal and a glass of beer. In return for this, the beggar stood on his head and sang songs. I gave him a meal. He ate the food and drank the beer. Then he put a piece of cheese in his pocket and went away. Later a neighbour told me about him. Everybody knows him. His name is Percy Buttons. He calls at every house in the street once a month and always asks for a meal and a glass of beer.

Notes on the text

课文注释

1 He asked me for a meal and a glass of beer. 他问我要一顿饭和一杯啤酒。ask sb. for sth. , 向某人索要某物。

2 in return for this, 作为报答,句中this指上文的a meal and a glass of beer。

3 stand on one's head, 倒立。

4 He calls at every house in the street. 他光顾街上的每一幢房子。

参考译文

我刚刚搬进了大桥街的一所房子。昨天一个乞丐来敲我的门,问我要一顿饭和一杯啤酒。作为回报,那乞丐头顶地倒立起来,嘴里还唱着歌。我给了他一顿饭。他把食物吃完,又喝了酒。然后把一块乳酪装进衣袋里走了。后来,一位邻居告诉了我他的情况。大家都认识他,他叫珀西·巴顿斯。他每月对这条街上的每户人家光顾一次,总是请求给他一顿饭和一杯啤酒。

Lesson 7 Too late 为时太晚

课文内容:

The plane was late and detectives were waiting at the airport all morning. They were expecting a valuable parcel of diamonds from South Africa. A few hours earlier, someone had told the police that thieves would try to steal the diamonds. When the plane arrived, some of the detectives were waiting inside the main building while others were waiting on the airfield. Two men took the parcel off the plane and carried it into the Customs House. While two detectives were keeping guard at the door, two others opened the parcel. To their surprise, the precious parcel was full of stones and sand!

Notes on the text 课文注释

1 detectives were waiting at the airport all morning,

侦探们在机场等了整整一上午。句中的动词时态是过去进行时。过去进行时常用来表示过去某时正在进行的情况或动作。本课课文中有4个句子使用了过去进行时。参看第1册第117-119等课中的例句。

2 keep guard, 守卫。

3 to their surprise,

使他们吃惊的是。

参考译文

飞机误点了,侦探们在机场等了整整一上午。他们正期待从南非来的一个装着钻石的贵重包裹。数小时以前,有人向警方报告,说有人企图偷走这些钻石。当飞机到达时,一些侦探等候在主楼内,另一些侦探则守候在停机坪上。有两个人把包裹拿下飞机,进了海关。这时两个侦探把住门口,另外两个侦探打开了包裹。令他们吃惊的是,那珍贵的包裹里面装的全是石头和沙子!

Lesson 8 The best and the worst 最好的和最差的

课文内容:

Joe Sanders has the most beautiful garden in our town. Nearly everybody enters for‘The Nicest Garden Competition’each year, but Joe wins every time. Bill Frith's garden is larger than Joe's. Bill works harder than Joe and grows more flowers and vegetables, but Joe's garden is more interesting. He has made neat paths and has built a wooden bridge over a pool. I like gardens too, but I do not like hard work. Every year I enter for the garden competition too, and I always win a little prize for the worst garden in the town!

Notes on the text 课文注释

1 Joe Sanders has the most beautiful garden in our town. 乔·桑德斯拥有我们镇上最漂亮的花园。在第1册的第107-112课中,我们讲到了英文中形容词和副词的比较级和最高级。本课的主要句型仍是形容词和副词的比较级和最高级。如果形容词或副词有两个以上音节,其比较级和最高级是在形容词或副词前加上more或most,如more interesting, the most beautiful。

2 enter for, 报名参加(各种竞赛,考试等活动)

3 more flowers and vegetables, 更多的花卉和蔬菜。英语中有些形容词或副词的比较级和最高级并不规则,如课文中的 good----better----best, bad----worse----worst, many----more----most。

4 for the worst garden in the town 是介词短语作定语,修饰prize。

参考译文

乔·桑德斯拥有我们镇上最漂亮的花园。几乎每个人都参加每年举办的“最佳花园竞赛”,而每次都是乔获胜。比尔·弗里斯的花园比乔的花园大,他比乔也更为勤奋,种植的花卉和蔬菜也更多,但乔的花园更富有情趣。他修筑了一条条整洁的小路,并在一个池塘上架了一座小木桥。我也喜欢花园,但我却不愿意辛勤劳动。每年的花园竞赛我也参加,但总因是镇上最劣的花园而获得一个小奖!

Lesson 9——A cold welcome

课文内容:

On Wednesday evening, we went to the Town Hall. It was the last day of the year and a large crowd of people had gathered under the Town Hall clock. It would strike twelve in twenty minutes' time. Fifteen minutes passed and then, at five to twelve, the clock stopped. The big minute hand did not move. We waited and waited, but nothing happened. Suddenly someone shouted, ‘It's two minutes past twelve! The clock has stopped!* I looked at my watch. It was true. The big clock refused to welcome the New Year. At that moment, everybody began to laugh and sing.

Notes on the text 课文注释

1 Town Hall , 市政厅,地方政府办公之处。

2 a large crowd of…,一大群……。

3 in twenty minutes'time, 20分钟之后。

参考译文

星期三的晚上,我们去了市政厅。那是一年的最后一天,一大群人聚集在市政厅的大钟下面。再过20分钟,大钟将敲响12下。15分钟过去了,而就在11点55分时,大钟停了。那根巨大的分针不动了。我们等啊等啊,可情况没有变化。突然有人喊道:“已经12点零2分了!那钟已经停了!”我看了一下我的手表,果真如此。那座大钟不愿意迎接新年。此时,大家已经笑了起来,同时唱起了歌。

Lesson 10—Not For Jazz

课文内容:

Not For Jazz

We have an old musical instrument. It is called a clavichord. It was made in Germany in 1681. Our clavichord is kept in the living-room. It has belonged to our family for a long time. The instrument was brought by my grandfather many years ago. Recently it was damaged by a visitor. She tried to play jazz on it! She struck the keys too hard and two of the strings were broken. My father was shocked. Now we were not allowed to touch it. It is being repaired by a friend of my father's.

参考译文:

我们有一件古老的乐器,叫击弦古钢琴.它是1681年德国制造的, 我们这架钢琴放在客厅里.我们家拥有它很长时间了,这件乐器是许多年前我祖父买来的.最近它被一位客人弄坏了,她用它d奏爵士乐! 她按键太猛,把两根弦按断了.我父亲为之震怒. 现在他不允许我们再碰它.父亲的一位朋友正在修理这件古老的乐器.

词汇:

jazz n.爵士音乐

musical a.音乐的

instrument n.器具

call vt.叫做

clavichord n.击弦古钢琴

Germany n.德国

keep vt.保存

living-room n.客厅

belong vi.属于

recently ad.最近

damage vt.损坏

play vt.d奏

key n.琴键

strike vt.敲

hard ad.重重地

string n.弦

break vt.弄断

shock vt.震惊

touch vt.碰

allow vt.允许

repair vt.修理 希望能帮到你~


欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/tougao/11372669.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-05-15
下一篇 2023-05-15

发表评论

登录后才能评论

评论列表(0条)

保存