|
|
Up |
|
|
  |
Author: peter.bootpeter.boot Date: Jun 11, 2008 18:19
A Newbie question
What is the correct way to create a public data member on an ATL class
whose value can be set from outside the class ?
I have created a Browser Helper Object and can call functions from
other classes but if I try to set the value of a public data member I
get an 'Access violation' error.
thanks
Peter
|
| |
|
| | 11 Comments |
|
  |
Author: Igor TandetnikIgor Tandetnik Date: Jun 11, 2008 19:51
> What is the correct way to create a public data member on an ATL class
> whose value can be set from outside the class ?
This depends on what you mean by "outside".
> I have created a Browser Helper Object and can call functions from
> other classes but if I try to set the value of a public data member I
> get an 'Access violation' error.
When you say "I can call functions from other classes", what do you mean
by "I"? The BHO calls methods on other classes? Something calls methods
on the BHO?
When you say "I try to set the value of a public data member", who is
"I" in this sentence, and whose data member this "I" tries to modify?
Best would be to show some code.
--
With best wishes,
Igor Tandetnik
|
| Show full article (1.08Kb) |
|
| | no comments |
|
  |
Author: peter.bootpeter.boot Date: Jun 11, 2008 20:16
On Jun 12, 12:51 pm, "Igor Tandetnik" mvps.org> wrote:
>> What is the correct way to create a public data member on an ATL class
>> whose value can be set from outside the class ?
>
> This depends on what you mean by "outside".
>
>> I have created a Browser Helper Object and can call functions from
>> other classes but if I try to set the value of a public data member I
>> get an 'Access violation' error.
>
> When you say "I can call functions from other classes", what do you mean
> by "I"? The BHO calls methods on other classes? Something calls methods
> on the BHO?
>
> When you say "I try to set the value of a public data member", who is
> "I" in this sentence, and whose data member this "I" tries to modify? ...
|
| Show full article (1.64Kb) |
| no comments |
|
  |
Author: peter.bootpeter.boot Date: Jun 11, 2008 20:34
On Jun 12, 1:16 pm, "peter.boot" gmail.com> wrote:
> On Jun 12, 12:51 pm, "Igor Tandetnik" mvps.org> wrote:
>
>
>
>> "peter.boot" gmail.com> wrote in message
>
>
>>> What is the correct way to create a public data member on an ATL class
>>> whose value can be set from outside the class ?
>
>> This depends on what you mean by "outside".
>
>>> I have created a Browser Helper Object and can call functions from
>>> other classes but if I try to set the value of a public data member I
>>> get an 'Access violation' error.
>
>> When you say "I can call functions from other classes", what do you mean
>> by "I"? The BHO calls methods on other classes? Something calls methods ...
|
| Show full article (2.02Kb) |
| no comments |
|
  |
Author: Igor TandetnikIgor Tandetnik Date: Jun 11, 2008 20:32
> A BHO , called CMyBHO is registering your example PassThru AAP in the
> CMyBHO::SetSite method.
> CMyBHO.h includes an external decration
>
> extern CMyBHO* g_MyBHO;
Note that in IE7 and up, if I remember correctly, a separate BHO
instance is created for each tab. But you only have one global variable
for the whole process.
> The CMyBHO has a public function CMyBHO::addHTMLChunk that can be
> successfully called from the CTestAPP::Read implemented in your
> example like this
>
> g_digiSelfBHO->addHTMLChunk(...)
>
> But if CMyBHO::addHTMLChunk sets the value of a variable declared
> after public : an "Access violation" is thrown
|
| Show full article (1.37Kb) |
| no comments |
|
  |
Author: peter.bootpeter.boot Date: Jun 11, 2008 21:10
On Jun 12, 1:32 pm, "Igor Tandetnik" mvps.org> wrote:
>> A BHO , called CMyBHO is registering your example PassThru AAP in the
>> CMyBHO::SetSite method.
>> CMyBHO.h includes an external decration
>
>> extern CMyBHO* g_MyBHO;
>
> Note that in IE7 and up, if I remember correctly, a separate BHO
> instance is created for each tab. But you only have one global variable
> for the whole process.
>
>> The CMyBHO has a public function CMyBHO::addHTMLChunk that can be
>> successfully called from the CTestAPP::Read implemented in your
>> example like this
>
>> g_digiSelfBHO->addHTMLChunk(...) ...
|
| Show full article (1.77Kb) |
| no comments |
|
  |
Author: peter.bootpeter.boot Date: Jun 11, 2008 21:14
On Jun 12, 2:10 pm, "peter.boot" gmail.com> wrote:
> On Jun 12, 1:32 pm, "Igor Tandetnik" mvps.org> wrote:
>
>
>
>> "peter.boot" gmail.com> wrote in message
>
>
>>> A BHO , called CMyBHO is registering your example PassThru AAP in the
>>> CMyBHO::SetSite method.
>>> CMyBHO.h includes an external decration
>
>>> extern CMyBHO* g_MyBHO;
>
>> Note that in IE7 and up, if I remember correctly, a separate BHO
>> instance is created for each tab. But you only have one global variable
>> for the whole process.
>
>>> The CMyBHO has a public function CMyBHO::addHTMLChunk that can be ...
|
| Show full article (2.11Kb) |
| no comments |
|
  |
Author: Igor TandetnikIgor Tandetnik Date: Jun 12, 2008 05:10
> The purpose of wanting to do it is to maintain a common variable to be
> set and referenced by successive instances of CTestSink & CTestAPP as
> an HTML page and it's elements downloads and is processed
What do you plan to do when there are multiple HTML pages downloading
simultaneously, either in different tabs on IE7, or in different frames
on the same page in all IE versions?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
|
| |
| no comments |
|
  |
Author: peter.bootpeter.boot Date: Jun 12, 2008 16:45
On Jun 12, 10:10 pm, "Igor Tandetnik" mvps.org> wrote:
>> The purpose of wanting to do it is to maintain a common variable to be
>> set and referenced by successive instances of CTestSink & CTestAPP as
>> an HTML page and it's elements downloads and is processed
>
> What do you plan to do when there are multiple HTML pages downloading
> simultaneously, either in different tabs on IE7, or in different frames
> on the same page in all IE versions?
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925 ...
|
| Show full article (1.35Kb) |
| no comments |
|
  |
|
|
  |
Author: Igor TandetnikIgor Tandetnik Date: Jun 12, 2008 18:50
> On Jun 12, 10:10 pm, "Igor Tandetnik" mvps.org> wrote:
>> What do you plan to do when there are multiple HTML pages downloading
>> simultaneously, either in different tabs on IE7, or in different
>> frames on the same page in all IE versions?
>
> Good question, quick & dirty solution I am intending on keeping an
> array of buffers indexed by the URL of the page. But I had in mind
> investigating threading functionality, is
> IInternetProtocolSink::Switch the correct place to look at to attempt
> that ?
To attempt what? I don't understand what you want to do.
--
With best wishes,
Igor Tandetnik
|
| Show full article (0.97Kb) |
| no comments |
|
|
|
|