Quantcast
Channel: Embarcadero Community - Embarcadero Community
Viewing all 1963 articles
Browse latest View live

How to use Dlib in C++Builder 10?

$
0
0

Hi,

I am trying to use Dlib library which is fully written in Standard C++, in C++Builder CX 10.

So I turned off the check in project compiler option page "Classic Compiler" to be able to use Clang-based compiler bcc32c.

I tried to compile examples comes in Dlib but I couldn't. I get the following compiler errors:

[CLANG Error] float_details.h(107): use of undeclared identifier 'frexpf'
[CLANG Error] fortran_id.h(26): do not know how to link with fortran for the given platform
[CLANG Error] fortran_id.h(36): do not know how to bind to fortran calling convention

So could you please guide me how to fix the problem?

Dlib link:

http://dlib.net/

Regards,


Problem with REST Client & Android

$
0
0

Hi,

Trying to deploy an application for Android and I am getting linker error's relating to where I am using TRESTClient, Request and Response. The method that it is saying there is an undefined reference to in compiles and link's fine for OSX, iOS & Windows - however it seems to just be Android this is happening with.

The method is a function inside a namespace so it is being called as 'DB::ServerLogEvent'. The linker errors are here http://pastebin.com/0h1Gskyg

If anyone could help that would be appreciated as I am out of ideas, been scratching my head for an hour trying to figure this one out.

Delphi Seattle 10 deploying to OSX 10.10.5 - wrong library referenced?

$
0
0

Message from the PA Server:

dyld: Library not loaded: /usr/lib/libSystem.dylib

 

Referenced from: /Users/philipthorburn/PAServer/scratch-dir/philipthorburn-Local Mac/Dashboard.app/Contents/MacOS/Dashboard

 

Reason: Incompatible library version: Dashboard requires version 112.0.97 or later, but libSystem.B.dylib provides version 1.0.0

This was a fresh install of Delphi, on a fresh load of Windows 10 Home.   Why am I not able to deploy a "blank" project application to OSX?

 

Mobile Preview

docwiki url is case sensitive?

FireDAC changes SQLite pragmas on its own

$
0
0

My Delphi XE7 FireUI MacOS app uses FireDAC to access SQLite. (That is the most acronyms I've ever placed in a single sentence.)

My app sets the SQLite pragma SYNCHRONOUS to OFF but as soon as it runs a query, FireDAC apparently sets it back of FULL.

This also happens with pragma CHECKPOINT_FULLFSYNC. FireDAC changes it back to 1 after my app sets it to zero.

How do I stop it from doing that? Or should I report this as a bug?  

char-string literals are interpreted as UTF8-strings using Clang-compilers

$
0
0

char-string literals are interpreted as UTF8-strings using Clang-compilers
which becomes obvious if one uses non ASCII-chars as German Umlaute in a char-string:
const char* str_b  = "aäöüÄÖÜßo";
Internally these strings are translated by the processing with the Clang-compilers in UTF8-strings, which was not intended and which is not the case using the classic 32-bit-compiler and the 64-bit compiler of version XE8.
A brief example  shows  the effect: Create a VCL-application, insert a TMemo-component and insert the following code in the constructor:
__fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner)
{
 std::stringstream out;
 const char*    str_b  =  "aäöüÄÖÜßo";
 const char* file = "Test.txt";
 {
  out << "output to file: " << file << "\n";
  std::ofstream os(file, std::ios_base::out);
  os << str_b;
 }

 {
  std::string str_ib;
  out << "input from file: " << file;
  std::ifstream is(file, std::ios_base::in);
  is.seekg(0, std::ios_base::end);
  out << " ( " <<  is.tellg() << " bytes in file!)";
  is.seekg(0, std::ios_base::beg);
  is >> str_ib;
  out << " -> " <<  str_ib;
 }
 Memo1->Text = out.str().c_str();
}

add the header files
 #include
 #include
 #include

and run the program. The standard setup (32-bit classic compiler) produces the output:
 output to file: Test.txt
 input from file: Test.txt ( 9 bytes in file!) -> aäöüÄÖÜßo
which is the same result obtained with XE8 in 32- und 64-bit(!!)-compilation. Using with CX the new 32-bit Clang-compilers in the 32-bit- or 64-bit version leads to the output: 
  output to file: Test.txt
 input from file: Test.txt ( 16 bytes in file!) -> aäöüÄÖÜßo
which clearly demonstrates, that the literal was treated as an UTF8-string (use debugger to explore the string).
What option has to be set in order to obtain the 'old' behavior - which is the way the VS2015- or Intel- 2016-compilers work?
This is specifically essential because the byte-output and -input to/from files are effected, which would cause a big effort of adoption work to make sure that datafiles can be used for the exchange with other programs.

 

Why am I getting 'Windows Driver Foundation - ....Host Process' consuming CPU with Seattle?

$
0
0

I've installed Delphi 10 Seattle in a Windows 10 VM in VMWare. It all runs fine, but I kept noticing that when I resumed the VM, Delphi could not find source files, sometimes it could not see the DPR. This 'File not found' error was reported across a range of project source files, seemingly randomly.

