Hi,
I could not find any postings to this problem.  I have now created two small programs in HLA that make use of Windows MDI but both share the same unusual behaviour.  The following code works fine, and is taken from my frame window's WndProc:

-------------------------------------------------------
if( uMsg = w.WM_CREATE ) then

  //setup the MDI client create record
  w.GetMenu( hWnd );                      //get the menu that will be modified
  mov( eax, hMainMenu );
  w.GetSubMenu( hMainMenu, 1 );
  mov( eax, ccs.hWindowMenu ); //create the MDI Client Window
  mov( CHILDSTARTID, ccs.idFirstChild );
  w.CreateWindowEx( NULL, MDIClientName, NULL,
w.WS_CHILD | w.WS_VISIBLE | w.WS_CLIPCHILDREN,
w.CW_USEDEFAULT, w.CW_USEDEFAULT, w.CW_USEDEFAULT, w.CW_USEDEFAULT,
hWnd, NULL, hInstance, &ccs );
  mov( eax, hMDIClient );

//init the MDI create struct
  mov( MDIChildClass, mdics.szClass );
  mov( childTitles, mdics.szTitle );
  mov( hInstance, mdics.hOwner );
  mov( w.CW_USEDEFAULT, mdics.x ); 
  mov( w.CW_USEDEFAULT, mdics.y );
  mov( w.CW_USEDEFAULT, mdics.lx );
  mov( w.CW_USEDEFAULT, mdics.ly );
............
elseif.........
---------------------------------------------------

This works fine, but if I place the MDI related code shown above into it's own procedure to organize the code better ( EXACTLY same code; the records and variables here are static and defined globally), windows fails to create a MDI Child window with SendMessage-WM_MDICREATE.  Is there something I'm missing about HLA procedures? This does not happen in MASM.
Posted on 2007-02-10 19:56:11 by new2hla
I assume that when you move the code into a proc your hWnd is undefined. Can you check if your call to CreateWindowEx > MdiClient comes back 0 after you move it?
Posted on 2007-02-11 06:36:32 by JimmyClif
does HLA convert erros returned by windows to exceptions in procs like "w.CreateWindowEx()"? If no, you should check them.
Posted on 2007-02-11 10:58:58 by vid
Thank you for your responses.  I took a different approach though and being an amateur programmer myself, I assumed I may have a misunderstanding of some more simple concepts.  So ( lol...),  I've learned that each module gets its own personal copies of static variables declared in hhf files (Ollydbg was quick to point that out, as DS: was consistently different for the same static variable I used in separate modules).  I'm not sure how I've been getting away with that.
   
    My final question is: How can I declare a global variable that can be shared by all modules that may need it (like hInstance) or is that poor programming practice?
Posted on 2007-02-12 15:55:52 by new2hla
How can I declare a global variable that can be shared by all modules that may need it (like hInstance) or is that poor programming practice?

It may or may not be poor concept. For hInstance it's a good idea.

I would say, for beginning it's okay to use global variables. Later when you will start doing big projects, you will yourself see the mess and start using more local variables. And you will really know why they are considered "bad", not just because you read it somewhere.
Posted on 2007-02-12 17:55:43 by vid