|
Can you post the value of hr?
Also the CLSIDs are different in both your cases. Please ensure that both these classes suport IUpdateServiceManager.
If the requested interface is not supported, hr should be equal to E_NOINTERFACE.
Have a great day ahead!
Regards,
Sohail Kadiwala
(My Blog - http://blogs.wdevs.com/sohail/[^])
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thank you for concern.
The value of hr is -2147221231
Have a good day!
|
|
|
|
|
In the debugger, type this into the watch window: "hresult,hr". Assuming that hresult is the variable holding your error code, the debugger will present a human readable form, if there is any. Otherwise, please do the people here a favor, and present your error codes in the forum, using the hexadecimal form.
|
|
|
|
|
Can anyone tell me what this macro is meant for, and where I should use it.
Thanks
|
|
|
|
|
|
:-OHi, all experts:
I tried to create a COM local server and a client using win32 console application winzard in VC++ 6. When the client started up, it active the server automatically. The client also connected to server and called interface functions successfully. But, how can I terminate the server from client, before the client ended itselt?
Thanks a lot!
REMY
|
|
|
|
|
With COM objects you shouldn't need to take any explicit action to terminate the server beyond the normal reference counting calls to AddRef and Release you (and/or your smart pointers) do on the object's interfaces.
Steve
|
|
|
|
|
Yes. I wrote the 'Release' member for COM SEVER just as following:
ULONG CExeComServerConsole0_0::Release()
{
long nRefCount = InterlockedDecrement(&m_nRef) ;
if (nRefCount == 0)
delete this;
return nRefCount;
}
But, How can I teminate the server process?
|
|
|
|
|
Ok, you’re talking from the point of view of implementing the server, that wasn't clear in your post. Typically a global reference count is maintained which all implemented COM object increment when they're constructed and decrement when they're destructed. IClassFactory::LockServer also increments or decrements it based on its parameter - References on class factories should not influence this count. When the count transitions to zero the server typically wait for a timeout - If there is no activity and the timeout expires CoSuspendClassObjects is called and we arrange for the application to exit. In short it's complicated. Use ATL and you don't have to worry about any of this.
Steve
|
|
|
|
|
Thank you! Steve
I wanted to know more about the auto-ending of Server. I created a ATL EXE COM SERVER and used a client to conneted and disconnected it. After a moment, in system process list, the ATL EXE process disappeared. But, I didn't know when the CoSuspendClassObjects was called. Could you tell me more details. I'm learning COM/ATL. Thank you very much!
Sincerely
REMY
|
|
|
|
|
Need help with passing a BYTE array in COM.
I think i have done it right but i only get the first byte passed.
Here is the idl:
interface ICOMtestObject : IUnknown
{
[id(1), helpstring("method GetData")] HRESULT GetData([out]ULONG *sz,[out,size_is(,*sz)]BYTE **data);
};
Here is the implementation in the COM server:
STDMETHODIMP CCOMtestObject::GetData(ULONG *sz, BYTE **data)
{
// TODO: Add your implementation code here
*data = (BYTE*)CoTaskMemAlloc( 5 * sizeof( BYTE));
(*data)[0]='T';
(*data)[1]='e';
(*data)[2]='s';
(*data)[3]='t';
(*data)[4]='\0';
*sz=5;
return S_OK;
}
Here is the implementation in the client:
HRESULT hr = m_objPtr.CoCreateInstance(L"Comtest.COMtestObject.1");
ULONG sz;BYTE *data;
hr = m_objPtr->GetData(&sz,&data);
The data array includes only the first byte.
Here are some sample code
http://forums.devx.com/attachment.php?attachmentid=1036
|
|
|
|
|
As i can see, you want to pass a string, right ? Why don't use a "COM-String" ?
[id(1), helpstring("method GetData")] HRESULT GetData([out, retval]BSTR* data);
If you want to pass a "real" array, why don't you use a "COM-Array" ?
[id(1), helpstring("method GetData")] HRESULT GetData([out, retval]SAFEARRAY* data);
|
|
|
|
|
Hello Johan,
Since your interface is non-Automation-compatible, did you build the corresponding Proxy/Stub DLL ?
I downloaded your source codes and did not notice any projects for a Proxy/Stub DLL.
This is necessary especially since your COM server is an EXE. I'm surprised that your client code can even successfully call GetData().
Best Regards,
Bio.
|
|
|
|
|
My mistake i forgot to compile the proxy-stub.
Thanks
|
|
|
|
|
Is there any difference of running web services in VS 2003 and 2005......
in VS 2003 i added my webservice through "add reference".
so iam getting Service class not found message...
Pllllz help me.......
Rgds
Suresh
|
|
|
|
|
Dear all,
Help! I want to do DCOM (ServicedComponent), but when I install the application proxy, it failed.
Can anyone help? I'm desperate now!
Thanks!
David Chan
|
|
|
|
|
How do I change the UUID of an existing ActiveX component? I have made a little changes to the component to add a few more functionalities. I now want to assign a new UUID to this control. How do I do this?
Regards,
Aljechin Alexander
|
|
|
|
|
I don't know of any way to do that through the IDE etc, but I think you can change it by hand:
First, create a backup of the entire project.
1- Create a new similar ActiveX component. Add a similar New ATL Object to it. Do not compile it.
2- Open both the new and old .IDL files and change every occurence of the old similar IDL 's GUID 's with the new ones.
3- Open both the .RGS files, and change all similar GUID 's with the new ones.
There may be easier ways. This is just one of them.
this is this.
|
|
|
|
|
hello all,
I am trying to write a C++ code for importing(taking) mails from MSOUTLOOK
using MAPI functions.I use the fuction PR_BODY_W for gewtting the HTML
mail body but it doesn't works so i use GETHTMLBODY() instead.Thus i
got the HTML mails correctly.
But the problem is that i used PR_HASATTACH,
PR_ATTACH_FILENAME_W,PR_ATTACH_TAG for getting attachments.But i am not
getting attachments correctly.some pictures (mails in msoutlook) are
taken here as attachments(in msoutlook it is not shown as attachments)
and is displaying one after another in my application. please give me
suggestion for getting the mails correctly or please help me by giving
a sample code(using MAPI) for getting(importing) mails from msoutlook.
regards,
Alex
|
|
|
|
|
What does the below line mean?
CCheckPoint():m_cRef(0), m_pConnection(NULL){}
where
CCheckPoint is a class,
m_cRef is ULONG,
m_pConnection is IConnectionPoint*
Can anyone help me in understanding what the bove code means?
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
That code seems to be the constructor. It initializes m_cRef to 0 and m_pConnection to NULL.
|
|
|
|
|
I think it is initializing the variables:
It should be equal to:
CCheckPoint::CCheckPoint()<br />
{<br />
m_cRef = 0;<br />
m_pConnection = NULL;<br />
}
this is this.
|
|
|
|
|
|
hi
what iam tring to do is iam trying to create tool that closely resembles the working of DbgView .
The way the DbgView tool works is:
You can launch the tool on the system.
OutputDebugString() is a Win32 API. If you use that API in your program, the output will then be shown on DbgView.
SO using this functionality i want to use OutputDebugString() in my client applications and i want the output(string in OutputDebugString()) to be shown in servers GUI.
CAn u suggest me how to proceed.
Thanks in Advance
abhi
|
|
|
|
|
Hi!
we have the following situation:
an old MFC-app (built with VC++6.0) loads a regular MFC Dll (built with
VC++.NET), which loads several MFC extension Dlls (built with
VC++.NET).
one of the extension Dlls creates a frame-window,
another one uses a CHtmlView within a docking pane.
we dont use the document/view architecture.
we dont have sources for the old MFC-app, just a Dll-interface.
when I shutdown the app, it takes more than 1 minute till the CHtmlView
object gets destroyed. during this time our app is frozen.
I figured out, that it is the call m_pObject->SetClientSite(NULL)
within the COleControLSite dtor, which is lasting that long.
when we load the extension-Dlls from within an new MFC-app (built with
VC++.NET), everything works fine.
any help on how to solve this would be greatly appreciated,
thanx in advance!
regards,
Hans
|
|
|
|