Article View: borland.public.cppbuilder.migration
Article #167Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem.
From: 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.
Technical Details
Message-ID:
<449f7fe1$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!news.code-werk.net!open-news-network.org!news.soft-gems.net!reader.uucp.at!feeder02.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mailReferences:
<449de457$1@newsgroups.borland.com> <449e41d6@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 110f51,ed557c1baf67d36a X-Google-Attributes: gid110f51,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Sanjay Patel" <spatelone@yahoo.com> Newsgroups: borland.public.cppbuilder.migration References: <449de457$1@newsgroups.borland.com> <449e41d6@newsgroups.borland.com> Subject: Re: Win 95 to Win XP and from 1st C++ Builder to C++ Builder 5 porting problem. Date: Mon, 26 Jun 2006 02:34:09 -0400 Lines: 113 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.2869 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2869 NNTP-Posting-Host: 72.149.65.254 Message-ID: <449f7fe1$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1151303649 72.149.65.254 (25 Jun 2006 23:34:09 -0700) Path: arc1-ca.pugleaf.net!g2news2.google.com!news4.google.com!news2.volia.net!newsfeed01.sul.t-online.de!newsfeed00.sul.t-online.de!t-online.de!newsfeed.freenet.de!news.code-werk.net!open-news-network.org!news.soft-gems.net!reader.uucp.at!feeder02.uucp.at!newsfeed.uucp.at!news.uucp.at!newsgroups.borland.com!not-for-mail