News:

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

Main Menu

Recent posts

#81
Bug reports / Re: @InStr issue
Last post by Vortex - May 16, 2025, 03:30:05 PM
Hello,

The code adapted for Uasm can be assembled without issues. The purpose is to test if the statement @InStr(t+1,var,<test>) is a valid one.

.386
.model flat,stdcall
option casemap:none

sample MACRO var

LOCAL t,temp

t INSTR <var>,<macro>
temp TEXTEQU %(t)
% echo temp

temp TEXTEQU %(@InStr(t+1,<var>,<test>))

% echo temp

ENDM

.code

start:

   sample <This is a macro test.>

   xor  eax,eax
   ret

END start
#82
Beginner questions / Re: Can swprintf_s handle wide...
Last post by John Z - May 16, 2025, 03:21:07 PM
Hi CFred,

try this

swprintf_s(arguments, 1024, L"\"%ls\"", szPath);// lower case L

John Z
#83
Add-ins / Re: DeleteMode
Last post by John Z - May 16, 2025, 03:19:00 PM
Tested under Pelles C V13 RC3 works well no code changes.

John Z

Update - This is not needed anymore. Pelles v13 is working fine.
#84
Beginner questions / Can swprintf_s handle wide cha...
Last post by CFred - May 16, 2025, 03:17:26 PM
The following code does not do anything other than demonstrate an issue I experienced with swprintf_s():

#define _UNICODE
#define __STDC_WANT_LIB_EXT1__ 1
#include <stdio.h>
#include <tchar.h>

int main(void)
{
wchar_t szPath[1024];
wchar_t arguments[1024];
wcscpy(szPath, L"Testing");

swprintf_s(arguments, 1024, L"\"%s\"", szPath);

return 0;
}

This produces an error message:

warning #2234: Argument 4 to 'swprintf_s' does not match the format string; expected 'char *' but found 'wchar_t *'.

Does this mean that argument 4 cannot handle wchar_t strings or have I missed something?
#85
Add-ins / Re: Hint Add-IN
Last post by John Z - May 16, 2025, 01:08:39 PM
Posting source code for the Hint add-in for those interested.

I'm fairly sure it is not up to the standards of more experienced individuals.
However it is a starting point for those interested.

It builds under Pelle V12 as well as Pelle 13.


John Z
#86
Windows questions / Re: Simplifying code library
Last post by TimoVJL - May 16, 2025, 12:43:02 PM
If you want to share a your old project, some users in this site might help you with x64 things and update project files for x64.

This Add-In might help you too ?
AddIn Create/Open 32-bit project to 64 bit project
#87
Windows questions / Simplifying code library
Last post by alderman2 - May 16, 2025, 10:25:28 AM
I use my own library to make programming faster. For example, a program is created and opened like this:

ac_WindowCreate_1(hinstance,name,100,100,500,700,"My Windows");

I have 800 such functions and they have helped me enormously to quickly produce software.

The problem:
I can no longer sit around and update my library to work in 64bit. I'm getting old so I don't have enough time for this either.

Question:
Is there any library "out there" that does the same thing as my library and is updated when needed?
It is also important to me that it is easy to understand the different functions through the function name. It is an extra plus if there is also a good help file/manual.
#88
Feature requests / Re: Option to accept double co...
Last post by BFG10K - May 16, 2025, 09:02:47 AM
Quote from: Quin on April 28, 2025, 10:52:57 AMThe only use case I see for this in C is, for example, accessing a global variable with the same name as a local.
No, please don't misunderstand me, I'm not interested in language or compiler changes.

I just want the pre-processor to accept double colon so I can #define it to an underscore.

#define :: _

window_input_keyboard_process(); //Which namespace(s) is this?
window::input::keyboard_process(); //Now it's obvious, but compiler still sees underscores
#89
Bug reports / @InStr issue
Last post by Vortex - May 15, 2025, 11:25:37 PM
Hello,

Poasm Version 13.00.49 reports the following error messages while assembling the code below :

\PellesC\bin\poasm.exe /AIA32 Sample.asm
11
Sample.asm(12): error: Expected ','.
Sample.asm(12): error: Expected ','.
Sample.asm(12): error: Expected ')'.
01, <This is a macro test.>, <test>Sample.asm(12): fatal error: Invalid use of ')'.

.386
.model flat,stdcall
option casemap:none

sample MACRO var

LOCAL t

t INSTR var,<macro>
.echo t

.echo @InStr(t+1,var,<test>)

ENDM

.code

start:

   sample <This is a macro test.>

   xor  eax,eax
   ret

END start
#90
Add-ins / Re: Named Bookmarks
Last post by John Z - May 14, 2025, 02:11:10 PM
Tested under Pelle's C V13 RC3 no changes needed.  Works as before,
but here is updated dll which just up sizes the icon.  No code changes.

John Z