PRB: Wjview.exe Causes Unhandled Exception on Handle Creation


If a class that extends the Window class is created with className LISTBOX
and overrides wndProc() and handles the WM_CREATE message, then Wjview.exe
causes an unhanded exception on handle creation.


The Window with className LISTBOX must pass the WM_CREATE message on to
defWndProc() in order for the class to be created correctly.


Steps to Reproduce Behavior

  1. Create a Java source

    import*;import*;public class WndTest extends Window{  protected void wndProc(Message m)   {      switch (m.msg)      {        case winw.WM_CREATE:                     break;         default :            defWndProc(m);             break;      }   }}
  2. Create a Java source
    import*;import*;import*;import*;import*;/*** This class can take a variable number of parameters on the command* line. Program execution begins with the main() method. The class* constructor is not invoked unless an object of type 'Form1' is* created in the main() method.*/ public class Form1 extends Form{   public Form1()   {      // Required for Visual J++ Form Designer support      initForm();      // TODO: Add any constructor code after initForm call   }/*** Form1 overrides dispose so it can clean up the* component list.*/    public void dispose()   {      super.dispose();      components.dispose();   }    private void button1_click(Object source, Event e)   {      CreateParams cp = new CreateParams();      cp.className = "LISTBOX"; = winw.WS_VISIBLE;      WndTest w = new WndTest();      w.createHandle(cp);   }/*** NOTE: The following code is required by the Visual J++ form* designer.  It can be modified using the form editor.  Do not* modify it using the code editor.*/ Container components = new Container();Button button1 = new Button();  private void initForm()  {     this.setText("Form1");     this.setAutoScaleBaseSize(new Point(5, 13));     this.setClientSize(new Point(292, 273));     button1.setLocation(new Point(112, 128));     button1.setSize(new Point(75, 23));     button1.setTabIndex(0);     button1.setText("button1");     button1.addOnClick(new EventHandler(this.button1_click));     this.setNewControls(new Control[] {button1});  }/*** The main entry point for the application.** @param args Array of parameters passed to the application* via the command line.*/   public static void main(String args[])  { Form1());  }}
  3. Compile the Java source files.
  4. Run Form1.
  5. Click the button on the form. This will create a WndTest class with
    className LISTBOX and style WS_VISIBLE. The WndTest class
    overrides wndProc such that WM_CREATE is not passed on to defWndProc
    and everything else is.
WJVIEW causes an unhandled exception.


For support information about Visual J++ and the SDK for Java, visit the following Microsoft Web site:

Id. de artículo: 195160 - Última revisión: 02/14/2017 - Revisión: 1

Microsoft Visual J++ 6.0 Edición estándar, Microsoft Software Development Kit for Java 3.1, Microsoft Software Development Kit for Java 3.2