The MASM Forum

General => The Campus => Topic started by: Bobbolo on March 23, 2017, 07:22:28 AM

Title: Masm Help
Post by: Bobbolo on March 23, 2017, 07:22:28 AM
Good morning
I wrote a program, but after a short time does not work anymore.
Attached the programma.Mi you give where I made mistakes.
Sorry for my English, I'm Italian.
Thanks in advance
Title: Re: Masm Help
Post by: jj2007 on March 23, 2017, 08:07:45 AM
Do some error checking, and control what's wrong with your resources - rc.exe has error messages.
invoke CreateDialogParam,hInstance,IDD_DIALOG,NULL,addr WndProc,NULL
test eax, eax
je @error
Title: Re: Masm Help
Post by: dedndave on March 23, 2017, 09:55:03 AM
the symptom you are describng often happens when an object is created repeatedly, but never deleted
this aplies to things like windows, controls, pens, brushes, bitmaps, and so on
quite often, it's a GDI object that is overlooked (pens, brushes, bitmaps, etc)
Title: Re: Masm Help
Post by: Bobbolo on March 23, 2017, 10:52:39 AM
Thanks for the information.
But I think I've deleted all objects,
At every turn I destroy all the objects.
Thank you for your quick answer,
have a nice day,
Roberto
Title: Re: Masm Help
Post by: sinsi on March 23, 2017, 12:13:59 PM
Quote from: Bobbolo on March 23, 2017, 10:52:39 AM
But I think I've deleted all objects,
You create hNullBrush but don't delete it.
Title: Re: Masm Help
Post by: jj2007 on March 23, 2017, 06:15:11 PM
@sinsi: :t

Besides:
trasparentclock.rc(1) : fatal error RC1015: cannot open include file 'Res/TrasparentClockSetupDlg.rc'.

The setup of your resources is unnecessarily complicated, and you have not zipped all necessary files. It may assemble without resources, but it will not run: CreateDialogParam will fail, and since you don't check the return value, it will hang indefinitely, so that you can kill it only with task manager aka gestione attività 8)
Title: Re: Masm Help
Post by: Bobbolo on March 23, 2017, 09:49:20 PM
Many thanks to all guys
I solved the problem
Thanks again