cnpack / cnvcl Goto Github PK
View Code? Open in Web Editor NEWCnPack VCL Components
Home Page: http://www.cnpack.org
CnPack VCL Components
Home Page: http://www.cnpack.org
CnHashTable.pas . 列表..
function TCnBucket.CompareStrings(const S1, S2: string): Integer;
因为XE宽字符变更. LStr1 , LStr2 依赖的是长度. 这里转换不正确.
LStr1 := TCnNativeInt((S1));
LStr2 := TCnNativeInt((S2));
改为
LStr1 := TCnNativeInt(AnsiString(S1));
LStr2 := TCnNativeInt(AnsiString(S2));
不知道是否正确................
Please could you add Package for C++ Builder Tokyo 10.2
very very very thanks
Rado
Hi, I found memory leaks in CnTwain.pas.
In methods NativeTransfer, MemoryTransfer and FileTransfer, hbm_acq is not freed after use and causes fast growing memory leak.
I made changed in this places:
NativeTransfer:
... TWRC_XFERDONE: begin hbm_acq := hBitMap; twRC2 := lpDSM_Entry(@FappID, @FdsID, DG_CONTROL, DAT_PENDINGXFERS, MSG_ENDXFER, @twPendingXfer); if twRC2 <> TWRC_SUCCESS then DoTwMessage('DG_CONTROL/DAT_PENDINGXFERS/MSG_ENDXFER', False); if twPendingXfer.Count = 0 then if (hbm_acq <> 0) and (GlobalLock(hbm_acq) <> nil) then begin Terminate(True); GlobalUnlock(hbm_acq); end; if hbm_acq > VALID_HANDLE then begin DoXferDone(hbm_acq); GlobalFree(hbm_acq); end else DoXferDone(0); ...
MemoryTransfer:
... TWRC_XFERDONE: begin GlobalUnlock(hbm_acq); FlipBitMap(FHandle, hbm_acq, info.PixelType); twRC2 := lpDSM_Entry(@FappID, @FdsID, DG_CONTROL, DAT_PENDINGXFERS, MSG_ENDXFER, @twPendingXfer); if twRC2 <> TWRC_SUCCESS then DoTwMessage('DG_CONTROL / DAT_PENDINGXFERS / MSG_ENDXFER', False); if twPendingXfer.Count = 0 then Terminate(True); DoXferDone(hbm_acq); GlobalFree(hbm_acq); end; ...
FileTransfer:
... hbm_acq := GlobalAlloc(GHND, header.bfSize); if hbm_acq <> 0 then begin ptr := GlobalLock(hbm_acq); //for count:=(header.bfSize-sizeof(BITMAPFILEHEADER)) downto count; count-=num, ptr+=num) count := header.bfSize - sizeof(BITMAPFILEHEADER); while count > 0 do begin if count < num then num := count; _lread(hF, ptr, num); Dec(count, num); Inc(ptr, num); end; GlobalUnlock(hbm_acq); end; GlobalFree(hbm_acq); _lclose(hF); ...
项目里的介绍全改成中文描述,中文优先。。。
明明大家都是**人,**人开发的控件包,还要打上英文描述,这是组织上缺乏安全感还是没自信?
不要说我看不懂英文,这跟个人毛关系都没有。
不要说这是行业规范,毛规范,**的环境下规范范文也是中文。
别给人一看就觉得是外国佬的写的,这是**人写的,应该有这份自信,不要以为挂着一份英文说明书就觉得这东西好。
Windows Defender altert for:
cnvcl\Examples\Button\Project1.exe
Hi there,
Currently, TCnAAFadeText, TCnAAMarqueeText, TCnAAText support Transparent. Is it possible that we have Transparent property for TCnAAScrollText?
应该将 Sha256Dig1[K] := Sha256Dig1[K] xor T1[K]; 修改为 Sha256Dig1[K] := Sha256Dig1[K] xor T256[K];
大佬看一下呢、
I tried to install it for 10.2 but received an error saying that CnPack_D101B is required. I fixed it by changing CnPack_D101B to CnPack_D102T after it opened dclCnPack_D102T.bpl page.
Do I understand it correctly? 64-bits is not supported??
CnVcl needs msxml.dcu that it is not present in C++ Builder 6 Professional but only in the Enterprise version.
CnCommon.pas
function CnUtf8ToAnsi(const Text: AnsiString): AnsiString;
Need to be changed to
function CnUtf8ToAnsi(const Text: UTF8String): AnsiString;
In Delphi 10.3
CnCustBuild.dpr can not display the wizard name and the comments
希望sm等国密算法支持linux及arm和龙芯cpu
When ASLR is on in project (Delphi Alexandria 11.3) access violation occurs on rendering image on line
...
c := PSrcDot.rgbtBlue - dx;
...
More on ASLR:
https://en.wikipedia.org/wiki/Address_space_layout_randomization
Some further reading:
https://en.delphipraxis.net/topic/7968-how-does-the-address-space-randomization-aslr-actually-work/
It seams that some code is not properly sized (Integer -> Int64)? Hope that author will update and solve this small issue.
Hello,
Please note that the save action works only from the menu item but doesn't from the F2 shortcut.
How to reconfigure the F2 shortcut under a Classic IDE?
Best regards.
I'm having random AV when using the TCnAAFadeText component.
Here is the stack trace:
exception class : EOutOfResources
exception message : The parameter is incorrect.
main thread ($dc8c):
005ac0b7 +077 MService.exe Vcl.Graphics GDIError
005ac0f3 +007 MService.exe Vcl.Graphics GDICheck
005b161f +0a7 MService.exe Vcl.Graphics CopyBitmap
005b20cf +063 MService.exe Vcl.Graphics TBitmap.CopyImage
005b428b +04b MService.exe Vcl.Graphics TBitmap.SetSize
005b3acf +00b MService.exe Vcl.Graphics TBitmap.SetHeight
00d51d8c +0bc MService.exe CnAAFont 1356 +10 TCnAAMask.DrawMaskEx
00d523ab +033 MService.exe CnAAFont 1462 +1 TCnAAMask.DrawMask
00d54ef6 +116 MService.exe CnAAFont 2521 +31 TCnAAFontEx.TextOutput
00d5a18a +29e MService.exe CnAACtrls 2296 +40 TCnAAFadeText.DrawFadeBmp
00d5a5b0 +05c MService.exe CnAACtrls 2390 +7 TCnAAFadeText.PaintCanvas
00d58373 +06f MService.exe CnAAFont 3994 +14 TCnAAGraphicControl.Paint
00d5a79b +02b MService.exe CnAACtrls 2436 +4 TCnAAFadeText.SetFadeProgress
00d5a547 +0db MService.exe CnAACtrls 2378 +9 TCnAAFadeText.OnFadeTimer
0066057b +00f MService.exe Vcl.ExtCtrls TTimer.Timer
0066045b +02b MService.exe Vcl.ExtCtrls TTimer.WndProc
005490d0 +014 MService.exe System.Classes StdWndProc
1、cnrsa接口不是太方便签名(还有中文问题,base64),稍微有些不那么亲民^_^
2、签名后内内容在网上《在线RSA加密解密》类验签网站上无法验签,会提示异常,公钥请保留-------BEGIN PRIVATE KEY--------------及---------END PRIVATE KEY----------
java的key: byte[] keyBytes={17,34,79,88,-120,16,64,56,40,37,121,81,-53,-35,85,102}
加密模式:ECB
填充模式:PKCS7
请教怎么使用cnvcl的SM4模块加密呢
使用如下代码加密的结果与java不一致:
--CNVCL加密代码
const
TmpKeytmp: array[0..15] of Byte =
(17, 34, 79, 88, 255 - 120, 16, 64, 56, 40,
37, 121, 81, 255 - 53, 255 - 35, 85, 102);
procedure TFormCrypt.btnSm4Click(Sender: TObject)
function ArraytoTbytes(bs: array of byte): Tbytes;
begin
setlength(Result, Length(bs));
Move(bs[0], Result[0], Length(bs));
end;
var
Output: AnsiString;
Len: Integer;
TmpSm4Iv: array[0..15] of Byte;
IvStr: AnsiString;
s: ansistring;
m, n: string;
KeyBytes, ResBytes, DataBytes: TBytes;
begin
Len := Length(AnsiString(MMSm4.Text));
if Len < 16 then
Len := 16
else
Len := (((Len - 1) div 16) + 1) * 16;
SetLength(Output, Len);
ZeroMemory(@(Output[1]), Len);
KeyBytes := ArraytoTbytes(TmpKeytmp);//TEncoding.Default.GetBytes(MMKey.Text);
DataBytes := TEncoding.Default.GetBytes(MMSm4.Text);
BytesAddPKCS7Padding(DataBytes, SM4_BLOCKSIZE);
ResBytes := SM4EncryptEcbBytes(KeyBytes, DataBytes);
MMCode.Text := BytesToHex(ResBytes);
end;
以前也一直碰到这个问题。导入无法编译控件。
[dcc32 Fatal Error] CnPack_D110A.dpk(30): E2225 Never-build package 'vcl' must be recompiled
还是非常感谢开源项目,国人之光。
1.CnNative.pas asm 汇编报错,发现没加结尾分号,补上好了
2.CnLockFree.pas CnAtomicCompareExchange 函数体无法编译通过,我找到另外个函数替换编译过了
//Result := Pointer(InterlockedCompareExchange(LongInt(Target), LongInt(NewValue), LongInt(Comperand)));
Result := InterlockedCompareExchangePointer(Target, NewValue, Comperand);
3.CnZUC.pas ZUCEEA3函数体,CnZUC.pas(354,7) Error: Internal error 200306031 不知道如何修改
错误提示:在cnRSA单元里,ECN_OK,ECN_CUSTOM_ERROR_BASE 等均未定义。_CnSetLastError等函数也没有定义。请问该如何修改?谢谢
Do you plan to add support for the Win64 platform?
procedure foo();
begin
while True do
begin
var List := Faa(Licence,
function(Item: TData): TResult
begin
Result := crAdd;
end);
end;
end;
after
procedure foo();
begin
while True do
begin
var List := Faa(Licence,
function(Item: TData): TResult
begin
Result := crAdd;
end);
end;
end;
when you remove var
formatting is ok
估计是编译器的bug,但是可以通过调整部分代码避免该问题
我发现只要将
procedure Encry(InData, ASubKey: array of Byte; var OutData: array of Byte);
修改为
procedure Encry(const InData, ASubKey: array of Byte; var OutData: array of Byte);
这个问题就不会出现了
建议将类似的参数定义都加上 const 定义,毕竟 const 定义的话,该参数只会传指针,不会做内存拷贝,效率也会高一些
如题。这个缺少我很困惑,是否并没有测试过哦。
只要引用了 CnRandom 单元,什么操作都不用做,启动程序,然后直接退出就会触发异常,100%出现
随便新建一个 VCL 或者 Console 程序,目标平台选择 Windows 64-bit,然后uses CnRandom,然后运行程序,然后关闭程序,异常就触发了
cnFloat could conversion from 12.5 to C.8. Can it be converted to IEEE754's 41 48 00 00.
I think this function is used a lot.
thank you!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.