|
You never let go of those damn categories do you?
--
Please state the nature of your medical emergency.
|
|
|
|
|
>> Is it OK to have a different GUID, but the same interfaces(methods, properties)?
yes, that's a "key intention" of COM.
>> What is the most transparent way of making object C load a different implementation (A or B) depedning on which one it needs?
using a CLSID or ProgID of the component to load.
The "perfect COM way" would be to create your own COM Category (the UUID for this one is called CATID), and register "all possible" COM servers under this category. This way C could enumerate the components it has available to work with on the current machine.
Auch den Schatten will ich lieben weil ich manchmal lieber frier' Rosenstolz [sighist]
|
|
|
|
|
We do it via progid. When the user chosses which integration module to use via the settings UI, the progID of that component is stored in the registry. When it comes the time to create A or B ( or up to F in our cases) the progid is read, and the component is instantiated using it.
|
|
|
|
|
I think that it depends on when your object C would know about some criteria.
The best solution is a Moniker like "C:A" or "C:B" or "C:criteria". When this Moniker will be bound, he is possible to return the appropriate object A or B. On VB-client: Set o = GetObject("C:xxx"), on C-client: CoGetObject("C:xxx",IID_Ix, &px); But there is no any real C object.
If you wish to have the real C object, then you can derived objectC-class from your known interface Ix and realize all of his methods to delegate simply these calls to some A_or_B object. For example
class objectC : public Ix ...
{
CComPtr<Ix> m_A_or_B;
...
STDMETHODIMP IxMethod(...params...)
{
if( m_A_or_B )
return m_A_or_B->IxMethod(...params...);
return E_UNEXPECTED;
}
};
m_A_or_B object can be created by COM common way through the criteria.
With best wishes,
Vita
|
|
|
|
|
Hi,I donot think it is a question.
First ,you should know some concepts.
Interface means the assembly of a bunch of functions.It is not an object.One Interface has one UUID called as IID_XXX.
CoClass stands for object which implements some interfaces.One CoClass has one UUID called as CLSID_XXX
Library looks like a DLL or EXE file.One library can contains and exporses one or more CoClass.
So the solutions of your question can be like the followings:
No.1
You create a library "La",which contains two coclasss
coA and coB,which both implements the interface Interace0.In your application you can create object coA or coB then query their's interface0 to execute some method.
No.2
You can create two library "La" and "Lb",which contains coA and accordingly.the following steps is same to No1
SORRY My poor words.
SIMPLE IS BEAUTY
|
|
|
|
|
I get an RPC Server Unavailable (800706ba) on some NT4 Servers when calling it this way:
CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE, RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);
Any ideas what might be causing this to fail?
Jason Henderson start page articles "If you are going through hell, keep going." - Sir Winston Churchill
|
|
|
|
|
BSTR, CComBSTR, CString, CStringT, char, TCHAR, LPCSTR, LPSTR, UCHAR, ..., ..., ...
Why so may God damn types? I hate working with all of them! You want to use one type, but you always end up having to use a zillion types because of all those functions that takes a different type all the time!
Perhaps I don't understand them well enough to appreciate them, anyone could direct me to some documentation or something? I mostly have problems with conversions and I'd like to learn more about string type so I can actually understand what I'm doing!
Is there one particular type I should use with COM/ATL that is easier to work with?
One ring type to rule them all!
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
Hehe! Well I could say to use _bstr_t but now you will complain that you want the string manipulation functions, right? Stay with CComBSTR and/or CString .
Good luck.
ÿVOTD:10 "But the angel said to them, "Do not be afraid. I bring you good news of great joy that will be for all the people. 11Today in the town of David a Savior has been born to you; he is Christ the Lord."" - Luke 2:10-11
|
|
|
|
|
ANSI vs. Unicode, the additional COM BSTR's that rely on a separte allocator, All their wrapper classes, separate typedefs for constant and non-constant strings, the cool MFC CString class, the (academically) well designed STL string class (that came much to late to become standard).
That's life in C++.
Now, if we have a look at VBasic, with one type to rule them all, you have a type free variable that holds a string without member functions (internaly a BSTR), and a string with member functions (internally some VB String object). It's even worse of a PITA.
Auch den Schatten will ich lieben weil ich manchmal lieber frier' Rosenstolz [sighist]
|
|
|
|
|
In case you are still wondering there is a really good article posted on this site about the different string types (at least for a basic understanding).
http://www.codeproject.com/string/CPPStringGuide1.asp
Give it a try!
|
|
|
|
|
error MIDL2025 : syntax error : expecting a type specification near "IMessage"
for this:
__interface IMAPIAdmin : IDispatch
{
[id(1), helpstring("method Logon")] HRESULT Logon([in] ULONG ulUIParam, [in] BSTR strProfileName, [in] BSTR strPassword, [in] ULONG flFlags);
[id(2), helpstring("method GetMessage")] HRESULT GetMessage([in] BSTR strEntryID, [out,retval] IMessage** ppIMessage);
};
---------------
Concentrating on Ideas
http://www.edovia.com
|
|
|
|
|
Looks like it needs the IMessage declaration.
Usually you import a separate idl (#include "IMessage.idl"), or directly from a tlb (#import "mylib.tlb").
sometimes it helps to look at the IL generated code
a MS guy on develop.com "answering" .NET issues
|
|
|
|
|
Is there anyway to package an ActiveX control to be used in a browser (IE) by a user without system administration rights?
i.e. register the ActiveX control, without though you do not have administration rights on NT/Win2K/XP machines?
Best regards,
Paul.
Jesus Christ is LOVE! Please tell somebody.
|
|
|
|
|
You may do that at least on W2K and XP (don't know for XPNT) by by creating manually the registry keys needed by registering under HKCU\Software\Classes instead of HKLM.
HTH,
The one who isn't misanthropist when 40 years old never loved human kind
Qui n'est pas misanthrope à 40 ans n'a jamais aimé les hommes
Nicolas De Chamfort (1740-1793)
|
|
|
|
|
Hi all,
I have a project where I sink onmouse move events on all html documents in a web page. However, there are cases when the mouse movements are not trapped. Maybe I'm missing something in my code...?
Also, I would like to unadvise my sinks in a proper way... Web pages these days can be so complicated with scripts, frames, IFrames and stuff so there are probably even more things I'm missing when unadvising the event sinks.
So, to my question, has anyone done a project like this before? If so, are you willing to share some of your experience with it... either here or by mail.
Thx,
/Tommy
|
|
|
|
|
Hi all,
I am building a Shell Namespace extension and am having trouble refreshing the folder tree view required when I add/delete nodes.
Some background info:
I am adding/deleting nodes to a backend tree/composite object structure and am using a refresh to refetch the required data to display in the namespace (ie an MVC approach). I am able to refresh the list view pane, however the Folder list in the TreeView does not update. I have tried playing with the SendMessage (a VK_F5 keystroke etc) to the tree control to try and force a refresh of the screen, without success. Manually pressing F5 or View->Refresh does refresh the screen correctly.
I have also tried browsing to the node (and also the parent) but had no luck.
// select the same folder to refresh the view.
UINT wFlags = 0;
wFlags = SBSP_SAMEBROWSER | SBSP_RELATIVE;
pShellBrowser->BrowseObject(NULL,wFlags);
So my question is how can I programatically force the equivalent of a F5 refresh.
I am new to namespace extensions so please be gentle
Thanks
David
|
|
|
|
|
Have you tried ::SHChangeNotify( ) ??
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Thanks for your reply. I gave it a go, the function returned ok but did not refresh the control
Thanks,
David
|
|
|
|
|
have looked through all the postings on this website and no one seems to have a reasonable answer to the question of using a container and microsoft word. And I am going to post the question, hopefully someone will have a useful idea. I am using VC++ 6.0 and I am trying to create a COM exe or dll. This is what I am doing: I am creating a frame window and automatically opening an ms word document so basically, it is a container window for microsoft word. This part I can get to work but there are some problems. Why are there several toolbar buttons disabled? How can I enabled them? Why does the print/print preview not work? I am not using ATL (and I prefer not too). Also, if I add a menu option of my own, how do I know when the user has selected my menu option? I have researched this through this website and MSDN and I am doing everything that was suggested. But it still isn't working. I have seen similar posting but all the answers have been things like "have you tried to record a macro through VB." and such, things that really don't help. CAN ANYONE OUT THERE HELP ME??????? IS THIS AN INFINITE PROBLEM THAT ONLY MICROSOFT CAN SOLVE??????? IS IT HOPELESS????
|
|
|
|
|
I need to add an Outlook toolbar to a .NET form? Does .NET come with such a feature? If not is there a free way to do this or must a component be purchased? If a componentmust be purchased does anyone recommend one for C++ .NET forms?
Many Thanks,
Derek
|
|
|
|
|
You've got Genghis[^], and Magic library[^].
I am not pretty sure about your exact needs, but these are two good entry points.
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
Hi,
I have a project that I originally developed using VC6.0. In this project I have an Automation class. I use JavaScript to create the Automation object e.g. var a_Startup = new ActiveXObject("FFSDED.FFCom"). Well, in VC6, the code ran fine, my javascript object could access all of my IDispatch functions inside of the Automation class. Now, we are trying to recreate the project in VS.net, but the javascript can't create the automation object anymore. It doesn't seem like the code we used in the VC6 to register the Automation object works anymore. Has anyone seen anything like this before?
Thanks.
|
|
|
|
|
To make sure it's not a simple security problem (for instance ActiveX scripting is not enabled), just test this code snippet :
var xmldoc = new ActiveXObject("Msxml2.DOMDocument");
xmldoc.async = false;
xmldoc.load("someData.xml");
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
Yeah, that wasn't my problem, thanks though.
|
|
|
|
|
I am considering using monitors for a new project I was assigned. Does anyone have any experience with monikers and the ROT? I would like hear common problems/suggestions/feelings and advice. This is very important for me, so I will really appriciate your feedback. I will be using VC++ 6.0 on Win2k.
Thanks,
James Pullicino
Drinking In The Sun
Forgot Password?
|
|
|
|