|
Thank you from me as well
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Your welcome
Regards,
--Perspx
Don't trust a computer you can't throw out a window
-- Steve Wozniak
|
|
|
|
|
I don't see any 'please' in your post's title...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Does it necessary or no?
|
|
|
|
|
It's polite.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Title of his message is "Mark Salsbery", "cPallini" : PLEASE but I dont know he wants to serach about messages of Mark Salsbery and cPallini or he needs help of them?
|
|
|
|
|
He modified the title. It was originally "Mark Salsbery", "cPallini" : Answer me ...
Regards,
--Perspx
Don't trust a computer you can't throw out a window
-- Steve Wozniak
|
|
|
|
|
I really apologise for what I said and promise It won't happen again ...
I thank all you cool guys for your helps by now ...
|
|
|
|
|
Hello everyone,
I am confused about one simple concept of IUnknown when reading some code,
1. Every coclass component must implement IUnknown, but not a must that every interface (which the coclass component implements) must implement IUnknown;
2. Every interface of every coclass component must implement IUnknown.
Which one is correct?
thanks in advance,
George
|
|
|
|
|
Every interface of every COM component must implement IUnknown since every interface is required to support interface navigation via QueryInterface .
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini,
Cool! I think your option is you agree with my option 2. Then another question, suppose my component implements interface IX and IY, and both IX and IY will implement IUnknown, so will there be diamond problem?
regards,
George
|
|
|
|
|
George_George wrote: I think your option is you agree with my option 2.
Yes.
George_George wrote: Then another question, suppose my component implements interface IX and IY, and both IX and IY will implement IUnknown, so will there be diamond problem?
Nope (a coclass is not a C++ class).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks CPallini,
I think for the diamond issue I mentioned, you mean writing some code like this in my sample? The normal solution is providing one common implementation of AddRef/Release/QueryInterface in CFoo, so there is no diamond problem?
CFoo:IX, IY {
IX:IUnknown{}
IY:IUnknown{}
IUnknown{}
regards,
George
|
|
|
|
|
|
Thanks Hamid,
Looks like different from what CPallini said -- CPallini said every interface must implement IUnknown, but the wiki page mentioned every component must implement IUnknown -- "COM objects must minimally implement this interface"? I am confused.
Could you clarify please?
regards,
George
|
|
|
|
|
I think here[^] and here[^] are good articles for you.
|
|
|
|
|
Thanks Hamid,
What is your conclusion of my orignial question? You agree with my point 1 of point 2?
regards,
George
|
|
|
|
|
I have some memory leak in my code.
In my application i have some method that called every 5 seconds - and i found that my memory leak is in this method.
The leak increase the memory for 4kb every 5-10 seconds.
Attached the part of the code that i found that causing the memory leak.
void foo(const VARIANT FAR& Var1, const VARIANT FAR& Var2, const VARIANT FAR& Var3)
{
COleSafeArray SafeV1, SafeV2, SafeV3;
SafeV1 = Var1;
SafeV2 = Var2;
SafeV3 = Var3;
int iNumObjs = SafeV1.GetOneDimSize();
COleVariant vV1, vV2, vV3;
for ( long i = 0 ; i < iNumObjs ; i++ )
{
CString TempV1,Value;
SafeV1.GetElement(&i, &vV1);
TempV1 = vV1.bstrVal;
SafeV2.GetElement(&i, &vV2);
SafeV3.GetElement(&i, &vV3);
Value = vV3.bstrVal;
}
}
|
|
|
|
|
Try to change from:
COleVariant vV1, vV2, vV3;
for ( long i = 0 ; i < iNumObjs ; i++ )
{
CString TempV1,Value;
to:
for ( long i = 0 ; i < iNumObjs ; i++ )
{
COleVariant vV1, vV2, vV3;
CString TempV1,Value;
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Aleady try this and this is not helping to my mem leak ...
|
|
|
|
|
Strange, it should.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I know that its strange
|
|
|
|
|
I mean the origina posted code was wrong.
On the other hand, if you're still experiencing memory leaks, probably there's a problem elsewhere. Does the dump of the memory block give you any insight?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The place of the leak is there - i check it be return in the first line of the method - and its does not give me the leak.
the dump mem deos not help.
|
|
|
|
|
Why do you assume that all fo the three input arrays have the same size?
What do the arrays contain (i.e. what are the actual parameters of the call)?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|