Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Total Commander plugin vs. using a TForm


This question is answered. Helpful answers available: 1. Correct answers available: 1.


Permlink Replies: 11 - Last Post: Oct 14, 2016 11:01 PM Last Post By: Istan Velo
Istan Velo

Posts: 47
Registered: 3/2/02
Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 9, 2016 11:34 AM
Any idea how this is going to work with C++ Builder XE10.1 ?
There exist an old example based on BCB6 but it's not working with XE10.1 anymore.
TApplication throws an exception before any TC exposed function is entered?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 10, 2016 10:32 AM   in response to: Istan Velo in response to: Istan Velo
Istan wrote:

There exist an old example based on BCB6 but it's not working with
XE10.1 anymore.

In what way exactly?

TApplication throws an exception before any TC exposed function
is entered?

Can you be more specific? What is the actual exception? Where is it being
raised from exactly?

--
Remy Lebeau (TeamB)
Istan Velo

Posts: 47
Registered: 3/2/02
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 11, 2016 9:18 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy,

There exist an old example based on BCB6 but it's not working with
XE10.1 anymore.

In what way exactly?

The example can be found here: http://totalcmd.net/plugring/ListSimpleBcb.html

TApplication throws an exception before any TC exposed function
is entered?

Can you be more specific? What is the actual exception? Where is it being
raised from exactly?

TApplication seem to allocate a handle, where it fails.

Istan
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 12, 2016 10:29 AM   in response to: Istan Velo in response to: Istan Velo
Istan wrote:


I don't want to see the example code, I want you to explain the actual problem
it is exhibiting.

TApplication seem to allocate a handle, where it fails.

TApplication has always allocated an HWND for itself. If that is failing,
you will have to debug it to find out why.

--
Remy Lebeau (TeamB)
Istan Velo

Posts: 47
Registered: 3/2/02
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 11, 2016 11:20 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy,
I got the sample to work! I recreated the project from scratch. As usual, the project update failed..
Istan
Istan Velo

Posts: 47
Registered: 3/2/02
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 12, 2016 5:08 AM   in response to: Istan Velo in response to: Istan Velo
Istan Velo wrote:
Hi Remy,
I got the sample to work! I recreated the project from scratch. As usual, the project update failed..
Istan

Was too fast. When using the clang compiler, TC complains about "not compatible DLL". What's the difference between Borland and clang compiler in this aspect?
Neither x32 nor x64 DLLs work.

Every exported function is declared with:
extern "C" __declspec(dllexport) void __stdcall ...
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 12, 2016 10:30 AM   in response to: Istan Velo in response to: Istan Velo
Istan wrote:

Was too fast. When using the clang compiler, TC complains
about "not compatible DLL".

"Not compatible" in what way exactly? You are not providing any useful information.

What's the difference between Borland and clang compiler
in this aspect?

You tell us, you are the one compiling the DLL. What is different about
it in the two compilers? For instance, did you check to make sure your plugin
functions are being exported, and with the correct names?

--
Remy Lebeau (TeamB)
Istan Velo

Posts: 47
Registered: 3/2/02
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 13, 2016 7:24 AM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Remy Lebeau (TeamB) wrote:
Istan wrote:

Was too fast. When using the clang compiler, TC complains
about "not compatible DLL".

"Not compatible" in what way exactly? You are not providing any useful information.

Unfort. there is no other useful information. It simply cannot be loaded from TC. And when debugging, not a single exported functions are entered at all.


What's the difference between Borland and clang compiler
in this aspect?

You tell us, you are the one compiling the DLL. What is different about
it in the two compilers? For instance, did you check to make sure your plugin
functions are being exported, and with the correct names?

This is my question: What is the difference between Borland and clang compiler output, when building a DLL?

Using x32 Borland compiler works, using x32 clang compiler not.

The source code is always exaclty the same!! Built with Borland compiler it can be opened but with clang compiler not. So I have to assume all attributes for the exported functions are right, as otherwise the Borland built version would also not work, or?

Istan
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Total Commander plugin vs. using a TForm
Helpful
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 13, 2016 11:33 AM   in response to: Istan Velo in response to: Istan Velo
Istan wrote:

Unfort. there is no other useful information. It simply cannot be
loaded from TC. And when debugging, not a single exported
functions are entered at all.

You did not answer my earlier question. Did you verify the functions were
being exported correctly to begin with?

This is my question: What is the difference between Borland and
clang compiler output, when building a DLL?

You missed the point of my earlier question. YOU TELL US what is different,
we can't see your project. Compile the plugin using the classic compiler,
and then dump its exports using the TDUMP tool. Then compile the plugin
using the clang compiler, and dump its exports. Then compare the results
for any differences.

The source code is always exaclty the same!!

But that does not guarantee it is compiled the same way.

--
Remy Lebeau (TeamB)
Istan Velo

Posts: 47
Registered: 3/2/02
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 14, 2016 1:17 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy,
I re-created all projects from scratch again in a new folder and everything works fine now. TC now loads x32 and x64 plugins built from RadStudio properly.
There is just one IDE bug: The x64 DLL file extension cannot be set properly. It appends ".DLL" to the entered extension.
Thx.
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 14, 2016 1:28 PM   in response to: Istan Velo in response to: Istan Velo
Istan wrote:

There is just one IDE bug: The x64 DLL file extension cannot
be set properly. It appends ".DLL" to the entered extension.

Kind of makes sense, since the 64bit compiler is for Windows only, and shared
libraries on Windows are DLLs. What are you trying to set the file extension
to instead? You might need to use a post-build script to rename the compiled
file after compiling.

--
Remy Lebeau (TeamB)
Istan Velo

Posts: 47
Registered: 3/2/02
Re: Total Commander plugin vs. using a TForm  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Oct 14, 2016 11:01 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Kind of makes sense, since the 64bit compiler is for Windows only, and shared
libraries on Windows are DLLs. What are you trying to set the file extension
to instead? You might need to use a post-build script to rename the compiled
file after compiling.

First of all, TC (Ghisler) defined these extensions:
.wlx / .wlx64
.wcx / .wcx64
.wdx / .wdx64

imho a feeble argument.. the x32 compiler also creates a Windows only DLL. The x64 linker allows to (sort of) change the extension (via the Options | Application dialog) but it additionally adds .DLL to the file. I assume the .target file or the 64 bit linker does it wrong and I would mark this issue as a bug.

And yes, I had to add a post-build "file renaming action" for x64, which did not matter in my case, since I had to create a small TC install package anyway.

Nevertheless, you still do great support here Remy, although most ppl do not know anything about C++ anymore.

Thx,
Istan
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02