Thread View: borland.public.cppbuilder.internet.socket
10 messages
10 total messages
Started by Stuart Kelly
Tue, 31 Jan 2006 11:46
TIdFTP EAccessViolation BCB 2006
Author: Stuart Kelly
Date: Tue, 31 Jan 2006 11:46
Date: Tue, 31 Jan 2006 11:46
29 lines
1650 bytes
1650 bytes
Hi,
I have imported a C++Builder 6 project into C++Builder 2006 and am now getting EAccessViolations when I create a form with a TIdFTP component at run time. I am using Indy 9 as recommended.
If I delete the TIdFTP component the form is displayed ok.
Here is my form allocation and display code
try
{
// Exception when allocating the form
FormUpdate = new TFormUpdate(Application);
FormUpdate->Display();
} // end try
catch (Exception &e)
{
// Display EAccessViolation
ShowMessage(e.Message);
} // end catch
// free mem
delete FormUpdate;
FormUpdate = NULL;
The only thing I changed was to use Rave Reports instead of Quick Reports as this is no longer supplied with BCB 2006.
Kind Regards,
Stuart Kelly
Re: TIdFTP EAccessViolation BCB 2006
Author: Remy Lebeau (TeamB)
Date: Tue, 31 Jan 2006 18:03
Date: Tue, 31 Jan 2006 18:03
13 lines
1318 bytes
1318 bytes
"Stuart Kelly" <stuart@dkelly1.demon.co.uk> wrote in message news:43df5c2e$1@newsgroups.borland.com... > I have imported a C++Builder 6 project into C++Builder 2006 > and am now getting EAccessViolations when I create a form with > a TIdFTP component at run time. I am using Indy 9 as recommended. What is the actual error message? Where exactly does it occur? Please provide more details. Gambit
Re: TIdFTP EAccessViolation BCB 2006
Author: Stuart Kelly
Date: Wed, 01 Feb 2006 07:32
Date: Wed, 01 Feb 2006 07:32
16 lines
1373 bytes
1373 bytes
> >What is the actual error message? Where exactly does it occur? >Please provide more details. > If I remove the try/catch block this is the error I get. "Access violation at address 0056BBD4 in module 'OrderMaker.exe'. Read address of 00000000. The form is created dynamically at run time. The error accurs juring the form creation. If I step through the code the error accours during the InternalReadComponentRes function called in InitInheritedComponent. Stuart
Re: TIdFTP EAccessViolation BCB 2006
Author: Remy Lebeau (TeamB)
Date: Wed, 01 Feb 2006 09:29
Date: Wed, 01 Feb 2006 09:29
25 lines
1800 bytes
1800 bytes
"Stuart Kelly" <stuart@no.spam.com> wrote in message news:43e0722f$1@newsgroups.borland.com... > "Access violation at address 0056BBD4 in module 'OrderMaker.exe'. > Read address of 00000000. The code is accessing a NULL pointer somewhere. > The form is created dynamically at run time. The error accurs juring the form creation. Can you narrow it down any further? Do you have the same problem if you create the TIdFTP instance dynamically at runtime? > If I step through the code the error accours during the > InternalReadComponentRes function called in > InitInheritedComponent. That is not very helpful. All that tells us is that the error is occuring during DFM streaming. But it does not say which specific object/property was being streamed at the time of the error. Gambit
Re: TIdFTP EAccessViolation BCB 2006
Author: Stuart Kelly
Date: Thu, 02 Feb 2006 08:00
Date: Thu, 02 Feb 2006 08:00
25 lines
1907 bytes
1907 bytes
>> The form is created dynamically at run time. The error accurs juring the >form creation. > >Can you narrow it down any further? Do you have the same problem if you >create the TIdFTP instance dynamically at runtime? The same problem occurs if I create the instance dynamically. However if I step though the code the error accours in the constructor TIdComponent.Create(axOwner: TComponent); function in IdComponent.pas. The error accours during GStackCriticalSection.Acquire call. > >> If I step through the code the error accours during the >> InternalReadComponentRes function called in >> InitInheritedComponent. > >That is not very helpful. All that tells us is that the error is occuring >during DFM streaming. But it does not say which specific object/property >was being streamed at the time of the error. > Sorry, for lack of detail, I don't have much experience with Delphi.
Re: TIdFTP EAccessViolation BCB 2006
Author: Remy Lebeau (TeamB)
Date: Thu, 02 Feb 2006 09:33
Date: Thu, 02 Feb 2006 09:33
20 lines
1710 bytes
1710 bytes
"Stuart Kelly" <stuart@no.spam.com> wrote in message news:43e1ca39$1@newsgroups.borland.com... > The same problem occurs if I create the instance dynamically. Can you please show the code? > However if I step though the code the error accours in the > constructor TIdComponent.Create(axOwner: TComponent); > function in IdComponent.pas. > > The error accours during GStackCriticalSection.Acquire call. That suggests that the critical section has not been created yet when you are instantiating the component. The only way that can happen is if the Indy library has not been initialized properly by the VCL runtime. Gambit
Re: TIdFTP EAccessViolation BCB 2006
Author: Stuart Kelly
Date: Thu, 02 Feb 2006 10:57
Date: Thu, 02 Feb 2006 10:57
33 lines
2026 bytes
2026 bytes
> Can you please show the code?
>
Do you want me to post the whole project as a zip file?
The code for dynamic allocation is as follows.
TIdFTP *TestFTP;
try
{
TestFTP = new TIdFTP(this);
} // end try
catch (Exception &e)
{
ShowMessage(e.Message);
} // end catch
>> However if I step though the code the error accours in the
>> constructor TIdComponent.Create(axOwner: TComponent);
>> function in IdComponent.pas.
>>
>> The error accours during GStackCriticalSection.Acquire call.
>
> That suggests that the critical section has not been created yet when you
> are instantiating the component. The only way that can happen is if the
> Indy library has not been initialized properly by the VCL runtime.
>
The project was a C++Builder 6 project imported into C++Builder 2006,
could this have caused an error in the project file?
Stuart
Re: TIdFTP EAccessViolation BCB 2006
Author: Stuart Kelly
Date: Thu, 02 Feb 2006 11:09
Date: Thu, 02 Feb 2006 11:09
11 lines
1487 bytes
1487 bytes
Don't know if this helps. I tried creating a simple program with just a IdFTP component in C++Builder 6, this complied and ran ok. Then I imported the project into C++Builder 2006. It compiled ok, but generated the same exception. Do you want me to post the project or add it to QC? Stuart
Re: TIdFTP EAccessViolation BCB 2006
Author: Remy Lebeau (TeamB)
Date: Thu, 02 Feb 2006 19:18
Date: Thu, 02 Feb 2006 19:18
15 lines
1917 bytes
1917 bytes
"Stuart Kelly" <stuart@nospam.com> wrote in message news:43e1e4e6$1@newsgroups.borland.com... > The project was a C++Builder 6 project imported into C++Builder > 2006, could this have caused an error in the project file? Possibly, yes. Borland IDEs for C++ have never had good project importers implemented. BDS 2006 is no exception to that (although it is better then in previous versions). The best thing to do when upgrading a project to a new IDE is to always create a new project in that IDE and then migrate the existing source code into it. Don't import/upgrade the project iself. Gambit
Re: TIdFTP EAccessViolation BCB 2006
Author: Stuart Kelly
Date: Fri, 03 Feb 2006 08:22
Date: Fri, 03 Feb 2006 08:22
18 lines
1882 bytes
1882 bytes
> >> The project was a C++Builder 6 project imported into C++Builder >> 2006, could this have caused an error in the project file? > > Possibly, yes. Borland IDEs for C++ have never had good project importers > implemented. BDS 2006 is no exception to that (although it is better then > in previous versions). The best thing to do when upgrading a project to a > new IDE is to always create a new project in that IDE and then migrate the > existing source code into it. Don't import/upgrade the project iself. > OK Thanks, I'll recreate the project as you suggest. I've also posted a test case on QC - 24402. Thanks for your help. Stuart
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads