* * *

Recent Posts

Pages: [1] 2 3 ... 10
1
General / How to handle elevation requirement on linux? Synaser RS232
« Last post by cpicanco on Today at 10:38:52 pm »
Hi, I am using synaser to communicate with a serial port through RS232.

https://github.com/cpicanco/stimulus_control/blob/master/src/units/interface_rs232.pas

On linux it requires full privileges to do its stuff. So how you would solve this?? For debugging, for example, execute lazarus with sudo?? Any other option for asking for privileges during runtime somehow (any suggestions?)
2
General / Re: Wingraph - {$FATAL This unit must be compiled under Win32}
« Last post by dculp on Today at 10:33:24 pm »
If I set these to Win32 and x86_64 compilation gives error "Error: Illegal parameter: -Twin32".)

Ah - wingraph does not seem to work under 64-bit. Install a Lazarus-32-bit-version, or cross-compile to 32-bit

When I do \Help\About\Version from the Lazarus IDE, last line says "x86_64-win64-win32/win64". Also, my most recent download is fpc-3.0.0.i386-win32.exe. Are these the 32 bit versions that I need? If so, how do I get rid of the compiler errors? If not, what download versions do I need?
3
Android / Re: LAMW: jListView - HighLightSelectedItemColor
« Last post by jmpessoa on Today at 09:59:25 pm »
Quote
..Would I have to remove all existing components and reapply the new ones?

No! Please, try menu  "Clean up and Build" ....... then "[lamw] Build Android Apk and Run"
 
4
General / Re: HeapTrc - can expected leaks be ignored?
« Last post by Remy Lebeau on Today at 09:21:25 pm »
It is almost never an intended memory leak.
This wording referred to Remy's formulation "leaks that are intentional in code".

There are 3 intentional memory leaks in Indy.  A few global objects that are created during unit initialization but are not freed by default during unit finalization (though there is a compiler define provided to turn on that behavior, but it is not defined by default).  This is mainly due to issues related to bad unit finalization order in some situations, causing runtime errors trying to access objects that no longer exist, so they are leaked by default to prevent such errors.  In Delphi, Indy registers these leaks with the memory manager so they are not reported in leak reports.  It would be nice to do the same in FreePascal.
5
I do not know if Synapse can, but Indy cannot, at least not directly.

Indy uses OpenSSL primarily, and you can access the Windows certificate store yourself to export the desired certificate(s) and then manually import them into OpenSSL's certificate store.  Or IIRC, at some point in time there was a 3rd party effort to integrate the Windows certificate store directly in OpenSSL itself, so you might try looking around for that patch.

Or, you can write your own custom Indy SSLIOHandler class to use Microsoft's SChannel API instead of OpenSSL, then it would use Windows certificates transparently.
6
Windows / Re: MENUBARINFO record problems
« Last post by Remy Lebeau on Today at 09:05:19 pm »
For grins, I made my own MENUBARINFO record and used what Microsoft says it should be. ( https://msdn.microsoft.com/en-us/library/windows/desktop/ms647564%28v=vs.85%29.aspx )

The MSDN declaration is wrong, as is evident by looking at the real declaration of MENUBARINFO in winuser.h in the Win32 SDK:

Code: [Select]
/*
 * Menubar information
 */
typedef struct tagMENUBARINFO
{
    DWORD cbSize;
    RECT rcBar;          // rect of bar, popup, item
    HMENU hMenu;         // real menu handle of bar, popup
    HWND hwndMenu;       // hwnd of item submenu if one
    BOOL fBarFocused:1;  // bar, popup has the focus
    BOOL fFocused:1;     // item has the focus
} MENUBARINFO, *PMENUBARINFO, *LPMENUBARINFO;

The FreePascal declaration is correct.  The last 2 fields really are bitfields that occupy only 4 bytes total, not 8 bytes when using separate BOOL fields.

My record works. The one in struct.inc does not.

I can't reproduce this (in C++, I haven't tried in FreePascal).  In a 32-bit program, if cbSize is 36 (the size of your record, and MSDN's), GetMenuBarInfo() fails with error 87.  If cbSize is 32 (the size of FreePascal's record, and the SDK's record above), GetMenuBarInfo() succeeds.
7
Windows / Re: MENUBARINFO record problems
« Last post by marcov on Today at 08:53:34 pm »
Please file a bug in mantis ( https://bugs.freepascal.org )
8
CustomDrawn / Re: How do I use customdraw / compiler error
« Last post by Remy Lebeau on Today at 08:45:18 pm »
However, when compiling I get error

Quote
customdrawnobject_win.inc(590,78) Error: Incompatible type for arg no. 4: Got "<address of procedure(QWord;QWord;QWord;LongWord);StdCall>", expected "<procedure variable type of procedure(QWord;LongWord;QWord;LongWord);StdCall>"

at
TimerInfo^.TimerID := Windows.SetTimer(0, 0, Interval, @TimerCallBackProc);

which is line 590 in unit customdrawnobject_win.inc

It is pretty obvious what the error is.  TimerCallBackProc() is not declared correctly, its 2nd parameter is a QWord when a LongWord is expected instead.  This is the official callback declaration in the Win32 API:

Code: [Select]
VOID CALLBACK TimerProc(
  _In_ HWND     hwnd,
  _In_ UINT     uMsg,
  _In_ UINT_PTR idEvent,
  _In_ DWORD    dwTime
);

UINT and DWORD are always 32-bit in size, whether compiling for 32-bit or 64-bit systems.  On a 32-bit system, HWND and UINT_PTR are 32-bit in size.  On a 64-bit system, they are 64-bit in size.  Since the error message shows the 1st and 3rd parameters are QWord, the code is clearly being compiled for 64-bit.

Without actually seeing the declaration off TimerCallBackProc() in customdrawnobject_win.inc, my guess is that it is using UINT_PTR instead of UINT for the 2nd parameter.
9
General / Re: Draw on Canvas - cannot fathom the logic
« Last post by J-G on Today at 08:12:19 pm »
What I got in mind was something like this:
That may well be a fully OOP method using a secondary 'Form' but my VATPanel is just one of 10 Panels and it seems far more complex than my simple VATPanel.show or .hide method.

@ Handoko
I've now done a 'timing' test and can report that my largest file (300 records of 848 bytes) takes 37.5 milliseconds to first make the Backup File then recreate and write the new file.

10
Android / Re: LAMW: jListView - HighLightSelectedItemColor
« Last post by c4p on Today at 08:07:42 pm »
With the updated packages I can open and create a new project and compiles/runs fine but existing project crashes on startup on the phone.
Would I have to remove all existing components and reapply the new ones? works fine with existing packages.  Using latest svn.
Pages: [1] 2 3 ... 10

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus