May 17, 2024, 02:23:00 PM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Compiling in win7?

Started by ZeroDog, January 28, 2013, 05:52:42 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

ZeroDog

Recently I upgraded to Windows 7 from Windows XP, and have been busy converting header files to take advantage of the new interfaces and updates in Win7.

However, I cannot seem to compile windows applications anymore.

Here is the source of the program I am attempting to compile:

def run as int
def win as window
openwindow win, 0,0,400,300, @CAPTION, 0, "WDM Sample", &winproc

run=1
waituntil run=0
end

sub winproc(),int
select @class
case @idclosewindow
run = 0
endselect
return 1
endsub


The compiled result is attached to the post.


So what am I doing wrong?  I've tried using different compatabily modes, but nothing I seem to try works.

billhsln

January 28, 2013, 05:56:22 PM #1 Last Edit: January 28, 2013, 05:58:35 PM by billhsln
I am not sure this is the answer, but I always RETURN 0 from all handlers.

Also, I use:

SELECT @MESSAGE
   CASE @IDCREATE
      CENTERWINDOW main
   CASE @IDCLOSEWINDOW
   CASE& @IDDESTROY
      CLOSEWINDOW main


Bill
When all else fails, get a bigger hammer.

LarryMc

It's the RETURN 1 that is the problem.

When you return a non-zero from the message handler you are basically telling the default internal message handler to ignore the message.

It always needs to be 0 where you have placed it.
There are time when you want to return 1 for specific messages to keep things from happening.

FYI @message and @class are the same thing.
that's mentioned in the help file and I also covered it in my custom control  tutorial.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

ZeroDog

*facepalm*

Thanks.  Guess I was just having one of those moments..  ::)

LarryMc

Quote from: ZeroDog on January 28, 2013, 07:57:39 PM
*facepalm*

Thanks.  Guess I was just having one of those moments..  ::)

I have them day after day after day............
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library