BBC BASIC for Windows
« Unrequired dialog response. »

Welcome Guest. Please Login or Register.
Apr 6th, 2018, 12:09am



ATTENTION MEMBERS: Conforums will be closing it doors and discontinuing its service on April 15, 2018.
Ad-Free has been deactivated. Outstanding Ad-Free credits will be reimbursed to respective payment methods.

If you require a dump of the post on your message board, please come to the support board and request it.


Thank you Conforums members.

BBC BASIC for Windows Resources
Online BBC BASIC for Windows documentation
BBC BASIC for Windows Beginners' Tutorial
BBC BASIC Home Page
BBC BASIC on Rosetta Code
BBC BASIC discussion group
BBC BASIC for Windows Programmers' Reference

« Previous Topic | Next Topic »
Pages: 1  Notify Send Topic Print
 thread  Author  Topic: Unrequired dialog response.  (Read 1120 times)
admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Unrequired dialog response.
« Reply #5 on: Jun 9th, 2013, 06:56am »

on Jun 8th, 2013, 9:08pm, Matt wrote:
Actually, it was more to do with the parameters wparam and lparam in general. For instance, it appears that the hiword of wparam in the case above, seems to give 1 and 2 for the single and double click. I don't know if this is just coincidence, or if this is actually the case. And, as stated before, I've no idea what lparam is. I'd like to know more, but preferably in layman's terms.

But the link to MSDN I gave you provides exactly this information!! It says this:

wParam
The LOWORD contains the identifier of the list box. The HIWORD specifies the notification code.
lParam
Handle to the list box.


Given that the Windows Constants utility (for example) tells you the numeric values of the notification codes, I don't understand what more information you could need, or why you think the information provided in MSDN (the reference source) is inadequate.

Richard.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Unrequired dialog response.
« Reply #6 on: Jun 9th, 2013, 4:03pm »

on Jun 9th, 2013, 06:56am, Richard Russell wrote:
Given that the Windows Constants utility (for example) tells you the numeric values of the notification codes...
I'm probably being unusually thick, but I don't understand what this means or how to relate it to my code.
Quote:
I don't understand what more information you could need, or why you think the information provided in MSDN (the reference source) is inadequate.
Because it doesn't tell me what the 1 or 2, etc. refer to.

Matt
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Unrequired dialog response.
« Reply #7 on: Jun 9th, 2013, 7:48pm »

on Jun 9th, 2013, 4:03pm, Matt wrote:
Because it doesn't tell me what the 1 or 2, etc. refer to.

We seem to be having some difficulty understanding each other. You surely know that in Windows (indeed, virtually universally)
constants are referred to by name, not by numeric value. You won't find numbers such as 1 and 2 in MSDN, instead you will find names such as LBN_SELCHANGE. Indeed, this use of names rather than numbers should extend to your own BASIC programs; in your ON SYS handler you would be expected to have code similar to the following:

Code:
      CASE notification_code% OF
        WHEN LBN_SELCHANGE: REM Do something here
      ENDCASE
 

If you run this code BB4W will of course report 'No such variable' for the LBN_SELCHANGE constant, because it doesn't know what its numeric value is. This is where the Windows Constants Utility comes in (see Frequently Asked Question #9). Whenever you write a program which accesses the Windows API, and therefore refers to constants by name, you need to run that utility in order to assign the appropriate numeric values. I would have expected you to be doing that already.

Virtually all programming languages which provide access to the Windows API support the use of named constants; really they have to because that's all MSDN refers to - the actual numeric values aren't of interest to the human programmer. In the case of C the pre-processor replaces the names with numbers, in the case of Liberty BASIC the names are known internally (you need to add an underscore prefix) and in the case of BB4W the Windows Constants utility does the job.

It's because this is so fundamental that it's answered on the BB4W Frequently Asked Questions page!

http://www.bbcbasic.co.uk/bbcwin/faq.html

Richard.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Unrequired dialog response.
« Reply #8 on: Jun 10th, 2013, 05:45am »

on Jun 9th, 2013, 7:48pm, Richard Russell wrote:
We seem to be having some difficulty understanding each other.
Richard. My appologies for not understanding you and not making myself clear. That's the trouble with being a novice.

