|
What is RPC? How we implement that?
|
|
|
|
|
RPC = Remote Procedure Call.
How you implement it is up to you. You can use DCOM or CORBA a google search will give you tons of information on both of these RPC implementations
Forever Developing
|
|
|
|
|
Will anybody explain me the difference between COM and ATL
|
|
|
|
|
ATL is merely a template class library designed to make COM development easier or at least quicker - does most of the boilerplate code for you.
Kevin
|
|
|
|
|
Kevin McFarlane wrote:
ATL is merely a template class library designed to make COM development easier or at least quicker - does most of the boilerplate code for you.
Please Don't Mind,from whatever I know, Com is mere Specification and Win32api are Application program interfaces.
you can't treat Com and Win32 to MFc and ATL
|
|
|
|
|
hmm...
The same difference that is between programming in Platform SDK and MFC
ATL is a set of classes used to make COM Programming *easier* (some purists might disagree and call ATL Spaghetti programming)
hope this sheds some light on the subject, get a good book or read some articles
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
COM is a specification for creating binary reusable components.
To develop these components, You implement COM specification in a programming language like C,C++,JAVA,VB, etc
ATL is template library that helps you code/develop COM components faster. It uses Templates extensively.
I hope this helps
-------------------------
Have a great day ahead!
Regards,
Sohail Kadiwala
(My COM Blog - http://lovecom.blogspot.com)
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Hi,
I have an instance of a CTreeViewCtrl. I initialise it like so:
CTreeViewCtrl tree = GetDlgItem(IDC_TREE1);
I have set show "Check Boxes" to true for my tree in the resource editor and they are displayed. However when I add an item and then set the check state like so:
HTREEITEM item = tree.InsertItem(name, TVI_ROOT, TVI_LAST);
tree.SetCheckState(item, TRUE);
The change isn't shown in the GUI. Is there something else I have to do?
I am using VC7 and WTL 7.5 build 4291.
Thanks in advance.
|
|
|
|
|
This is a problem I remember having a while back, so I checked out some of my old code. I found this in one of my classes:
<br />
<br />
m_myTreeCtrl.ModifyStyle(TVS_CHECKBOXES,0);<br />
m_myTreeCtrl.ModifyStyle(0,TVS_CHECKBOXES);<br />
<br />
... later on in code ...<br />
<br />
m_myTreeCtrl.SetCheck(hTreeItem);<br />
<br />
Try using the ModifyStyle fix and see if it works for you.
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
That worked perfectly. Thanks a lot for that, it was giving me a real headache!
|
|
|
|
|
HI All,
My problem is related to the COM out-proc exe.
I have a COM server(EXE) which has 2 interfaces:-
ISingletonTest - This inteface acts like an entry point for the server.The component class is made singleteon by using the DECLARE_CLASSFACTORY_SINGLETON().This will be created only once.There is function getTest() in this interface which returns the pointer to second interface(ITest). Now as cllient only passes the uninitialized pointer of ITest , i make a call to CoCreateInstance() for intiliaizing the CTest component class.
The problem is when i call the function getTest(ITest *pVal) and i do some work and set this pointer to null it calls its destructor but it doesn't fress the main interface i.e ISingletonTest pointer.
As a result my out-proc exe never gets unloaded.
Ina nutshell could you explan why the module gets locked when i create a COM object in the process of my COM server.Is there any specific care to be taken care of while doing such programming.
Please provide your suggestions as soon as possible.I have strucked badly on this problem.
Thanks in advance.
Deepak
|
|
|
|
|
Having recently discovered the joys of STL, I have set about using it in my projects with gusto. I particularly like auto_ptr, but I have a newbie query. When I try and assign a new value to an auto_ptr, I am getting the following VC7 warning (I am using level 4):
warning C4239: nonstandard extension used : 'argument' : conversion from 'std::auto_ptr<_Ty>' to 'std::auto_ptr<_Ty> &'
For example:
std::auto_ptr<CMyClass> ap;
...
ap = std::auto_ptr<CMyClass>(new CMyClass);
However, the following code doesn't generate the warning:
std::auto_ptr<CMyClass> ap;
...
std::auto_ptr<CMyClass> new_ap(new CMyClass);
ap = new_ap;
Any clues how I can avoid this warning? Note that CMyClass might look something like:
class CMyClass
{
public:
...
CMyClass(void) { ... }
CMyClass(const CMyClass& o) { ... }
};
The Rob Blog
|
|
|
|
|
Welcome to the wonderful world of STL
As for std::auto_ptr , be sure to read this article[^] before using it - its copy semantic is "unusual" and it can cause problems. In fact, I prefer Boost smart pointers in my code - they are safer.
To try to answer your question, I believe you get the warning because the way assigment operator is declared in auto_ptr :
auto_ptr<_Ty>& operator=(auto_ptr<_Ty>& _Right) _THROW0()
{
reset(_Right.release());
return (*this);
}
As you can see, it takes a reference as the argument, not a const reference.
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
I keep hearing about Boost - and I must admit, not being able to use auto_ptrs in STL containers is a real shame.
So now's your chance to sell me Boost - what else am I missing out on apart from a better auto_ptr?
Any suggested hacks for my auto_ptr assignment issue?
The Rob Blog
|
|
|
|
|
Just found a solution thanks to your link - 'reset' does the trick - reset(new CMyClass).
The Rob Blog
|
|
|
|
|
|
Hi All,
I have been trying to create a toolbar for Windows Explorer, I used the Wizard provided by Eric and the basic thing was there. I have got a button on the toolbar I need to know which file or files were selected int the explorer view when the button was clicked.
for more calrification it is just like the standard buttons of copy and paste, when we select some file and press copy it gets the name of the file, same is the thing I want to perform.
I have tried using IWebBrowser2 and the use the get_Document method of it but I dont know what I would be doing further
regards
Muhammad Aftab Alam.
|
|
|
|
|
Hi
I have the following...
<br />
vector<HANDLE> handles;<br />
handles.push_back(CreateMutex(NULL , FALSE , "A"));<br />
handles.push_back(CreateMutex(NULL , FALSE , "B"));<br />
<br />
WaitForMultipleObjects(handles.size() , (const HANDLE*)(&handles) , TRUE , INFINITE);<br />
Basically, the Wait doesn't. I replaced the vectors with an array of handles
<br />
HANDLE handles[2];<br />
handles[0] = CreateMutex(NULL , FALSE , "A");<br />
handles[1] = CreateMutex(NULL , FALSE , "B");<br />
<br />
WaitForMultipleObjects(2 , handles , TRUE , INFINITE);<br />
and it works a treat. It's obviously me, I'm new to STL - I reckon it's the cast to the second param of WaitForMultipleObjects.
Thanks for any input...
Cheers
Angel1058
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
Try:
WaitForMultipleObjects(handles.size() , &handles[0], TRUE , INFINITE);
My programming blahblahblah blog. If you ever find anything useful here, please let me know to remove it.
|
|
|
|
|
Many thanks. Easy when you know how....and now I do.
Angel1058
*********************************************
The sooner you fall behind, the longer you have to catch up.
|
|
|
|
|
I have been tasked to update a WTL program. The program creates many modeless windows, the windows are created with style pop-up and the parent for the window is set to NULL in the create call. The main problem is the tabbing order on the modeless windows is not working. I have verified the VK_TAB message arrives in the main dialog(pretranslate message function) that created the modeless dialogs. How do I go about forwarding the message to the appropriate dialog, or is there a simpler solution to make the tabbing work? I have never had to work with the tabbing msgs before and it all seems a bit mysterious what is really going on.
TIA
|
|
|
|
|
Try something like this:
virtual BOOL PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_TAB)
return m_dlgChild.PreTranslateMessage(pMsg);
}
Then in your child dialog message handler you handle it.
Igor.
|
|
|
|
|
Each modeless window (I assume they're all dialogs?) should derive from CMessageFilter and override the PreTranslateMessage() method. The PreTranslateMessage() would do:
BOOL CYourWindow::PreTranslateMessage ( MSG* pMsg )
{
return IsDialogMessage ( pMsg );
} In each window's OnInitDialog() , register for pre-translate calls with:
CMessageLoop* pLoop = _Module.GetMessageLoop();
ATLASSERT(pLoop != NULL);
pLoop->AddMessageFilter ( this ); Look at the wizard-generated CMainFrame::OnCreate() if this part is still unclear.
--
I'm Michael Dunn and I approve this post.
Vote Trogdor in oh-four!
|
|
|
|
|
|
This is more of a visual studio problem than ATL/WTL, I suspect. I have a project that builds a COM client. When I try to open the .rc file, it tells me it can't open atlres.h, one of the include files. However, I can compile and build without any problem (the proper include directory is in the build path). Furthermore, if I edit the .rc file in the text editor and right-click atlres.h at the location of the include statement to try and open it, i get a error messagebox telling my it can't find the file and open it... BUT, it also displays the entire build path and that path includes the directory with atlres.h!!!!
Arg! What's going on? Why can't if find that file during editing, but it can during the compile?
Thanks for any thoughts,
Matt
|
|
|
|