C++ Builder 10.2 - main project cpp file corruption?

1
Hi,

I have some custom code in the beginning of

int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)

function in the main project cpp file. When adding a new form to a project all my custom code in that function is deleted and a new code is generated with additional Application->CreateForm.. Is this a bug?
Responses (3)
  • Accepted Answer

    Sunday, July 23 2017, 10:22 AM - #Permalink
    0

    Hi Pkl,

     

    I have a project that was initially started in XE6 and now working on it in 10.2. It seams this issue only happens when I add a new form into that project, while now testing on a new project in 10.2 and cannot reproduce it..

    The reply is currently minimized Show
  • Accepted Answer

    Saturday, July 22 2017, 05:37 AM - #Permalink
    0

    Hi Zeljico,

    I have custom code in my main project CPP file too, but I don't have the problem you describe. I am using CB 10.2 on Windows 10 with US English locale. I wonder whether formatting of your source file is confusing the IDE.

    My main CPP file looks like this

    //---------------------------------------------------------------------------
    USEFORM("AboutFm.cpp", AboutForm);
    ... all forms listed ...
    //---------------------------------------------------------------------------
    int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
    {
    ... more code

    Note that the USEFORM list has comment lines before and after the list, then the _tWinMain statement. I don't know whether formatting is significant, but you might try formatting this section of your code and see what happens.

     

    The reply is currently minimized Show
  • Accepted Answer

    Monday, July 17 2017, 11:26 PM - #Permalink
    0

    Hi,

    - if You want to make work with clean c/c++ in the main(), You must create console mode project.

    Thanks.

     

    The reply is currently minimized Show
Your Reply

Please login to post a reply