News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

Edit control gets locked after file in Streamed in. Why?

Started by xandaz, November 30, 2020, 04:48:49 AM

Previous topic - Next topic

xandaz

  Hey... i'm getting pretty desperate at this. After the file is loaded into the richedit control it gets lock and can't do any input. Any ideas why. The file was opened with GENERIC_READ ..._WRITE and FILE_SHARE_READ ..._WRITE. I'm getting pretty disgusted with my lowly skills...thanks in advance

guga

Quote from: xandaz on November 30, 2020, 04:48:49 AM
  Hey... i'm getting pretty desperate at this. After the file is loaded into the richedit control it gets lock and can't do any input. Any ideas why. The file was opened with GENERIC_READ ..._WRITE and FILE_SHARE_READ ..._WRITE. I'm getting pretty disgusted with my lowly skills...thanks in advance

Post the code you are doing so other can help. :thumbsup:
Coding in Assembly requires a mix of:
80% of brain, passion, intuition, creativity
10% of programming skills
10% of alcoholic levels in your blood.

My Code Sites:
http://rosasm.freeforums.org
http://winasm.tripod.com

xandaz

   the code is kinda wide... thanks for helping out. i've been trying UnlockFile among other things...

jj2007

And we have to guess what all this code does???

loop_3:
                    push    ecx
                    invoke  SendMessage,hMdi,WM_MDIGETACTIVE,0,0
                    mov     hCurrentWindow,eax
                    .if     kc_flag==IDYES
                            invoke  GetWindowLong,hCurrentWindow,GWL_USERDATA
                            mov     edi,eax
                           .if     [eax.MdiStruct.hFile]!=0
                                invoke  hFilePositive
                            .endif
                    .endif                           
                     invoke  SendMessage,hMdi,WM_MDIDESTROY,hCurrentWindow,0
                     dec     noMdiChild
                     dec     MdiId
                     dec     RichEditId
                     dec     ToolbarId
                     pop     ecx
                     loop    loop_3

xandaz

   Sorry for being so lowly gifted. Don't Bother peeking into the code. It has become too complex. Thanks anyway

jj2007

That has nothing to do with "lowly gifted". It has a lot to do with the total absence of comments. A few months from now, you will not be able to understand your own code.

Vortex

Jochen mentioned about a very important principle of coding. Commenting can even take precedence over algorithm design as nobody can keep in my mind all the details of coding sessions.

TimoVJL

May the source be with you

xandaz

   should i close handle right after. Can't i do it when session ends? Thanks

TimoVJL

May the source be with you

xandaz

    i thought i should keep the handle opened for future operations. Isn't that the standard procedure?

xandaz

   Hey guys. Actually closing the handles simplified my task. ty guys. you're the best