Watch, Follow, &
Connect with Us

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


Welcome, Guest
Guest Settings
Help

Thread: Moved project to 10.2, crashes before WinMain - Konopka Controls Gotcha


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


Permlink Replies: 9 - Last Post: Apr 2, 2017 2:44 AM Last Post By: Goran Ekstrom Threads: [ Previous | Next ]
Goran Ekstrom

Posts: 149
Registered: 1/10/04
Moved project to 10.2, crashes before WinMain - Konopka Controls Gotcha  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2017 10:34 AM
Hi,
what do you do if a Project crashes Before it even reaches WinMain?

Regards
Goran
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Moved project to 10.2, crashes before WinMain  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2017 10:52 AM   in response to: Goran Ekstrom in response to: Goran Ekstrom
Goran wrote:

what do you do if a Project crashes Before it even reaches WinMain?

Run it in the debugger and trace back through the call stack until you find
the culprit.

--
Remy Lebeau (TeamB)
Goran Ekstrom

Posts: 149
Registered: 1/10/04
Re: Moved project to 10.2, crashes before WinMain  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2017 12:14 PM   in response to: Remy Lebeau (Te... in response to: Remy Lebeau (Te...
Hi Remy,
I instead tried to copy the 10.1.2 Project and open it in 10.2. Now it doesn't crash before WinMain but I get a "privilged instruction" error when the MainForm constructor tries to construct the TForm subclass:

__fastcall TMainForm::TMainForm(TComponent* Owner)
HERE-> : TForm(Owner)

What could be causing this?
Remy Lebeau (Te...


Posts: 9,447
Registered: 12/23/01
Re: Moved project to 10.2, crashes before WinMain  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2017 12:43 PM   in response to: Goran Ekstrom in response to: Goran Ekstrom
Goran wrote:

I instead tried to copy the 10.1.2 Project and open it in 10.2. Now it
doesn't crash before WinMain but I get a "privilged instruction" error
when the MainForm constructor tries to construct the TForm subclass:

__fastcall TMainForm::TMainForm(TComponent* Owner)
HERE-> : TForm(Owner)

What could be causing this?

Again, you are just going to have to debug it yourself and find out. Use
the debugger to step into the VCL's source code.

--
Remy Lebeau (TeamB)
Brett Wilton

Posts: 45
Registered: 10/1/11
Re: Moved project to 10.2, crashes before WinMain  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2017 1:48 PM   in response to: Goran Ekstrom in response to: Goran Ekstrom
I have not always had much luck with project automatic upgrades and getting weird crashes.

It could be linking in the wrong BPL / DLL.

I normally rebuild the project manually by create a new project, compile and check it runs.

Change the form name to match the target project and the files name.

Then copy over all the form files and all the other files. Add the additional files to the project and rebuild.
Goran Ekstrom

Posts: 149
Registered: 1/10/04
Re: Moved project to 10.2, crashes before WinMain  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 30, 2017 1:56 PM   in response to: Brett Wilton in response to: Brett Wilton
I normally rebuild the project manually by create a new project, compile and check it runs.

I did just that right now, this time stripping the project down to bare essentials with just the MainForm and a very simple one at that. Still crashes before WinMain is called.

Edit:
Even a simple test project that ran yesterday crashes. The only thing changed since then is that I installed Konopka Signature VCL Controls 6.2.3 and after removing that the test app runs again.

Solution:
It seems Tokyo had gotten default include paths to Konopka Signature VCL Controls 6 for both 10.2 Tokyo and 10.1 Berlin during some installation which most likely caused linking of wrong libraries. By removing Konopka Signature VCL Controls 6.2.3 from Tokyo, then removing all references to Konopka in the Tokyo default paths, then reinstall Konopka 6.2.3 and finally check that only Konopka default paths for Tokyo are present it works.

Update for Konopka 6.2.3 installation:
After doing the installation on my laptop it seems Konopka 6.2.2 version for pre-Tokyo and Konopka Tokyo 6.2.3 can coexist if installed into the default directory. The 6.2.3 installer simply adds its new files, leaving the support for older RAD versions untouched.

Brett Wilton

Posts: 45
Registered: 10/1/11
Re: Moved project to 10.2, crashes before WinMain  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 1, 2017 2:53 PM   in response to: Goran Ekstrom in response to: Goran Ekstrom
Yes read this the other day on Marco's site

"If you already have installed a different version on the same PC, make sure you are installing on a separate folder and don't override the previous installation."

http://blog.marcocantu.com/blog/2017-march-konopka-radiant-turbopack-getit.html
Goran Ekstrom

Posts: 149
Registered: 1/10/04
Re: Moved project to 10.2, crashes before WinMain  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 2, 2017 2:42 AM   in response to: Brett Wilton in response to: Brett Wilton
"If you already have installed a different version on the same PC, make sure you are installing on a separate folder and don't override the previous installation."

That's what I thought initially but my second install on my laptop worked just fine installing 6.2.2 and 6.2.3 into the default RC6 folder. This way of installation is also confirmed by Ray Konopka as the intended one.
Josh Kelley

Posts: 75
Registered: 3/6/08
Re: Moved project to 10.2, crashes before WinMain - Konopka Controls Gotcha [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 31, 2017 1:14 PM   in response to: Goran Ekstrom in response to: Goran Ekstrom
On 3/30/2017 5:31 PM, Goran Ekstrom wrote:
Hi,
what do you do if a Project crashes Before it even reaches WinMain?

In my experience, this can be caused by linker problems or mismatched
C++ settings.

For linker problems, you can try deleting all incremental linker files,
possibly doing a full clean, then recompiling and re-linking.

For mismatched C++ project settings, make sure that all of your
components are built in the same RAD Studio version, and if you're
linking multiple C++ projects together, make sure that they all agree on
settings such as whether they're using the Clang or classic compiler,
whether they're linking the C runtime statically or dynamically, etc.

--
Josh Kelley
https://www.joshkel.com/
Goran Ekstrom

Posts: 149
Registered: 1/10/04
Re: Moved project to 10.2, crashes before WinMain - Konopka Controls Gotcha [Edit]  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Apr 1, 2017 1:59 AM   in response to: Josh Kelley in response to: Josh Kelley
Josh Kelley wrote:
On 3/30/2017 5:31 PM, Goran Ekstrom wrote:
Hi,
what do you do if a Project crashes Before it even reaches WinMain?

In my experience, this can be caused by linker problems or mismatched
C++ settings.

For linker problems, you can try deleting all incremental linker files,
possibly doing a full clean, then recompiling and re-linking.

For mismatched C++ project settings, make sure that all of your
components are built in the same RAD Studio version, and if you're
linking multiple C++ projects together, make sure that they all agree on
settings such as whether they're using the Clang or classic compiler,
whether they're linking the C runtime statically or dynamically, etc.

Thanks Josh. Wish there were moderated sticky threads here where we could collect good advice for issues like this.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02