home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #27 / NN_1992_27.iso / spool / comp / os / mswindo / programm / misc / 3505 < prev    next >
Encoding:
Internet Message Format  |  1992-11-17  |  2.4 KB

  1. Path: sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!news.acns.nwu.edu!uicvm.uic.edu!u43893
  2. Organization: University of Illinois at Chicago
  3. Date: Tue, 17 Nov 1992 20:40:02 CST
  4. From: <U43893@uicvm.uic.edu>
  5. Message-ID: <92322.204002U43893@uicvm.uic.edu>
  6. Newsgroups: comp.os.ms-windows.programmer.misc
  7. Subject: ???(Cust.Ctrls DLL using MFC)
  8. Lines: 41
  9.  
  10. Hello! I am writing a C++ large memory model DLL using MFC for custom
  11. controls. The problem I'm encountering looks very weird to me.
  12. Here is how the problem occurs:
  13. 1. In SDK dialog editor I double click my control. That invokes a callback
  14. function BOOL ClassStyle(bla-bla-bla) which I provide. This function does all
  15. necessary routines concerning the style dialog editing and then returns
  16. to the dialog editor TRUE (if CTLSTYLE structure is changed), or FALSE
  17. otherwise. So far, everything is perfectly fine.
  18. 2. Then dialog editor is trying to recreate the control (WM_NCCREATE, etc.)
  19. I catch WM_NCCREATE, create the object for the window control and do the proper
  20. subclassing. After subclassing messages go to the message map of the control
  21. object instance. Fine, so far. It can take several more messages. And then,
  22. all of a sudden, the CWnd object associated with the control
  23.  is some how lost. I can  tell that because the application ASSERTs
  24. at line 229 in window.cpp which is:  ASSERT(pWnd != NULL);
  25. The message it was trying to process during several times I codeviewed
  26. the execution was WM_GETMINMAXINFO. However, I am not sure that it is
  27. always the case.
  28.  
  29. Important things to add:
  30. 1. This problem once started to occur, then it went away. Recently I came
  31. back and then disappeared again. Now, it's there, as you can guess. Doesn't
  32. it sound mysterious? In fact, i has been adding stuff to my DLL during
  33. all that time. But, as far as I can understand things, I has not been
  34. touching any parts directly related to the problem.
  35. 2. Any normal application can create a dialog box with my control with
  36. no problem. Everything works just fine.
  37. 3. Moreover, it works with Windows Maker Professional Dialog Editor. Although,
  38. this editor does not send create messages to the control after its style is
  39. edited.
  40.  
  41. Maybe, there's something about filling the CTLSTYLE structure which the SDK
  42. dialog editor does not like!? But why then does it work from time to time?
  43.  
  44. I would really appreciate any opinion and suggestions.
  45. I'll be checking my e-mail for those.
  46. Please send me messages to: shatsky@parsys.eecs.uic.edu
  47.  
  48. Thanks a lot.
  49.  
  50. -- Vitaly Shatsky
  51.