I soon discovered that I could cure the problem by restarting the VM - everything then worked fine, until the next time I suspended and resumed. This was a nuisance and never happened with Delphi XE8 in a Windows 8 VM. So I dug deeper.

I've found that upon resume, task manager in the VM shows 'Windows Driver Foundation - User mode driver framework host process' at around 16% CPU and about the same % assigned to Seattle. If I terminate the 'Windows Driver Foundation - User mode driver framework host process' manually, my problem goes away, so it's use of CPU is obviously connected to the File Not Found errors.

Can anyone suggest what connects Delphi with this host process and why it stops on a restart, but is consuming CPU after a VM resume?

Thanks Brian.


How to use external large image in Android notification bar like Facebook or etc on firemonkey Delphi XE 8?

$
0
0

I know you can send info in the push notification parameters like message, title, image URL, etc. How does Facebook show your profile pic with your message in the notification area? I want to use an external image in the notification area, so when you pull it down you see the profile image with the message. Right now, mine just shows the default icon. I figured this might be a common question but couldn't find anything. Any help would be nice.

Please refer to the photo.

photo465718594445093043

Web browsing functionality lost in IDE after web proxy is enabled

$
0
0

Does anyone have experience in using the IDE when web proxy is enabled?

We are using Trend Micro as web proxy service to control access to the Internet in our company for security reason. As soon as proxy setting is set under IE|Internet Options|Connections|Lan Setting|Proxy server, any browsing to the documentation page, community page and sample codes page are not working anymore. Neither is our community toolbar in the IDE which allows posting question and viewing answer as such via this site.

We have no problem however browsing the same page/site through IE and Chrome directly when the web proxy is enabled, but just not within Delphi IDE. We are using XE8 and Seattle 10.

Does anyone have any pointer in how to resolve this?

I know putting the address *.embarcadero.com in the proxy exception list would work, but why it is not required when browsing directly in IE?

Thanks in advance.

 

BLE: unexplained delay while WriteCharacteristic (XE8)

$
0
0

Hello, 

 

in an App for Andriod an iOS i use TBluetoothLEManager to communicate between mobile and a BLE-Device. 

To send data to the BLE-device, i use the code-sequence:       

 

CR_GattService:=FBLEDevice.GetService(CR_SERVICE);

CR_GattCharact:=CR_GattService.GetCharacteristic(CR_CHARACTERISTIC);  

CR_GattCharact.SetValue(sOutBuffer);   

sTime:=Now;    

