News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Recent posts

#1
Bug reports / Structure initialization issue
Last post by Vortex - Today at 01:37:29 PM
Hello,

Trying to initialize some structures ( GUIDs ), I receive the following error message :

WallPaper.asm(12): fatal error: Invalid use of '{'.
sCLSID_IActiveDesktop      TEXTEQU <{075048700h,0EF1Fh,011D0h,{098h,088h,00h,060h,097h,0DEh,0ACh,0F9h}}>
sIID_IActiveDesktop        TEXTEQU <{0F490EB00h,01240h,011D1h,{098h,088h,00h,060h,097h,0DEh,0ACh,0F9h}}>

GUID    STRUCT
    Data1    dd ?
    Data2    dw ?
    Data3    dw ?
    Data4    db 8 dup(?)
GUID ENDS

The lines reporting the problem :

.data

CLSID_IActiveDesktop    GUID sCLSID_IActiveDesktop
IID_IActiveDesktop      GUID sIID_IActiveDesktop

Tested with Poasm Version 13.00.47

Poasm Version 12.00.1 can assemble the code without any error messages.
#2
Announcements / Re: Release Candidate for vers...
Last post by John Z - Today at 01:29:10 AM
To add a bit more this is still using WIN 11 23H2 not the troublesome WIN 11 24H2. Version 12 on both OSs opened the project and the IDE starts as it was when closed.

Also all source files are in the Source file window and are accessed without any issue.

John Z
#3
Bug reports / Re: Macro reporting fatal erro...
Last post by Vortex - Yesterday at 09:35:15 PM
Hi Pelle,

Many thanks, Poasm version 13.00.47 solved the issue.
#4
Announcements / Re: Release Candidate for vers...
Last post by TimoVJL - Yesterday at 08:44:09 PM
if *.ppx file have a locking problem, what happens ?

EDIT: delete .ppx and close project, after that are files listed in that xml-file normally ?

An example for test code:
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#include <stdio.h>

int __cdecl main(void)
{
HANDLE hDir;
DWORD dwRC;
PFILE_NOTIFY_INFORMATION pfni;
WCHAR fni[(sizeof(FILE_NOTIFY_INFORMATION)+1024)*1];
hDir = CreateFile(".\\", FILE_LIST_DIRECTORY,
FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
NULL, OPEN_EXISTING,
FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (hDir != INVALID_HANDLE_VALUE) {
printf("start watch\n");
if (ReadDirectoryChangesW(hDir, &fni, sizeof(fni), FALSE,
FILE_NOTIFY_CHANGE_FILE_NAME | FILE_NOTIFY_CHANGE_LAST_WRITE,
&dwRC, NULL, NULL))
{
pfni = (PFILE_NOTIFY_INFORMATION)&fni;
printf("%p [%ls]\n", (void*)pfni->NextEntryOffset, pfni->FileName);
//printf("%p [%*ls]\n", (void*)pfni->NextEntryOffset, pfni->FileNameLength, pfni->FileName);
}
CloseHandle(hDir);
}
return 0;
}
#5
Announcements / Re: Release Candidate for vers...
Last post by Pelle - Yesterday at 07:50:13 PM
Quote from: John Z on Yesterday at 04:11:48 PMHave I missed checking an option or is this intentional behavior, or heaven forbid a bug?
Looks like a bug, but I can't find any significant changes in this area since early 2020...
#6
Bug reports / Re: pocc v13 warning message
Last post by Marco - Yesterday at 06:01:01 PM
Quote from: Pelle on Yesterday at 03:59:49 PMThis could be worked around by replacing the macro with an inline function

Yes, this is the same solution I used.

Quote from: Pelle on Yesterday at 03:59:49 PMI prefer to keep the Windows SDK as original as possible.

I agree, it is the most sensible choice.

Thanks Pelle.

Marco
#7
Announcements / Re: Release Candidate for vers...
Last post by John Z - Yesterday at 04:11:48 PM
In version 12 I use the load last project option.  So when the IDE starts it loads the last project and all source files that were showing in the IDE Editor as a tab are showing just as they were when it was closed.

In version 13 the load last project option is checked and the last project is loaded. However the source files that were open in the Editor when the IDE was last closed are not being opened and showing in the IDE editor as they were when closed.

Have I missed checking an option or is this intentional behavior, or heaven forbid a bug?

John Z
#8
Bug reports / Re: pocc v13 warning message
Last post by Pelle - Yesterday at 03:59:49 PM
This is a known problem with no (good) solution.

The warning comes from how the macro is written by Microsoft:
#define ListView_GetSubItemRect(hwnd, iItem, iSubItem, code, prc) \
  (BOOL)SNDMSG((hwnd), LVM_GETSUBITEMRECT, (WPARAM)(int)(iItem), \
    ((prc) ? ((((LPRECT)(prc))->top = (iSubItem)), (((LPRECT)(prc))->left = (code)), (LPARAM)(prc)) : (LPARAM)(LPRECT)NULL))

The condition ((prc) ? ... : ..) is in your case ((&rc) ? ... : ...) /* i.e. ((&rc != NULL) ? ... : ...) */ which will always be true.

There is no way to suppress a warning from a statement in a macro. To permanently disable this warning when including <windows.h> or <commctrl.h> seems unhelpful.

This could be worked around by replacing the macro with an inline function, where the warning can be suppressed, but I prefer to keep the Windows SDK as original as possible.

#9
Assembly discussions / Re: Latest POASM for testing.....
Last post by Vortex - Yesterday at 02:24:06 PM
Hi Timo,

You need to modify one line in the Speech API sample ( 64-bit ) :

This one :

entry_point PROC PARMAREA=5*QWORD
to this :

entry_point PROC PARMAREA=5* SIZEOF QWORD
Pelle's explanation :

https://forum.pellesc.de/index.php?msg=40863

#10
Bug reports / pocc v13 warning message
Last post by Marco - Yesterday at 12:31:35 PM
Hi Pelle,

when I use the 'ListView_GetSubItemRect' macro, POCC displays the following warning message:

warning #2130: Result of comparison is constant.

To reproduce the issue, please use the test files attached to this message.

The project was downloaded from the following link:
https://www.smorgasbordet.com/pellesc/zip/vlistvw.zip

I only added the following 4 instructions to the 'VListVw.c' file (everything else has been left untouched):

#pragma comment(lib, "user32.lib")          // <-- Added
#pragma comment(lib, "comctl32.lib")        // <-- Added

...

BOOL InitListView(HWND hwndListView)
{

  ...

  RECT rc;                                                            // <-- Added
  ListView_GetSubItemRect(hwndListView, 0, 1, LVIR_LABEL, &rc);       // <-- Added - generate the warning message

}

Simply double-click the 'build.bat' file to compile the application. The batch file assumes that PellesC is installed in the default folder ('C:\Program Files\PellesC'). If not, please edit the batch file and change the value assigned to the 'PCPATH' environment variable, for example:

set PCPATH=c:\PellesC

When building, the compiler should give some other warnings that can be ignored for the sake of this example.

Marco