Tuesday, June 23, 2015

Read and write shapefile and dBASE files encoded in various code pages

[Reference: http://support.esri.com/cn/knowledgebase/techarticles/detail/21106 ]

Reading and writing Shapefile and corresponding dbf file through program should set appropriate code page for strings. The reference shows the method.


Saturday, May 2, 2015

[C++ Builder] [TLIB Warning] Warning: library was too large for page size, rebuilt with page size 64


http://qc.embarcadero.com/wc/qcmain.aspx?d=99532


[C++ Builder XE6] Error! Import Bentley Microstation (V8) Type Library (E2347)



[bcc32 Error] MicroStationDGN_OCX.h(2159): E2347 Parameter mismatch in write access specifier of property Vertex
 
-------------------------------------------

[MicroStationDGN_OCX.h]

void __fastcall set_Vertex(int Index/*[in]*/,  Microstationdgn_tlb::Point3d* pVal/*[in,out]*/);

__property Microstationdgn_tlb::Point3d Vertex[int Index]={ read=get_Vertex, write=set_Vertex };


[MicroStationDGN_OCX.cpp]

void __fastcall TEllipseElement::set_Vertex(int Index/*[in]*/,
Microstationdgn_tlb::Point3d* pVal/*[in,out]*/)
{
  GetDefaultInterface()->set_Vertex(Index/*[in]*/, pVal/*[in,out]*/);
}


---------------------------------------  Solution  -----------------------------------------------------------------

[MicroStationDGN_OCX.h]

void __fastcall set_Vertex(int Index/*[in]*/,  Microstationdgn_tlb::Point3d& pVal/*[in,out]*/);



[MicroStationDGN_OCX.cpp]

void __fastcall TEllipseElement::set_Vertex(int Index/*[in]*/,
Microstationdgn_tlb::Point3d& pVal/*[in,out]*/)
{
  GetDefaultInterface()->set_Vertex(Index/*[in]*/, &pVal/*[in,out]*/);
}


---------------------- Explain  ----
Parameter type of set_ function should be the same as the type of the Property.






[C++ Builder XE6] Import Type Library as ActiveX Component (Ex: AutoCAD)


1. Create a new project.

2. [Component] [Import Component...]

3. [Import a Type Library]

4. Select the Type Library to be imported. ( Ex: AutoCAD )

5.1 Check [Generate Component Wrappers]
5.2 Assign Palette Page.

6. [Install to New Package]

7. Assign [Package Name] ........[Finish]

8.





9. Right click on the package project.....[Install]


10.

11. Components installed.


Saturday, December 27, 2014

C++ Builder glut.h error: One set of overloaded "c" functions

[Reference] https://www.opengl.org/discussion_boards/showthread.php/155277-Borland-glut-h-error-One-set-of-overloaded-c-functions

1) Add the following lines :

#ifdef __BORLANDC__ //ERIC CHANGE
#include <stdlib.h> //bring exit into global scope
#endif //ERIC CHANGE

Just above the lines:
#endif /* _WIN32 */

#include <GL/gl.h>
#include <GL/glu.h>
Around line 133 in glut.h(atleast in the one I have)

2) Then change line 146 in glut.h or the line that declares the extern _CRTIMP void __cdecl exit(int);
with the following:

#ifndef __BORLANDC__ //ERIC CHANGE
//in borland this function is not extern C.
//stdlib.h is included somewhere above 
extern _CRTIMP void __cdecl exit(int);
#endif //__BORLAND_C //ERIC CHANGE

libTiff 讀取 Photoshop 建立含有 image pyramid 的 tiff 檔 出現 Access violation at ....'CC32120MT.DLL'....

Note:
在 VCL form application 會出現問題.
在 Console 程式沒有問題.

原因, 以乎與 VCL 有關, 待查

Friday, November 14, 2014

[C++ Builder] GCRC command line fail

Occur when compile language resources file.

[Solution] move include file paths from [project] [options] to C++ Builder [Tools][Options]

[Qt] 執行檔需要哪些 Dll?

 1. 使用 Qt  的 windeployqt.exe 工具 (在 C:\Qt\Qt5.14.1\5.14.1\msvc2017\bin\)。   a. 把執行檔 myProgram.exe 放在某個資料夾。   b. 在檔案總管這個資料夾按 Shift 和滑鼠右鍵,開啟 Po...