[comp.windows.ms.programmer] Global data segments for edit controls

tracy@cory.Berkeley.EDU (Tracy Elmore) (11/17/90)

Has anyone succeeded in creating edit controls that have their own data
segment?  (I'm talking about edit control windows, not the controls inside
dialog boxes.)  
I have some examples from MS Online on how to do this, and I 
can almost get it to work, except... The problem is that when I try to 
subclass the edit control, and try to use EM_GETHANDLE, EM_SETHANDLE, they
dont seem to work.  I think thats because they are looking in the wrong
segment for the buffer handle, but I'm not sure.

This is the big snag in the program that I'm working on, so if anyone has
anyu suggestions I would greatly appreciate it.

Thanks in advance,

Alex Zeltser

kensy@microsoft.UUCP (Ken SYKES) (11/26/90)

In article <8995@pasteur.Berkeley.EDU> tracy@cory.Berkeley.EDU (Tracy Elmore) writes:
>Has anyone succeeded in creating edit controls that have their own data
>segment?  (I'm talking about edit control windows, not the controls inside
>dialog boxes.)  
>I have some examples from MS Online on how to do this, and I 

This is a shot in the dark but make sure you use DS_LOCALEDIT in the 
style field of your edit control (Either in the dialog template or the
CreateWindow call.)  If this flag isn't set EM_GETHANDLE and EM_SETHANDLE
aren't going to do what you wanna do.  

Hope this helps.

Ken Sykes
Disclaimer: The above opinions are solely my own.

P.S.  A few people have mailed things to me directly and I have no success
getting replies back.  If you have questions please send them to this forum
so that I can reply and others can benefit as well.