|
Exactly, the following code succesfully compiles on my system
Private Sub Command1_Click()
Dim obj As Object
Set obj = CreateObject("George.George")
End Sub
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
|
|
|
|
|
Thanks CPallini,
My question is answered! You are so knowledgeable! Cool!!
regards,
George
|
|
|
|
|
George_George wrote: once we inherit from IDispatch interface, then it is always a dual interface, right?
why u said so.
George_George wrote: What type of implementation in C++ for a component is not a dual interface? I can not imagine a sample
I think ur confusion is once derived from IDispatch in C++, u have access through vtbl (atleast of IDispatch) and also through Invoke(), dual implicit and why u need dual keyword. Is it?
|
|
|
|
|
Yes Rajkumar,
Rajkumar R wrote: I think ur confusion is once derived from IDispatch in C++, u have access through vtbl (atleast of IDispatch) and also through Invoke(), dual implicit and why u need dual keyword. Is it?
Sometimes I notice that the component actually implements the dual interface, but in the IDL file, "dual" property is not added to the interface property.
1. Is it good practice?
2. What is the purpose of doing so? Force user to use IDispatch other than efficient vtable?
3. Could we use vtable even if dual property is not added to interface? For example, using QueryInterface to get come component interface (other than IDispatch and IUnknown)? If we could, then it is a dual interface activity -- invoking through vtable.
regards,
George
|
|
|
|
|
yes!! I guessed correctly, u misunderstood the concept of dual interface in OA.
direct vtable-based interfaces as u expect are called "custom interfaces" and invocation through IDispatch are called "automation" or "dispatch interfaces" the "custom interfaces" may need to be accessed after a query interface and may needs custom marshalling. Dual iterfaces can be accessed without a query interface and gets standard marshalling support like dispatch interfaces.
a comparison of these 3 interfaces is here [^]
|
|
|
|
|
Thanks Rajkumar,
Sorry that I may not made myself understood. My question is, if I do not declare the interface as dual in IDL file, but actually in implementation, I implemented the dual approach.
Could the client of the component (e.g. in case of C++ client) utilize vtable other than through IDispatch?
regards,
George
|
|
|
|
|
George_George wrote: but actually in implementation, I implemented the dual approach.
again, don't confuse it with "custom interface"
George_George wrote: Could the client of the component (e.g. in case of C++ client) utilize vtable other than through IDispatch?
yes, u can, use queryinterface and get ur "custom interface".
|
|
|
|
|
Thanks Rajkumar,
Seems the dual property does not enforce compile/link/runtime's strong checking about whether or not the component implements dual interfaces (if the component does not implement dual interface, and there will not be any compile/link/runtime error if component only implemeents IDispatch)? Right?
And similar to the situation when we do not add dual, compile/link/runtime does not enforce strong checking and gives warning or error message when client tries to use dual interface (both vtable and IDispatch), right?
regards,
George
|
|
|
|
|
Hi,
I need to compare two text files in VC++6.0, whose contents have been displayed in two richedit controls.Also i need to highlight the differences that exists in the two files......Can any one help me out?
|
|
|
|
|
|
What have you tried so far? Where are you stuck?
|
|
|
|
|
i have displayed the contents of the files in the richeditcontrols.I dont know how to compare the files and highlight the differences in them.The codes which i got by surfing the net just tell whether the files are equal or not.They just return an int or bool value.Here is the place i got struck.
|
|
|
|
|
I think it's rather a complex task. I don't think you will get the "code" here right away. You may have to look at the XDiff[^] project. Perhaps that would help you.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
My condolences. I had to do the exactly same thing some 5 years ago, and ended up with a post "I hate MFC" in the Lounge
Anyway, to find the differences between files, use Longest Common Subseqence Algorithm[^] - that would be the easy part.
Now, for displaying it in the richedit controls - good luck with that
|
|
|
|
|
How to check the instance of the class is valid or it is not especially in multi threaded program?
Best Regards,
Suman
|
|
|
|
|
rp_suman wrote: How to check the instance of the class is valid
What do you mean exactly ? Can you be more explicit please. What does 'valid' mean ?
|
|
|
|
|
Suman,
Plz give more deatils....what is actually men by 'valid'.
It will be better if u provide with some code fragment that u are using.....
Prasanth
|
|
|
|
|
HI,
Plz give more deatils....what is actually mean by 'valid'.
It will be better if u provide with some code fragment that u are using.....
prasanth
|
|
|
|
|
Hi Prasanth, you replied to the wrong person.
Maxwell Chen
|
|
|
|
|
Maxwell Chen wrote: you replied to the wrong person.
How dare you call Cedric a wrong person!
|
|
|
|
|
Rajesh R Subramanian wrote: How dare you call Cedric a wrong person!
Maxwell Chen
|
|
|
|
|
He might have meant different person,
Best Regards,
Suman
|
|
|
|
|
There's a thing called pun. And one more thing called "the joke icon".
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
For example, if we create some object using new() and call delete(), the object will be deleted.
I want to avoid the use of the object before new() and after delete().
Can we check like if(object != NULL) or else?
BTW:
Sorry for delay I posted just before leaving office, now seeing from my room.
Best Regards,
Suman
|
|
|
|
|
Yes, just set the pointer to NULL in your constructor and once you delete the object, just set it to NULL again.
|
|
|
|