Subscribe to this list via RSS Blog posts tagged in Win64

Posted by on in Programming
When writing template in template It is possible to write template in template.In that case, you can pass the "geho_<std :: vector>" class template directly to the template. namespace my_ { template <class T1, typename T2> struct hoge_{}; template< template<typename, typename> class T, typename T1, typename T2> struct geho_ { T<T1, T2> t_; }; }; I put hoge_ in class geho_. It is typed in T template in geho_.So you can pass it like the fol...

Posted by on in Programming
template中にtemplateを書く場合[JAPAN] 毛利です。 templateの中にtemplateを書く事が可能です。 その場合のメリットは geho_<std::vector> クラステンプレートをそのままテンプレートに渡せます。   namespace my_ { template <class T1, typename T2> struct hoge_{}; template< template<typename, typename> class T, typename T1, typename T2> struct geho_ { T<T1, T2> t_; }; }; geho_ クラスにhoge_ を入れてますが、geho_内でTテンプレートに型指定しています。 なので下記の様に渡す事ができます。 my_::geho_<my_::hoge_, TObject, TObject> geho_hoge_; hoge_をve...

Posted by on in Blogs
TURLEncodingを使わずURLエンコード[JAPAN] 毛利です。   C++Builderは TURLEncodingにはEncode()や、Decode()の機能があります。std::ostringstream と GetBytes()を使って同じような実装をしてみました。 #include <sstream> #include <array> #include <functional> const std::string path_encoding(UnicodeString input_, TEncoding* enc_) { std::function<bool(char)> fun1_{[](char c__)->bool{ std::array<char, 7> arr_={'-', '_', '.', '~', '&', '$', '!'}; for (auto a_: arr_) { if (a_ == c_...

Posted by on in Programming
I tried encoding not using TURLEncoding. I tried encoding without using TURLEncoding.used the std::ostringstream and GetBytes() functions. enc.cpp #include <sstream> #include <array> #include <functional> std::string path_encoding(UnicodeString input_, TEncoding* enc_) { std::function<bool(char)> fun1_{[](char c__)->bool{ std::array<char, 7> arr_={'-', '_', '.', '~', '&', '$', '!'}; for (auto a_: arr_) { if (a_ == c__) ...
THTTPClientを使った非同期 HTTP リクエスト[JAPAN] 毛利です。   THTTPClientを使って非同期HTTPリクエストを試してみました。 TNetHTTPClientと言うコンポーネントもありますが、TNetHTTPClient classにはTHTTPClientが 内包されています。 THTTPClientの非同期HTTPが使えるメソッドは下記です。 メソッド名   機能 BeginDelete public 非同期 HTTP リクエストを、DELETE HTTP リクエスト メソッドを使用して開始します。 BeginExecute public 非同期 HTTP リクエストを開始します。 BeginGet public 非同期 HTTP リクエストを、GET HTTP リクエスト メソッドを使用して開始します。 BeginGetRange public 非同期 HTTP リクエストを、GET HTTP リクエスト メソッドを Range ヘッダーと共に使用して開始します。 BeginHead p...
Visual C++2017で作ったDLLをC++Builderで使う[JAPAN] 毛利です。   Visual C++で作った64BitのDLLをC++Builderで試してみました。 まずVC++2017側のコードです。 ・・・・ extern "C" CONSOLEAPPLICATION1_API int test1(int i1) { ///This function only increments. ++i1; return i1; } extern "C" CONSOLEAPPLICATION1_API void test2(int i1, wchar_t* a) { ///Convert from int to wstring. std::wstring s{}; s = std::to_wstring(i1); ///It is not valid to allocate the wchar_t in the Visual C++ DLL and then free it in C++ Builder. ///wchar_t *a = new wchar_t[s.length() + 1]; wcscpy(a, s.c_str()); ///Finally cast to wchar_t* and return. ///return a; }   ビルドするとDLLが作られます。(ConsoleApplication1.dll)  
Use the DLL created by Visual C++2017 with C++Builder(Win64). Made a DLL with Visual C++. And I tried to use it in C++Builder. Common is 64 bits. First I will make a VC++ side DLL. //// extern "C" CONSOLEAPPLICATION1_API int test1(int i1) { ///This function only increments. ++i1; return i1; } extern "C" CONSOLEAPPLICATION1_API void test2(int i1, wchar_t* a) { ///Convert from int to wstring. std::wstring s{}; s = std::to_wstring(i1); ///It is not valid to allocate the wchar_t in the Visual C++ DLL and then free it in C++ Builder. /...
ファイルを圧縮して保存と呼び出し方法TZCompressionStream, TZDecompressionStream[JAPAN] 毛利です。 TZCompressionStreamを使って、TStreamデータを圧縮し保存し さらにTZDecompressionStreamを使い解凍する方法をご紹介します。 まず圧縮と解凍用に共通のテンプレートクラスを作成します。 #include <fmx.h> #include <System.ZLib.hpp> #include <memory> //--------------------------------------------------------------------------- __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { } template <typename T1, typename T2, typename T3> struct compression_stream { ///Template for common. std::unique_ptr<T1> f_compression_stream; T3 f_level; T2* f_stream; compression_stream(T3 l_level, T2* l_stream) { f_level = l_level; f_stream = l_stream; f_compression_stream = {std::make_unique<T1>(l_level, f_stream)}; } compression_stream(T2* l_stream) { f_stream = l_stream; f_compression_stream = {std::make_unique<T1>(f_stream)}; } ~compression_stream() { } };
How to write in C++Builder Firemonkey. Make a barcode. Make a barcode with C++Builder Firemonkey. This time, I used DEKO-san library. http://ht-deko.com/junkbox.html#BARCODE When unpacking, there is a BARCODE.PAS file inside. This BARCODE.PAS file needs to be rewritten a bit. That's pretty simple. Just change String to AnsiString.   Next, I will make a new project. The project is C++Builder Firemonkey. Add BARCODE.PAS to the project. BARCODE.hpp will be created when building.And then design the screen. In the...
The 25 days of C++mas - December 20 - tools included in C++Builder XE3 for 64-bit support With the addition of the 64-bit C++11 compiler in C++Builder XE3 update 1 (and RAD Studio XE3 update 1), there are a host of new 64-bit tools to go along with the compiler.  Here is a list (with links to the Embarcadero DocWiki articles) of the new 64-bit tools that are part of the 64-bit Windows application development set. bcc64.exe - the C++11 64-bit command line compiler - http://docwiki.embarcadero.com/RADStudio/XE3/en/BCC64.EXE,_the_C%2B%2B_64-bit_Windows_Compiler Ilink64.exe - the 6...

Check out more tips and tricks in this development video: