Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Mayrel

Win32: Subclassing EDIT

This topic is 6112 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hullo. I''m having some kind of problem subclassing EDIT. I''m using a class (EditBox, in this case) that does a CreateWindow using the "EDIT" window class. For reasons that I cannot figure out, the program crashes (with a GPF) when I create an instance of this class. For some reason, I''m not given the option of debugging, so I can''t find out where it''s going wrong. I''ve tried replacing the window class with "COMBOBOX", "SCROLLBAR", STATIC", and "BUTTON", and it works just fine with those (but, of course, I don''t want any of those controls for my EditBox). So, has anyone seen this before? And, more importantly, does anyone know what''s going wrong? All your bases belong to us (I know. It''s irony.)

Share this post


Link to post
Share on other sites
Advertisement
Why do you not have the option of debugging?

Check all return values. It''s probably something simple

Share this post


Link to post
Share on other sites
I don''t have the option of debugging because unstead of jumping into the debugger like it normally does when there''s an error, the program just ends.

I''ve checked return values. However, I can''t actually figure out where the problem occurs: I can display diagnostic messages and see how far through the problem I get, but depending the point at which the program crashes out is dependent upon where I put the messages.

All your bases belong to us (I know. It''s irony.)

Share this post


Link to post
Share on other sites
Put a breakpoint and trace through your program, that way, you''ll be in the debugger.

Share this post


Link to post
Share on other sites
Can you post the piece of code that is giving you problems? If you don''t know, just post the line where you are creating the edit control.

Share this post


Link to post
Share on other sites
I don't have it with me right now, but I can bring it in.

The only problem is that I've no idea where the problem really is. My CreateWindowEx() call is just a normal call to CreateWindowEx() with nothing magical going on. Something like:

      
m_hWnd = CreateWindowEx(exStyle, "EDIT", text, style, x, y, cx, cy, m_hWndParent,
NULL, g_hInstance, NULL);


The odd thing is that it works fine with my own window class or any of the other standard classes I've tested it with (BUTTON, SCOLLBAR, COMBOBOX and STATIC, so far).




As an aside, do the standard controls - tabstrips or group boxes, say - have window classes associated with them, or am I obliged to use MFC (which I don't really want to do)?

All your bases belong to us (I know. It's irony.)

Edited by - Mayrel on November 22, 2001 9:01:22 AM

Edit: Forgot a parameter.

Edited by - Mayrel on November 22, 2001 9:02:22 AM

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!