Quote:
You surely know that in Windows (indeed, virtually universally) constants are referred to by name, not by numeric value. You won't find numbers such as 1 and 2 in MSDN, instead you will find names such as LBN_SELCHANGE.
Yes. This is something I've learned through experience.

Quote:
Indeed, this use of names rather than numbers should extend to your own BASIC programs;
By and large, it does.

However, there is a difference, here, with what you are saying and what I'm doing. If you want the program to recognise a notification, say LBN_SELCHANGE, then what you've said above is fine. If you find you're getting a result, say of 1, and you've no idea what it is or where it came from (slight exageration in this case), then, to someone whose still learning, this can sometimes be somewhat difficult to find out.

Having said that, your latest reply has managed to lead me to answer most of my queries. (Putting them in to practice might be a different matter. We'll see.)

Again, my appologies for my ignorance. It must be quite frustrating to be costantly answering questions that seem so basic. But at least I'm willing to try to learn.

Matt

p.s. Please have a look at my post on 'PE Hangs with Module Viewer'. I can't use the Module Viewer until I sort it.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Unrequired dialog response.
« Reply #9 on: Jun 10th, 2013, 1:30pm »

on Jun 10th, 2013, 05:45am, Matt wrote:
However, there is a difference, here, with what you are saying and what I'm doing. If you want the program to recognise a notification, say LBN_SELCHANGE, then what you've said above is fine. If you find you're getting a result, say of 1, and you've no idea what it is or where it came from (slight exageration in this case), then, to someone whose still learning, this can sometimes be somewhat difficult to find out.

There must be hundreds of Windows constants that have the value '1'. Even if you had a 'reverse' look-up listing all of those constants, it would still be difficult to identify which corresponds to the value you are receiving. It still seems to me that the only sensible approach is first to use MSDN to discover what notifications a List Box can provide and then (if necessary) find their numeric values using either the Windows Constants Utility or API Viewer.

It's trivial to write the following BASIC 'program' and then to run the Windows Constants utility to find the numeric values:

Code:
      PRINT LBN_DBLCLK
      PRINT LBN_KILLFOCUS
      PRINT LBN_SELCANCEL
      PRINT LBN_SELCHANGE
      PRINT LBN_SETFOCUS
 

Richard.
User IP Logged

admin
Administrator
ImageImageImageImageImage


member is offline

Avatar




PM


Posts: 1145
xx Re: Unrequired dialog response.
« Reply #10 on: Jun 10th, 2013, 2:49pm »

on Jun 10th, 2013, 05:45am, Matt wrote:
Please have a look at my post on 'PE Hangs with Module Viewer'.

I have no comment to make on that thread.

R.
User IP Logged

Malvern
Guest
xx Re: Unrequired dialog response.
« Reply #11 on: Jun 10th, 2013, 11:10pm »

Quote:
Even if you had a 'reverse' look-up listing all of those constants, it would still be difficult to identify which corresponds to the value you are receiving.


Such a program does exist!

Have you tried: WINCONSTlookup2_1.exe in the group files? It lets you search for constant numbers and against the type of constant. So if you are looking for anything to do with list box notifications use LBN_ and it will list all matches. If you put in a value as well only those matches will appear. It is much faster than searching MSDN. The list is not exhaustive and some Post Vista constants are not there, but most of WIN32 is included. The idea is Michael Hutton's and the constants data base is Richard's work.
User IP Logged

Matt
Developer

member is offline

Avatar




PM

Gender: Male
Posts: 210
xx Re: Unrequired dialog response.
« Reply #12 on: Jun 11th, 2013, 5:14pm »

on Jun 10th, 2013, 11:10pm, Malvern wrote:
Have you tried: WINCONSTlookup2_1.exe in the group files.

Thanks Malvern. Just installed it and it looks good. As does win32.hlp that , I think, Richard suggested.

Matt
User IP Logged

Pages: 1  Notify Send Topic Print
« Previous Topic | Next Topic »

| |

This forum powered for FREE by Conforums ©
Terms of Service | Privacy Policy | Conforums Support | Parental Controls