You are not logged in. You can browse in the PowerBASIC Community, but you must click Login (top right) before you can post. If this is your first visit, check out the FAQ or Sign Up.
I've already discussed the #OPTION VERSION5 behavior with R&D and it is going to be addressed so that apps marked with #OPTION VERSION5 will only be able to run on API level 5 platforms (ie, Windows 2000 or better).
If you don't use an identifier with these constants, the compiler will select the smallest integer type that will contain the number. When there is no type identifier, PowerBASIC stores the value as unsigned unless the most significant bit is a sign bit and the leading digit is not a zero. For example, &H8000 is signed, because its most significant bit is a sign bit (1000 0000 0000 0000) and its leading digit is non-zero. On the other hand, &H08000 is unsigned; although its most significant bit is a sign-bit (1000 0000 0000 0000), its leading digit is a zero.
Sure, Semen you are a solid rock...
Just read the book, is a good advice in all situations.
-------
I was fooled by the fact that #Option Version4,#Option Version5
produced exactly the same code, and MSDN description of WM_APP requiring the executeble to be marked Version 4.
This and the fact that redefining %WM_APP to &H7FF0 worked.
------
But still #Option5 is not doing what it claims to be doing.
And I am targeting WIN2000 with my new release so it would be
nice if it worked, and fixed in next release.
------
My apologies to you Lance and PB for me constant joking about the
three no-no's
Fred --
1) I can't agree with your information about %WM_APP.
This code works fine on my PC, at least, under Win95b & Win2000.
Code:
#Compile Exe
#Dim All
#Register None
#Include "win32api.inc"
%WM_APP = &H8000&
CallBack Function DlgProc
Select Case CbMsg
Case %WM_APP: MsgBox "ok"
End Select
End Function
Function PbMain
Local hDlg As Long
Dialog New %HWND_DESKTOP, "", , , 400, 200, %WS_CAPTION Or %WS_SYSMENU Or %WS_THICKFRAME To hDlg
PostMessage hDlg, %WM_APP, 0, 0
Dialog Show Modal hDlg Call DlgProc
End Function
Probably, you declared %WM_APP = &H8000 instead of %WM_APP = &H8000&.
2) For me a fact, that Option Version doesn't work is positive.
If necessary, I am able to add some statements and analyze results of GetVersionEx by myself.
Lance, I suppose you did not see in the subject.
But to answer your question:
Use #OPTION VERSION4 (default) to compile and make the output file require the target system be running Windows 95/98 or NT 4.
Use #OPTION VERSION5 to compile and make the output file require the target system be running Windows 2000 or NT 5.
This options does not work.
Application compiled using #Option Version5 will still run in WIN95/98, and the resulting exe is equal
byte by byte if using Option4 or Option5.
This subject have been tuched in other threads, but has not been
commented on from PB Support. (No direct question)
In a upcoming new release of my system I have obeyed the new
Micro$oft rules of private messages (%WM_APP) and that breakes my application.
The application does not work on WIN/NT4 and WIN2000.
And the reason is that messages in the range &H8000 - &HBFFFF is
filtered and never reaches the WndProc callback.
And this happens because PowerBasic compiler does not mark the EXE as a "Version 4" executable.
---
This is how I got it down to a bug in PBDLL
---
I am not really interested in bug/no-bug. My interest lies in the
fact that I want to be able to use %WM_APP messages and in some cases prevent
the application to be started on OS less than WIN2000
---
If someone knows how to patch the Exe to tell Windows that it is a "Version 4" executable,
and willing to share their knowledge, you will find a very greatful oxenby on the streets of London..
This may be completely off the mark for what you want to achieve, but if you know the thread ID where you want the message to go, have you tried using PostThreadMessage() ?
I'm not sure how you manage to put this down to a bug in PB/DLL, Fred...
MSDN talks that messages WM_APP through 0xBFFF are available for use by applications in all OSes, begining from NT 3.51.
Can you give small sample, which not works under NT ?
To use %WM_APP message range of application-messages
the exe has to be marked Version 4.
#Option Version4
#Option Version5
does not satisfy M$ and therefore this messages are ignored
in WIN/NT4 and WIN2000
It does however work when run under WIN/98SE
Is there a workaround ...?
Please
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, and to analyze site activity. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.
Leave a comment: