In the documentation for TrackPopupMenu it says that:
TPM_LEFTBUTTON Causes the pop-up menu to track the left mouse button.
TPM_RIGHTBUTTON Causes the pop-up menu to track the right mouse button.
In the following code, changing TPM_LEFTBUTTON to TPM_RIGHTBUTTON does not change anything...
On page 85 of Don Box book, Essential COM, is a code like this:
STDMETHODIMP MyClass::UseIt(VARIANT var) {
VARIANT var2;
VariantInit(&var2);
VariantChangeType(&var2, &var, 0, VT_BSTR);
ustrcpy(m_szSomeDataMember, SAFEBSTR(V_BSTR(&var2)));
VariantClear(&var2);
}
I am wondering what happens if...
Can someone please explain to me what is the difference between true and TRUE and why we need both of them? There is also a Variant_true ( I probably have a spelling error in this last one) to futher complicate the issue.
Thanks
Yazster,
The DCOM server will exit if the reference count on it goes to zero. For this to work you have to be careful to call release for each advise. The scenario you are describing ( server exiting after few minutes, which I think is actually 2 minutes) is not meant to be normal operation...
I have a regular dll and try to link to it from a MFC dialog based project.
I get unresolved linker error due to the name mangling. I have a .def file in my dll project to export functions. I changed the name of the function ( it is a static function of the dll class drived from CWinApp)to the...
I have an ATL project, that uses MFC. If I link statically to MFC everything is fine, but if I set my project setting to use MFC in a shared DLL, then when I try to bring up a dialog, I fail with an Assertion failure. This is very similar to the problems in coding a dll where one has to use...
When using DCOM and client server on two separate machine, I can start the server in the debugger and set some break points. Then when I start the client, when client makes a request to the server, the server process stops at the break points and I can debug the server. The same procedure does...
When a COM call comes in, if the server is not running, COM will start the server. The server will die if no client is connected to it ( when the reference count is zero). Does your program do something that does not fit with this model?
Thank you for the responses. The dialog I am creating is a member of the class ( so, it is created on the stack.)All I am doing is calling m_dlg.Create() rather than DoModal to make it Non modal. It appears to me that I should not call delete on this dialog. I wonder if there is any problem in...
I started a simple dialog based project. On the dialog, there is a push button that when pressed brings up another dialog. I use the task manger to watch the memory used by my program. I bring up the second dialog by pressing on the push button and then close it. After I repeat this for few...
I have a client on one machine and server on another. I am logged in on both machine as the user. I am node Admin on both machines. I start the server on one machine and then the client on the other. Client can successfully call advise on the source interface of the server. But, if I don't start...
Because of the problems that I have with connection points and multiple threads. I read an article by microsoft that deals with connection points and multiple threading, but it covers only special cases. I like to implement my own connection point to be able to use it as I wish. And once there...
I thought about doing that, and to me, it sounds like it should work. But I never tried it. It sounds like there must be a solution that does not require strange and convoluted hacks that makes the code difficult to read and understand (and that is probably connection points. But what happens if...
Actaully both of the COM object that I have are singletons. But I think singleton does not work in this case. The reason is when server A starts, no instance of the COM object in the server A is instantiated. The COM (or actually ATL) obect is a template object and no object that inherits from...
I have two servers that talk to each other using DCOM interfaces. Although I probably should be using connection point for communication in one of the directions, I do not want to use connection points. Connection in both direction is done through regular com interfaces. Here is my problem:
1...
I have a COM server which contains a dialog box. When I start the server through CoCreateInstanceEx called by a client, the dialog box does not come up. I assume this behavior is caused by the fact that the object, started by the client, does not have access rights to the windows station. Deos...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.