问题标签 [fpc]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
design-patterns - Help me with a solution for what could be solutioned by virtual static fields... in FPC
I'm doing an event manager in Freepascal
Each event is an object type TEvent (=object), each kind of event must derive from this class.
Events are differentiated by an integer identificator, assigned dynamically.
The problem is that i want to retrieve the event id of an instance, and i can't do it well.
- All instances of a class(object) have a unique id => so it should be static field.
- All classes have a diferent id => so it should be virtual.
- Event ids are assignated in run time, and can change => so it can't be a simple method
In sum, I can't put all this together.
I'm looking for an elegant solution, i don't want to write a hardcoded table, actualizing it in every constructor... etc, i'd prefer something taking advantage of the polymorphism
Can anyone help me with another technical or design solution?
I remark I don't want to use class instead of object construct.(property doesn't work on objects? :(
windows-ce - 分配 PageControl fpc/Lazaurs 时出现 EBusError
我正在尝试为我的程序创建动态 TTabSheets。
用为 ARM/WinCE 构建的 FPC/Lazarus 编写
一切正常,包括设计时创建的标签表,但以下代码
就行Tab.PageControl := PageControl1; 引发异常EBusError、总线错误或未对齐的数据访问。
我读过这个,但我不确定它如何应用 http://wiki.freepascal.org/Windows_CE_Development_Notes#Alignment_problems
该代码适用于 win32
FPC 版本 2.2.4
resources - 关于 Lazarus 和/或 FPC 的活跃博客
我对“Emborcadero”的整个方向感到非常沮丧,我真的要投资 FPC/Lazarus。
转到Lazarus 文档页面,发现以下博客:
- Lazarus 开发- 最新
- 新手历险记- FPC Wiki 页面
- 与 Lazarus/Free Pascal 在路上- 最新
- 移植到 Lazarus - 最后发表于 2009 年 12 月
- 活着的拉撒路- 2009 年 9 月的最后一篇文章
- 平行帕斯卡世界- 最新
有人可以建议更多关于博客或 Twitter 帐户的资源吗?
delphi - 在主线程(Lazarus)的上下文中执行代码
我必须在主线程的上下文中执行一些代码。我正在使用 Lazarus + FPC。我从 DLL 中的线程(如果在 linux 上是共享库)中接收到一个事件,并且我的回调函数被调用。请注意,此函数不是任何类的成员,而是附加了“cdecl”指令的独立传统函数。
我必须为收到的每条此类消息触发一个对应的属性事件处理程序。这些事件必须在主线程的上下文中传递。我知道两种这样的解决方案:
- 留言
- Application.QueueAsyncCall
第一个没问题,但它需要一个窗口句柄。由于这是一个库代码,因此没有可用的句柄。AllocateHWND 不是一个选项,因为它不是跨平台的。我知道我可以创建一个虚拟表单,但这是一个非常糟糕的解决方案
第二个工作正常,但我有一个问题,例如,在我将鼠标移动到应用程序中之前,不会处理调用。也许我做错了什么我不知道。我就像我的电话只有在消息处理开始时才被处理。但这显然是一个漫长的等待。
所以我想知道这里最好的解决方案是什么(可能是 QueueAsyncCall)以及如何确保我的消息(调用)将在可接受的时间范围内得到处理?
lazarus - 如何选择性地将 Lazarus Apache 模块编译为 Apache 1.3、2.0 和 2.2?
我看过 /etc/fpc.cfg 并提到了一些定义:
- FCAPACHE_1_3
- FCAPACHE_2_0
然后在 fcl-web 示例中提到:
- 阿帕奇1_3
我发现的唯一一个在这两个文件的 apr.pas 上:
- /usr/share/fpcsrc/2.4.0/packages/httpd20/src/apr/apr.pas
- /usr/share/fpcsrc/2.4.0/packages/httpd22/src/apr/apr.pas
那么编译器是如何决定编译什么版本的 APR 的呢?
lazarus - 在 Lazarus 下编译 WebLaz 项目时出现问题
我的规格:
- 操作系统:Ubuntu 10.04 LTS amd64
- fpc:2.4.0
- 拉撒路:0.9.28
我试图通过创建一个然后编译来编译一个 WebLaz 项目。当确定要使用的 httpd 和 fpapache 单元时,编译器会不知何故丢失。
我在论坛中发现了类似的问题:
在尝试了那里提供的一些解决方案之后,我仍然在这一点上:
如果我在 Compiled 单元下只有 httpd22 和包的 Source,项目编译得很好。唉,然后它完全无法链接。
使用原始 fpc/lazarus 文件夹结构(在两个位置、单元和源上都未触及所有 HTTPD13、HTTPD20 和 HTTPD22),编译器抱怨 httpd 的校验和已更改并且无法找到 fpapache 的源。
- 它在 httpd20 下找到 httpd.pas 但它仅适用于 2.2 的文件夹
我完全不知道如何使用 WebLaz 组件来编译它,我错过了什么?
apache2 - 构建 mod_helloworld.lpr
我正在尝试构建 mod_helloworld.lpr 的 apache 示例,C:\lazarus\components\fpweb\demo\helloworld\apache
拉撒路 0.9.29
FPC 版本 2.4.3 SVN 27129
i386-win32
添加$(LazarusDir)\fpc\2.4.3\source\packages\fcl-web\src\
到其他单元文件(-Fu)后,它将编译,但是当我构建/链接时出现错误
我在猜测它试图添加 lcl 或其他东西,但我真的不知道。
lazarus - 如何在 Free Pascal .dll/.so 上避免 WSRegister*
我终于成功地编译了一个“空白”的 Apache 模块,但现在我遇到了一个相当烦人的障碍。
我想与 MongoDB 服务器通信,我选择了 FreePascal/Lazarus 的唯一库pebongo。
pebongo的依赖是突触。
在将我的模块加载到 Apache 时,不知何故我得到了“/usr/lib/apache2/modules/mod_visius.so: undefined symbol: WSRegisterCustomImageList”。
我认为我已经在 Menus.pp 上找到了这些符号,而 lazarusall(something) 也在其中发挥了作用。再一次,我认为:)
我应该如何避免出现那些 WSRegister* 符号?