前言:
四年前在delphi ktop有人提到看盤軟體配合DDE技術,在用delphi實作時發生了亂碼加在後面的情形。http://delphi.ktop.com.tw/board.php?cid=30&fid=71&tid=97629
aftcast 發表在 痞客邦 留言(0) 人氣(908)
Ⓞ著者: 蕭沖
症狀: 下中斷點後無論如何也進不了,且畫面出不來。但若改成非ide下,直接執行編好的exe檔就很正常!
解決方式: 僅需要把一些form改成sizeable,並縮至相較的小後,即可下中斷並切入debug。
aftcast 發表在 痞客邦 留言(0) 人氣(228)
⓪編著: 蕭沖
TServerSocket 與 TClientSocket 都算是一個包裝(Wrapper)物件的容器(container),也就是說它本身只是把Socket物件含入裡面,並透過介面來操作含在裡面的Socket物件。
真正有"作用"的Soket物件是TCustomWinSocket這個類別,注意裡面有「Win」這個字,若沒這個字,那就僅用Container,如上面講的TClientSocket。因此,在隨作各種事件與方法時,都是在處理TCustomWinSocket的子類別,如TServerWinSocket ,TServerClientWinSocket等。
aftcast 發表在 痞客邦 留言(0) 人氣(1,105)
著作: 蕭沖
自從有dll這種動態連接庫後,lib檔就不再僅代表是過去dos時代的static lib 了。
給 dll 用的lib,特稱為 import lib,有別於 static lib。import lib 裡記錄的是關於會使用到哪些函式,但其實裡面沒有實作函式的機器碼。 相反的,static lib 是含有程式碼於其中,所以通常檔案也比較大。
aftcast 發表在 痞客邦 留言(0) 人氣(1,388)
⓪編著: 蕭沖
一般的管理程式,如:sqlitebrowser,它所建立的都是基於 utf8 而生成的 db。
在中文的環境下,若使用windows作業系統,個人覺得用unicode(UTF-16)版會比較方便,因為無需轉換utf8格式。
aftcast 發表在 痞客邦 留言(0) 人氣(1,458)
⓪著作: 蕭沖
近來發現BCB6的TClientSocket關於OnRead的事件有些問題:若在事件裡沒有處理到ReceiveBuf這個方法,則下一回的event就不會被觸發。所以,在OnRead的事件裡,無論如何先收資料下來再說! 千萬別一開始就在ReceiveBuf前return或是把ReceiveBuf放在某個if裡。(為何可能會錯誤的那麼做? 因為常常都是想檢查ReceiveLength,若不符合我們要的結構長度,則…)
若不收下來,那所有的封包依舊保留在socket的資料緩衝,於是爆了,接著就當了!!
aftcast 發表在 痞客邦 留言(0) 人氣(654)
⓪編著: 蕭沖
經過數回合的安裝測式後發現,最好的組合有二種:
1/ BcB6(經過update4) + DsPack231 + DirectX 9.0c 第一版(sum2004) + dxsdk_oct2004_extras (修正vc6用的lib)
2/ BcB6(經過update4) + DsPack234 + DirectX 9.0c dec2004
aftcast 發表在 痞客邦 留言(4) 人氣(2,878)
⓪編著 :蕭沖
寫這篇文章的靈感來源是來自李維在多年前的一篇注名文章:
http://www2.borland.com.tw/tw/reference9.html (2013年補:此文已不見了,有需要的可以向我要備份)
裡面提到如何使用package切割子系統方便開發與管理,並可增進效能。曾經看網友問到要如何把裡面的範例轉換成對應bcb的語法?因為裡面用到許多delphi才特有的一些功能,在c++裡原本沒有那些功能,比如說delphi的unit裡有initialization段、finalization段。再者delphi可以直接使用TComponentClass(VMT(Virtual Method Table)的實作)這個特別的類別來create instance。以下是我測試出對應到delphi的實作方式,希望以bcb開發的用戶也可以使用bpl開發出較大型的模組化程式。
★c++ builder裡的實作方式:
aftcast 發表在 痞客邦 留言(0) 人氣(2,625)
New switches for the Pascal DCC32.EXE compiler:
[lb] -jp switch: creates Borland C++ compatible .OBJ files.
[lb] -jph switch: creates C++Builder compatible header (.HPP) files from Object Pascal unit files (.DCL).
[lb] -jphn switch: uses the Object Pascal unit name as the enclosing C++ namespace for both .OBJs and .HPPs that are generated.
[lb] -n switch: specify .DCU output directory
[lb] -nh switch: specify .HPP output directory
[lb] -no switch: specify .OBJ output directory
Example from Indy batch file: Fullc6.bat
@echo off
if (%1)==() goto test_command
if (%1)==(start) goto start
goto endok
:test_command
if (%COMSPEC%)==() goto no_command
%COMSPEC% /E:9216 /C %0 start %1 %2 %3
goto endok
:no_command
echo No Command Interpreter found
goto endok
:start
call clean.bat
computil SetupC6
if exist setenv.bat call setenv.bat
if not exist ..\C6\*.* md ..\C6 >nul
if exist ..\C6\*.* call clean.bat ..\C6if (%NDC6%)==() goto enderror
if (%NDWINSYS%)==() goto enderror
copy *.pas ..\C6
copy *.dpk ..\C6
copy *.obj ..\C6
copy *.inc ..\C6
copy *.res ..\C6
copy *.dcr ..\C6
copy *.rsp ..\C6
if (%NDC6%)==() goto enderror
if (%NDWINSYS%)==() goto enderror
cd ..\C6
REM ***************************************************
REM Compile Runtime Package Indy60
REM ***************************************************
REM IdCompressionIntercept can never be built as part of a package. It has to be compileed separately
REM due to a DCC32 bug.
%NDC6%\bin\dcc32.exe IdCompressionIntercept.pas /O..\Source\objs /DBCB /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y- %2 %3 %4
%NDC6%\bin\dcc32.exe Indy60.dpk /O..\Source\objs /DBCB /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y- %2 %3 %4
if errorlevel 1 goto enderror
%NDC6%\bin\dcc32.exe IdDummyUnit.pas /LIndy60.dcp /DBCB /O..\Source\objs /M /H /W /JPHN -$d-l-n+p+r-s-t-w-y- %2 %3 %4
if errorlevel 1 goto enderror
del IdDummyUnit.dcu >nul
del IdDummyUnit.hpp >nul
del IdDummyUnit.obj >nul
%NDC6%\bin\dcc32.exe Indy60.dpk /M /DBCB /O..\Source\objs /H /W -$d-l-n+p+r-s-t-w-y- %2 %3 %4
if errorlevel 1 goto enderror
copy Indy60.bpl %NDWINSYS% >nul
del Indy60.bpl > nul
REM ***************************************************
REM Create .LIB file
REM ***************************************************
echo Creating Indy60.LIB file, please wait...
%NDC6%\bin\tlib.exe Indy60.lib /P32 @IndyWin32.rsp >nul
if exist ..\C6\Indy60.bak del ..\C6\Indy60.bak >nul
REM ***************************************************
REM Compile Design-time Package RPDT30
REM ***************************************************
%NDC6%\bin\dcc32.exe dclIndy60.dpk /DBCB /O..\Source\objs /H /W /N..\C6 /LIndy60.dcp -$d-l-n+p+r-s-t-w-y- %2 %3 %4
if errorlevel 1 goto enderror
REM ***************************************************
REM Clean-up
REM ***************************************************
del dclIndy60.dcu >nul
del dclIndy60.dcp >nul
del Indy60.dcu >nul
del *.pas > nul
del *.dpk > nul
del *.inc > nul
del *.dcr > nul
del *.rsp > nul
REM ***************************************************
REM Design-time only unit .DCU's are not needed.
REM ***************************************************
if exist IdAbout.dcu del IdAbout.dcu >nul
if exist IdDsnBaseCmpEdt.dcu del IdDsnBaseCmpEdt.dcu >nul
if exist IdDsnPropEdBinding.dcu del IdDsnPropEdBinding.dcu >nul
if exist IdDsnRegister.dcu del IdDsnRegister.dcu >nul
if exist IdRegister.dcu del IdRegister.dcu >nul
goto endok
:enderror
call clean
echo Error!
:endok
cd ..\Source
ref: http://homepages.borland.com/ccalvert/Books/BcbUnleashed/Part14.htm
aftcast 發表在 痞客邦 留言(0) 人氣(604)
⓪編著 :蕭沖
首先,請參照下面重要的export function name的規則。
__________________________________________________________________
呼 叫 慣 例 原 始 函 式 Borland C++Builder Microsoft Visual C++
__cdecl MyFunc_cdcel _MyFunc_cdcel MyFunc_cdcel
__stdcall MyFunc_std MyFunc_std _MyFunc_std@8
__fastcall MyFunc_fast @MyFunc_fast @MyFunc_fast@8
-----------------------------------------------------------------------
aftcast 發表在 痞客邦 留言(1) 人氣(11,997)