Board index » cppbuilder » Access violation with clientdataset

Access violation with clientdataset


2004-06-04 03:35:10 AM
cppbuilder29
Hello, guys
I'm having a problem with my ActiveX application, which causes an access
violation in the OnCreate event (main Form). It happens when the function
ClientDataSet->CreateDataSet() is called. The access violation only happens
if that function is called in the OnCreate event. If it is called in the
OnShow event, for example, it doesn't happens. Can anybody help me?
Regards,
=======================
Júnior B. Dymow
Software Design
Specto Painéis Eletrônicos
XXXX@XXXXX.COM
=======================
 
 

Re:Access violation with clientdataset

"Júnior B. Dymow" < XXXX@XXXXX.COM >wrote:
Quote
I'm having a problem with my ActiveX application, which causes an access
violation in the OnCreate event (main Form). It happens when the function
ClientDataSet->CreateDataSet() is called. The access violation only happens
if that function is called in the OnCreate event. If it is called in the
OnShow event, for example, it doesn't happens. Can anybody help me?
Ah, this is VCL based ActiveX control?
You know that OnCreate() and OnDestroy() are called when the object is
invalid, don't you. That you shouldn't use them, but instead use the
constructor and destructor like the good Bjarne intended?
Alan Bellingham
--
Team Thai Kingdom
<url:www.borland.com/newsgroups/>Borland newsgroup descriptions
<url:www.borland.com/newsgroups/netiquette.html>netiquette
 

Re:Access violation with clientdataset

"Júnior B. Dymow" < XXXX@XXXXX.COM >wrote in message
Quote
I'm having a problem with my ActiveX application, which
causes an access violation in the OnCreate event (main Form).
You should not be using the OnCreate event to begin with. Use the
constructor instead.
Gambit
 

{smallsort}

Re:Access violation with clientdataset

Hello Júnior,
As mentioned on the other replies - OnCreate & OnDestroy events are not safe
in C++. In case you're interested in some details, you may check out the
following link:
www.bcbdev.com/articles/suggest.htm
It touches on the issue of OnCreate. However, the problem extends to other
areas as well.
Hope the above is helpful.
Regards,
Bruneau.
"Júnior B. Dymow" < XXXX@XXXXX.COM >wrote in message
Quote
Hello, guys

I'm having a problem with my ActiveX application, which causes an
access
violation in the OnCreate event (main Form). It happens when the function
ClientDataSet->CreateDataSet() is called. The access violation only
happens
if that function is called in the OnCreate event. If it is called in the
OnShow event, for example, it doesn't happens. Can anybody help me?

Regards,
=======================
Júnior B. Dymow
Software Design
Specto Painéis Eletrônicos
XXXX@XXXXX.COM
=======================


 

Re:Access violation with clientdataset

Ok. I'm not using the OnCreate event anymore, and it seems that the problem
has been resolved.
Thanks to everybody.
Jr
"Jean-Marie Babet" < XXXX@XXXXX.COM >escreveu na mensagem
Quote
Hello Júnior,

As mentioned on the other replies - OnCreate & OnDestroy events are not
safe
in C++. In case you're interested in some details, you may check out the
following link:

www.bcbdev.com/articles/suggest.htm

It touches on the issue of OnCreate. However, the problem extends to other
areas as well.

Hope the above is helpful.

Regards,


Bruneau.


"Júnior B. Dymow" < XXXX@XXXXX.COM >wrote in message
news: XXXX@XXXXX.COM ...
>Hello, guys
>
>I'm having a problem with my ActiveX application, which causes an
access
>violation in the OnCreate event (main Form). It happens when the
function
>ClientDataSet->CreateDataSet() is called. The access violation only
happens
>if that function is called in the OnCreate event. If it is called in the
>OnShow event, for example, it doesn't happens. Can anybody help me?
>
>Regards,
>=======================
>Júnior B. Dymow
>Software Design
>Specto Painéis Eletrônicos
> XXXX@XXXXX.COM
>=======================
>
>