c++builder-xe2

Variables in c++ builder XE2 not initializing when unit was called by component

社会主义新天地 提交于 2020-01-06 07:24:20
问题 I have a unit (WebFunctions.h) with the declaration String RawURLAllowedChars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ~.-_"; This unit works well in the app. But when I add a component which also declares WebFunctions.h , the initialization of RawURLAllowedChars does not occurs ( RawURLAllowedChars = NULL ). To get the app back to work, plus remove the class declaration of the component is still necessary delete the WebFunctions.obj file. Note: Any declarations in .cpp file,

How to show a firemonkey form on second monitor

穿精又带淫゛_ 提交于 2019-12-23 19:02:37
问题 I am trying to display a FireMonkey form on a second monitor, using C++Builder with following code: void __fastcall ShowFormOnScreen( int OutMon ) { MyForm->Top = 0; MyForm->BorderStyle = bsNone; MyForm->WindowState = wsNormal; MyForm->Left = Screen->Monitors[OutMon]->Left; MyForm->Height = Screen->Monitors[OutMon]->Height; MyForm->Width = Screen->Monitors[OutMon]->Width; MyForm->Show(); } Unfortunately, the Screen object does not have the Monitors property, so how can do this in FireMonkey?

import VS C++ DLL in C++ Builder

我的未来我决定 提交于 2019-12-13 05:04:19
问题 I created a project using C++/CLI in Visual Studio 2012. The GUI was made in C++ Builder XE2 and I would like to import the generated DLL from VS C++ 2012 but I was not able to import it correctly. HINSTANCE load = LoadLibrary(library); if (!load) ShowMessage("Error importing the library"); Unfortunately when I run the code after I use the LoadLibrary function the variable load is NULL. Any help? I unsterstood that I need to use some utilities from the C++ Builder to convert the DLL generated

How do I listen the event of Running IE with IWebBrowser2 in C++ XE2?

爷,独闯天下 提交于 2019-12-12 19:00:42
问题 Currently I want to automate the running IE. I have successfully attached the running IE using below code (I assume there is only one IE within one tab) #include "atl/atlbase.h" #include <exdisp.h> #include <mshtml.h> CComQIPtr<IWebBrowser2> pCurIE; void __fastcall TForm4::Button3Click(TObject *Sender) { bool SuccessToHook = false; CComPtr<IShellWindows> m_spSHWinds; if (FAILED(m_spSHWinds.CoCreateInstance( __uuidof( ShellWindows)))){ return ; } LONG nCount; m_spSHWinds->get_Count( &nCount);