Thread View: borland.public.cppbuilder.migration
7 messages
7 total messages
Started by Sanjay Patel
Sun, 25 Jun 2006 01:18
Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
Author: Sanjay Patel
Date: Sun, 25 Jun 2006 01:18
Date: Sun, 25 Jun 2006 01:18
34 lines
2218 bytes
2218 bytes
I have written in small app that uses dbase table to store small data.
Orinially this was written in Win 95 with 1st version of C++ Builder.
I recompliled this app. in C++ Builder 5 in XP and when I try to run it I
receive following error message.
"Access violation at address 77C47EFB in module 'msvcrt.dll'. Read of
address 00000000."
When I run it in debugger. The error occurs on the main form during it's
creation in following line:
Application->CreateForm(__classid(TMyProj), &MyProj);
In the debugger I receive following error message:
"Project MyProj.exe raised exception class EAccessViolation with message
'Access violation at address 77C47EFB in module 'msvcrt.dll'. Read of
address 00000000.' Process stopped. Use Step or Run to continue"
I am lost and I really don't know why this error is occuring. One thing I
noticed I am receiving warning during compile on following code line:
#pragma hdrstop
Once I comment that line out then warning goes away.
It's been sometime since, I coded using CppBuilder and I am lost and can't
figure out why this error is occuring. Please help.
You may send directly reply or cc to me at spatelone@yahoo.com
Thank you,
Sanjay Patel
Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
Author: Hans Galema
Date: Sun, 25 Jun 2006 07:52
Date: Sun, 25 Jun 2006 07:52
17 lines
1603 bytes
1603 bytes
Sanjay Patel wrote: > Application->CreateForm(__classid(TMyProj), &MyProj); > > In the debugger I receive following error message: > > "Project MyProj.exe raised exception class EAccessViolation with message > 'Access violation at address 77C47EFB in module 'msvcrt.dll'. Read of > address 00000000.' Process stopped. Use Step or Run to continue" Are you using FormCreate()/FormDestroy() ? If so then stop doing that. Move respective code to the constructor/destructor. You might first try however to set OldCreateOrder to true; Hans.
Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
Author: Sanjay Patel
Date: Mon, 26 Jun 2006 06:34
Date: Mon, 26 Jun 2006 06:34
111 lines
3584 bytes
3584 bytes
Hans,
Yes, I am still using FormCreate to create my form. I tried both of your
suggestion and unfortunately problem still exist. My main code to create
form is as below:
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#pragma hdrstop
//---------------------------------------------------------------------------
USEFORM("customer.cpp", CustInfo);
USERES("custproj.res");
USEFORM("ScanSetup.cpp", ScanSetupFrm);
//---------------------------------------------------------------------------
WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int)
{
try
{
Application->Initialize();
Application->CreateForm(__classid(TCustInfo), &CustInfo); // <---- This line
has problem and I receive error message.
Application->CreateForm(__classid(TScanSetupFrm), &ScanSetupFrm);
Application->Run();
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
}
When I trace in debugger by stepping into code by "F7" then the following
line in "Forms.cpp" creates the exception.
procedure TApplication.CreateForm(InstanceClass: TComponentClass; var
Reference);
var
Instance: TComponent;
begin
Instance := TComponent(InstanceClass.NewInstance);
TComponent(Reference) := Instance;
try
Instance.Create(Self); //<--- This lines creates Exception
except
TComponent(Reference) := nil;
raise;
end;
Any other suggestion or help will be great! Can I use older version of
MSVCRT.DLL and put it in home directory where my *.exe is residing? Will
then my *.exe use that old MSVCRT.DLL?
Thank you,
Sanjay Patel
=================================================================================================
"Hans Galema" <notused@notused.nl> wrote in message
news:449e41d6@newsgroups.borland.com...
> Sanjay Patel wrote:
>
>> Application->CreateForm(__classid(TMyProj), &MyProj);
>>
>> In the debugger I receive following error message:
>>
>> "Project MyProj.exe raised exception class EAccessViolation with
>> message 'Access violation at address 77C47EFB in module 'msvcrt.dll'.
>> Read of address 00000000.' Process stopped. Use Step or Run to continue"
>
> Are you using FormCreate()/FormDestroy() ?
>
> If so then stop doing that. Move respective code to the
> constructor/destructor.
>
> You might first try however to set OldCreateOrder to true;
>
> Hans.
Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
Author: Hans Galema
Date: Mon, 26 Jun 2006 11:36
Date: Mon, 26 Jun 2006 11:36
34 lines
2072 bytes
2072 bytes
Sanjay Patel wrote:
> Yes, I am still using FormCreate to create my form. I tried both of your
> suggestion and unfortunately problem still exist. My main code to create
> form is as below:
> Application->CreateForm(__classid(TCustInfo), &CustInfo); // <---- This line
> has problem and I receive error message.
Well that is not your code. That is code generated by the IDE.
I meant that you do not use
void __fastcall TCustInfo::FormCreate(TObject *Sender)
{
// your initialisationcode
}
but place that initialisationcode in the constructor:
__fastcall TCustInfo::TCustInfo(TComponent* Owner)
: TForm(Owner)
{
//initialisation code
}
To debug your project: outcomment all code in the constructor
and see if you still get the error.
By the way: How did you start the bcb5 project? Did you let
it automatically convert the .mak/.prj file ? If so then that was
the wrong way. Start a new project and add all the units manually.
Hans.
Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
Author: Sanjay Patel
Date: Fri, 07 Jul 2006 06:08
Date: Fri, 07 Jul 2006 06:08
43 lines
2448 bytes
2448 bytes
Hans,
I created new project under C++ Builder 5 and added one form at a time. Now
the error has moved somewhere else but it is still happening. I am so lost
I don't know what to do.
Any other idea.
"Hans Galema" <notused@notused.nl> wrote in message
news:449fc805@newsgroups.borland.com...
> Sanjay Patel wrote:
>
>> Yes, I am still using FormCreate to create my form. I tried both of your
>> suggestion and unfortunately problem still exist. My main code to create
>> form is as below:
>
>> Application->CreateForm(__classid(TCustInfo), &CustInfo); // <---- This
>> line has problem and I receive error message.
>
> Well that is not your code. That is code generated by the IDE.
>
> I meant that you do not use
>
> void __fastcall TCustInfo::FormCreate(TObject *Sender)
> {
> // your initialisationcode
> }
>
> but place that initialisationcode in the constructor:
>
> __fastcall TCustInfo::TCustInfo(TComponent* Owner)
> : TForm(Owner)
> {
> //initialisation code
> }
>
> To debug your project: outcomment all code in the constructor
> and see if you still get the error.
>
> By the way: How did you start the bcb5 project? Did you let
> it automatically convert the .mak/.prj file ? If so then that was
> the wrong way. Start a new project and add all the units manually.
>
> Hans.
Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
Author: Hans Galema
Date: Fri, 07 Jul 2006 08:54
Date: Fri, 07 Jul 2006 08:54
13 lines
1461 bytes
1461 bytes
Sanjay Patel wrote: > I don't know what to do. > > Any other idea. > "Hans Galema" <notused@notused.nl> wrote in message >>To debug your project: outcomment all code in the constructor >>and see if you still get the error. You did not comment on that suggestion. Hans.
Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
Author: Sanjay Patel
Date: Wed, 12 Jul 2006 05:48
Date: Wed, 12 Jul 2006 05:48
23 lines
1710 bytes
1710 bytes
Hans, Thanks for your help. I ended creating brand new project under C++ 5 and re-added everything manuall and it is working now. Thank you Sanjay T. Patel "Hans Galema" <notused@notused.nl> wrote in message news:44ae2280$1@newsgroups.borland.com... > Sanjay Patel wrote: > >> I don't know what to do. >> >> Any other idea. >> "Hans Galema" <notused@notused.nl> wrote in message > >>>To debug your project: outcomment all code in the constructor >>>and see if you still get the error. > > You did not comment on that suggestion. > > Hans.
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