Search found 405 matches

by Josep Roca
Jul 16, 2019 4:20
Forum: Windows
Topic: InputBox() in console program
Replies: 32
Views: 543

Re: InputBox() in console program

BTW, if you're using WinFBX, there is an AfxOpenFileDialog function in AfxWin.inc (you were asking for it in your "file requester" topic). It uses "|" instead of nulls for the filter to solve the problem of embeded nulls with null terminated strings. Documentation: https://github...
by Josep Roca
Jul 15, 2019 23:30
Forum: Windows
Topic: InputBox() in console program
Replies: 32
Views: 543

Re: InputBox() in console program

Like Windows, WinFBX is fully unicode. Unlike Windows, I don't have separate A and W functions, but take advantage of automatic conversions. AfxInputBox works with unicode, but you can use ansi strings with it. No need for two separate functions. It is also DPI aware and the captions of the buttons ...
by Josep Roca
Jul 15, 2019 21:51
Forum: Windows
Topic: InputBox() in console program
Replies: 32
Views: 543

Re: InputBox() in console program

> if you want fix the suspicious pointer warnings in AfxWin.inc, just change LPWSTR = RT_RCDATA to LPWSTR = Cptr(LPWSTR, RT_RCDATA) in functions AfxExtractResourceToFile and AfxExtractResource PWSTR = RT_RCDATA? You must be using an old version. Currently I'm using BYVAL pResourceType AS LPWSTR = MA...
by Josep Roca
Jul 12, 2019 21:04
Forum: Windows
Topic: file requester for console program
Replies: 30
Views: 382

Re: file requester for console program

> In the statusbar you should see 'ANSI'. Click on that and choose 'UTF-8 (BOM)'. Job done! <smile>

Only partially done. The filter will be cut at the first embedded null and only "Text Files" will be taken into account.
by Josep Roca
Jul 12, 2019 20:52
Forum: Windows
Topic: file requester for console program
Replies: 30
Views: 382

Re: file requester for console program

> but it fails when using Paul's WinFBE -- the filter does not work and the caption looks Chinese For the caption, you can solve it using ofn.lpstrTitle = @WSTR("Please Select A File To Open"), but ofn.lpstrFilter = @!"Text Files\0*.txt\0\0" or ofn.lpstrFilter = @WSTR(!"Text...
by Josep Roca
Jul 12, 2019 20:11
Forum: Windows
Topic: file requester for console program
Replies: 30
Views: 382

Re: file requester for console program

> Dim as Wstring*1024 filter=!"Text Files\0*.txt\0\0"

Using embedded nulls with a null terminated string won't work this way. You may need to fill the wstring buffer using memcpy or similar.
by Josep Roca
Jun 19, 2019 17:07
Forum: Community Discussion
Topic: fb 1.07 tests
Replies: 12
Views: 715

Re: fb 1.07 tests

I also think that -strip should be the default.
by Josep Roca
Jun 18, 2019 18:38
Forum: Community Discussion
Topic: Extending Wstring and Zstring with UDTs
Replies: 75
Views: 3726

Re: Extending Wstring and Zstring with UDTs

Excellent work. In my CWSTR class, I only have needed to change:

Code: Select all

#if __FB_VERSION__ < "1.07.0"
TYPE CWSTR
#else
TYPE CWSTR EXTENDS WSTRING
#endif
by Josep Roca
May 03, 2019 20:10
Forum: General
Topic: Constructor in dll
Replies: 18
Views: 597

Re: Constructor in dll

> Obviously, there is something inside InitializeCryptoBuffers which is problematic. You bet. Calling API functions that require DLLs other than Kernel32.dll may result in problems that are difficult to diagnose. It doesn't matter if you are using a FB constructor, DllMain or PowerBasic's LibMain: f...
by Josep Roca
Mar 09, 2019 0:16
Forum: General
Topic: (SOLVED) macro _WIN32_WINNT return wrong
Replies: 11
Views: 598

Re: macro _WIN32_WINNT return wrong

Which macro? _WIN32_WINNT is not a macro but a constant. Therefore, it will hold whatever value you assign to it.

If you don't define it, it will have a default value of &h0502.

Code: Select all

#ifndef _WIN32_WINNT
   const _WIN32_WINNT = &h0502
#endif
#ifndef WINVER
   const WINVER = _WIN32_WINNT
#endif
by Josep Roca
Feb 17, 2019 21:44
Forum: Windows
Topic: Dpi awareness functions not included?
Replies: 20
Views: 1233

Re: Dpi awareness functions not included?

> I tried the manifest settings from the microsoft sites. It simply didn't work. Try this one: <?xml version="1.0" encoding="UTF-8" standalone="yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:sche...
by Josep Roca
Feb 16, 2019 13:04
Forum: Beginners
Topic: Alias
Replies: 3
Views: 270

Re: Alias

Alias is for exported procedures. The alternate name cannot be used within the program to call the procedure.

You can use #define my_func my_func2
by Josep Roca
Feb 15, 2019 13:01
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 815

Re: FileDateTime() for Unicode

> WHY???

Because you're using CreateFile instead of CreateFileW.
by Josep Roca
Feb 14, 2019 14:57
Forum: Beginners
Topic: FileDateTime() for Unicode
Replies: 14
Views: 815

Re: FileDateTime() for Unicode

> How to remove the warning from 'close fh'?

Using the correct API function (CloseHandle) instead of Close.
by Josep Roca
Feb 12, 2019 1:53
Forum: Windows
Topic: Dpi awareness functions not included?
Replies: 20
Views: 1233

Re: Dpi awareness functions not included?

If your application is not DPI aware, you will always get a DPI of 96, no matter if you are using 125% or another value. Make your application DPI aware by using an appropriate manifest of by calling the SetProcessDPIAware function. Non DPI aware applications are virtualized by Windows when using a ...

Go to advanced search