TabbedForm.mDevOut.Lines.Add(SecondOf(sTime).ToString');

FBLEDevice.WriteCharacteristic(CR_GattCharact); 

sTime:=Now;    

TabbedForm.mDevOut.Lines.Add(SecondOf(sTime).ToString'); 

 

 

If I send a single command to the BLE-Device, the time between CR_GattCharact.

SetValue and FBLEDevice.WriteCharacteristic is about 200ms.  

When I send two command on behind the other, the time to write chracteristics is 3s?? 

 

Has anybody an explanation for that?(Android 4.4.2, on iOS this delay do not exist)  

 

Best Markus

ListView items exchange problem

$
0
0

This question asked in stack overflow but its seems this problem very hard to answer  , I am trying to exchange items inside a list view Here is the procedure that I am trying to use

procedure ExchangeItems(lv: TListView; Const ItemFrom, ItemTo: Integer);
var
    Source, Target: TListItem;
begin
    lv.Items.BeginUpdate;

    try
        Source := lv.Items[ItemFrom];
        Target := lv.Items.Insert(ItemTo);
        Target.Assign(Source);
        Source.Free;
    finally
        lv.Items.EndUpdate
    end;
end;



it exchanges an empty item that does not exist in my listview and raise this exception

 First chance exception at $75164B32. Exception class EConvertError with message 'Cannot assign a nil to a TListItem'.

 

That's how I exchange items if some condition is met

 

procedure TFORM1.UpdateVisual(Sender: TObject; AUserData: Pointer; var AImage: TGifImage);
var
 Item: TListItem;
 i : integer;
begin
 Item := TListItem(AUserData);

  if ListView1.Items.IndexOf(Item) = -1 then
    Exit;

  Item.Data := AImage;
  AImage := nil;
// if recorder is active then select item that equal to ClientID and exchange it to Top
if recorder = True then
      begin
       for i := 0 to ListView1.Items.Count-1
     do if ListView1.Items[i].SubItems[3] = IntToStr(ClientID)
     then
     begin
     ExchangeItems(ListView1, Item.Index, 0);
     ListView1.Invalidate;
     end;
   end;
end;

 

 

 

How can I handle this exception?

 

[ilink32 Error] Fatal: Unable to open file 'FRXCHART.OBJ'

$
0
0

Hello!

I am porting a very large application suite from RS2010 to XE7. The project files originated in CBB6, and I managed to upgrade them to RS2010 with only a little bit of difficulty. This time, I'm having enormous problems.

Using my existing project files, I could not get around a duplicate class name error. Looking at my converted project files, and a newly create project file, it looked like I had a ton of baggage, so I decided to try to build new project files.

Now when I compile I am getting these "Unable to open file" errors for objects contained in packages that are listed in the packages list. According to the .dpk files included in the FastReport distribution, FrxTee21 is the package that contains FrxChart. I have attached a screenshot showing that FrxTee21 is listed in the package list.

I have been able to work around this issue by manually adding FrxTee21.bpi to my project. It then errors on the next package I need. There are two problems with this: 1. It makes the list of files in my project manager HUGE, so that it is hard to find *my* actual units in that mess. 2: I've spent several hours researching what package contains the offending object file and adding it to the project, with no end in sight. We use many DevExpress components, so there are easily 100 packages in that package list.

Can someone please explain to me how this is suposed to work? Why don't the runtime packages listed in the UI actually get linked into the application? How is a directive different than including the package in the section? Is there a better way to solve this problem?

Thanks for your help!

Screenshot.jpg

How to use OpenCV in C++Builder XE10?

$
0
0

Hi,

Since long time I'm trying to use/build OpenCV library (Standard C++) with CBuilder without success. Some one had some success (http://code.opencv.org/issues/2057) using many tricks and many #idfef but noting is official and C++ Builder is not supported by OpenCV.

With new XE10 CLANG compiler it should be more feasible to compile the lib. I made some test with XE10 bcc32c and bcc64 but I was able to build only few modules.

It would be nice to see C++ Builder aside of g++ and VS and others officially supported by OpenCV.

I know that OpenCV isn't an Embarcadero problem but considering that OpenCV, like many other libs, are standard C++ may be it's possible to do something on the compiler side, or as an alternative, to receive some support to overcome the issues.

A good starting point would be to update CBuilder support in CMake (bcc32c and bcc64 aren't listed by CMake)

I think this would opens CBuilder market to many other user too.

I hope something will happens
Thank you

Change the Colour cell in a TCalendar Component

$
0
0

Hi, i need to change the colour of some cell, in a TCalendar Component on an app that will work on android an ios.  I´m Using Delphi Seattle 10. Is there an easy way or should i investigate on how to do it ?

Thanks for your time, and sorry for my English. 


iOS 9 Done button?

$
0
0

Hi,

Using Delphi 10 Seattle, how to remove "Done" button that shows above iOS keyboards?

Thanks,

Asaf    

Units missing from project group

$
0
0

Using XE8 Update 1 only some of my project units appear in the project group or when I try to reopen. The units however are intact when I open the project source page.  Any suggestions would be appreciated.

How to configure different lib LIB for each platform and/or config ?

$
0
0

It seems that is not possible to use different dynamic library .DLL/.LIB file for different configuration ?!?

I mean: I need to use a 3rd part library which is deployed with different LIB files as below:

for Win32/Debug version I need to use file1.lib and file2.lib while for Win32/Release version I need of file2 and file3.lib

for Win64/Debug version I need to use file1_x64.lib and file2_x64.lib while for Win32/Release version I need of file2_x64 and file3_x64.lib

Summary:

  Win32 Win64
Debug file1D.lib, file2D.lib file1_x64D.lib, file2_x64D.lib
Release file1.lib, file3.lib file1_x64.lib, file3_x64.lib



This is a common case.

I know I could rename all libs (and dlls) so the have same name, put them in different folder and configure the IDE Libray path but this is a nightmare.

It's possibile to set libs per platform and/or configuration directly in the project  using the IDE ?


Thank you

FMX components trigger premature mouse events in iOS - Delphi 10

$
0
0

I have a simple Multi-Device application that consists of a TTabControl, 1 TTabItem and a TButton on in the tabitem.  If I press and hold the button down, onMouseUp is triggered before I let go.  FMX.Platforms.iOS  touchesCancelled is being called which is forcing a MouseUp event.

  • This only happens when the button is in a TabControl (the main application relies heavily on TabControls, so we don't want to move away from this).
  • If we downgrade back to XE8, this DOES NOT happen
  • This happens even on a simple test application with the 3 components mentioned above, and put some kind of action in the onMouseEvent of the button
  • This does not occur on Android on Win32 (kind of obvious since FMX.Platforms.iOS wouldn't be called)
  • We also tried replacing with a onMouseLeave event, but still touchesCancelled gets called and a MouseUp event is forced.
  • Happens on devices and simulator

Any ideas?

How do I get Title of remote push notification in TPushEvents.OnPushReceived?

$
0
0

Using Delphi Seattle 10 for iOS and Android development:

I want to forward remote pushes I receive using TPushEvents and TParseProvider to the NotificationCenter component, but how do I get the title of the push (see ????? in code below)?

Or does someone know another approach for always forwarding a remote push (from  parse.com) to the device's notification center (so not only if the app is inactive)?

 

procedure TForm1.PushEvents1PushReceived(Sender: TObject; const AData: TPushData);

var

  MyNotification: TNotification;

begin

  MyNotification := NotificationCenter1.CreateNotification;

  try

      MyNotification.Name := ?????;

      MyNotification.AlertBody := AData.Message;

      NotificationCenter1.PresentNotification(MyNotification);

  finally

    MyNotification.DisposeOf;

  end;

end;

Viewing all 1963 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>