IonicWind Software

IWBasic => General Questions => Topic started by: ZeroDog on January 28, 2013, 05:52:42 PM

Title: Compiling in win7?
Post by: ZeroDog on January 28, 2013, 05:52:42 PM
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.
Title: Re: Compiling in win7?
Post by: billhsln on January 28, 2013, 05:56:22 PM
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
Title: Re: Compiling in win7?
Post by: LarryMc on January 28, 2013, 07:48:28 PM
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.
Title: Re: Compiling in win7?
Post by: ZeroDog on January 28, 2013, 07:57:39 PM
*facepalm*

Thanks.  Guess I was just having one of those moments..  ::)
Title: Re: Compiling in win7?
Post by: LarryMc on January 28, 2013, 08:46:01 PM
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............