The MASM Forum

General => The Campus => Topic started by: xandaz on October 16, 2021, 04:30:15 AM

Title: Problems with EM_STREAMOUT
Post by: xandaz on October 16, 2021, 04:30:15 AM
   Hi guys. I've been working on this little app for a very long time, but, then, i restored the system and forgot to backup. I got an old version from a previous post. I'm having trouble with the SAVE part of mdichild.asm. It doesn't streamout. Can someone look into it? Thanks in advance! You're the best!

Corrected the spelling in the title.
Title: Re: Problems with EM_STERAMOUT
Post by: jj2007 on October 16, 2021, 06:15:09 AM
No source? And the exe doesn't send any EM_STREAM* message.
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 06:44:30 AM
    Thanks JJ. You're the man.
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 06:50:26 AM
    OOOps. What do you mean no EM_STERAMOUT? It's in mdichild.asm. Did you Unassemble it and it came out as this? Sorry for trouble.
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 06:53:28 AM
   Shit. Sorry, my bad. I must have had built the zip file wrong.
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 06:54:55 AM
    here it goes! Sorry man.
Title: Re: Problems with EM_STERAMOUT
Post by: jj2007 on October 16, 2021, 09:50:48 AM
How is dwCookie being used...?

            invoke  CreateFile,gofn.lpstrFileTitle,GENERIC_WRITE+GENERIC_READ,\
                       FILE_SHARE_WRITE+FILE_SHARE_READ,0,CREATE_ALWAYS,\
                       FILE_ATTRIBUTE_NORMAL,0
            mov     [edi.MdiStruct.hFile],eax
            invoke  GetLastError
            invoke  MessageBoxA,0,str$(eax),0,MB_OK
            mov     EditStream.dwCookie,eax
            mov     EditStream.pfnCallback,offset StreamOutProc
            invoke  SendMessage,[edi.MdiStruct.hEdit],EM_STREAMOUT,SF_TEXT,addr EditStream
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 05:53:56 PM
    Oh yeah. I forgot to remove that. But still doesn't work. Thanks.
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 05:57:57 PM
    here it goes without the messagebox.
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 08:27:15 PM
    Thanks JJ. Problem solved. I was using only FILE_SHARE_READ when opening the file so i got access violation.
Title: Re: Problems with EM_STERAMOUT
Post by: xandaz on October 16, 2021, 10:27:54 PM
    Hey. Decided to just CloseHandle the file and open and save them with the need requests. Working fine! Thanks!