|
Hi !
Thanks for answering, we did the same. we created proxy/stub dll and regeistered on both the machines. I would like to add one more query.
I build 3 COM Servers(as a service, exe, and dll). we tested all the three for their performance. when we fire number of requests from remote machins(approximatly 100 requests, 10 requests per process, like such there are 10 process makin requests), every type of server behaved differently. Exe type COM server took almost 1 min 40 sec. Service type COM Server took almost 1 min 42 sec(appro same as exe server). But DLL type COM server took only 16 Sec. How this has happend. Can you explain the working of all these remote servers....
Is the object shared by the clients?
- Malli... !
|
|
|
|
|
Need bit clarification..
How did you access the DLL from Remote machine,
Did you run as a Surrogate process in Remote server ?? or you registered(copied) the source DLL to client machine..
Thanks,
Siva Sankar
|
|
|
|
|
Hello Siva !
Actully I've registerd the proxy/stub dll. And using MMC-Component Services, I put that COM dll into COM Applications. this would make your COM dll to be used from remote machin. (this inturn make use of DLLHOST.exe as a surrogate). This is what the scenario....
-Malli...!
|
|
|
|
|
while (pEnumerator)
{
HRESULT hr = pEnumerator->Next(WBEM_INFINITE, 1,
&pclsObj, &uReturn);
if(0 == uReturn)
{
break;
}
VARIANT vtProp;
VariantInit(&vtProp);
hr = pclsObj->Get(L"Name", 0, &vtProp, 0, 0);
if(vtProp.bstrVal = "Alerter")
{
MessageBox(NULL,"AlerterService ",NULL,NULL);
}
wcout << vtProp.bstrVal << endl;
hr = pclsObj->Get(L"state", 0, &vtProp, 0, 0);
wcout << vtProp.bstrVal << endl;
}
iam using this code in an application using WMI .but when i compiling iam getting error
error C2446: '==' : no conversion from 'char *' to 'unsigned short *'
can u please suggest me how to overcome this problem
abhi
|
|
|
|
|
Hello Abhi !
One thing I noticed is that you put '=' instead of '==' in if condition. And if you wanna to convert a unsigned shor * to char *, there is a simple way using CComBSTR class:
CComBSTR tmp;
tmp.Append("SomeTextHereToAppend");
YourBSTRObject = SysAllocString(tmp.operator BSTR());
You can use YourBSTRObject to compare with another BSTR object. that will help to avoid this conversion while comparision.
-Malli......
|
|
|
|
|
thanks malli
i have one more doubt
when i execute thhis query
hres = pSvc->ExecNotificationQuery(
bstr_t("WQL"),
bstr_t("SELECT * FROM __InstanceCreationEvent WITHIN 5 WHERE TargetInstance ISA 'Win32_Process' And (TargetInstance.Name = 'notepad.exe' OR TargetInstance.Name = 'calc.exe' ) "),
WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY,
NULL,
&pEnumerator);
i get the output stored in pEnumerator.
now how to extract data from pEnumerator . whether itis
hr = pclsObj->Get("Name", 0, &vtProp, 0, 0);
or
hr = pclsObj->Get("TargetInstance.Name", 0, &vtProp, 0, 0);
where Name is the property of Win32)process class
Thanks In advance
Regards
Abhi
abhi
|
|
|
|
|
Please suggest some site names where i can
find all the details about COM,DCOM etc., in Detail.
Cheers
Nagaraj.
|
|
|
|
|
Detailed information is scattered throughout the web. Buy a book, borrow one from a library or a friend, or purchase an e-book. The topic is huge and you won't find everything in one place.
|
|
|
|
|
I’m stuck on something I’ve solved before but can’t remember how to solve now. I have a COM object (unmanaged C++) that I am installing on several machines. It works fine on machines that have Visual Studio installed. But I can’t register the object on machines without VS. When I try to register it, regsvr32 says “the specified module could not be found.”
I am sure this refers to a DLL the object uses indirectly – not the COM object DLL itself. I copied over the usual suspects – mfc, atl, etc. But I haven’t hit the right one.
Suggestions?
How can I get regsvr32 to tell me which module it can’t find?
BTW, I have tried both release & debug builds of the object with no change.
Thanks!
Marshall
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
|
This is exactly what I needed. I absolutely should have remembered the good ol' dependency walker from yester-year. Just when COM was starting to be a vague memory, it came back and reminded me just how much trouble it can cause!
Thanks!
If you continue to do the same things you always did, don't be surprised if you get the same results you always got.
|
|
|
|
|
Is there an API available to enable/disable Windows SP2 firewall on a given connection?
I’ve read through the Windows SP2 Firewall API, but it seems there is no mean to do this, neither enabling nor disabling “pop3”, “FTP server”…etc on a given connection.
These properties are displayed in the Windows SP2 Firewall GUI under ‘Network connection settings’ of the ‘advanced’ tab! There were some methods to do this with ICS/ICF…
Thanks!
Carl
|
|
|
|
|
|
Although I have been using COM for some time now, I am trying to do something something different from my usual experience and I have run into a problem that I am unable to solve at the moment, and would be grateful for any assistance.
My intention is to have a singleton EXE COM server running on a LAN connected computer. This server will be started once, and then remote users can connected to it. I am running currently as the interactive user, but may change this to a service at a later date. If the remote and local computers are both logged in as the same user, then everything works fine as expected.
However, if a different user runs the client, and tries to access the running version on the server then there is no response, and instead another instance of the server program is started despite supposed to being a singleton.
Please could anyone account for the difference between in behaviour? I have tried many different security configurations including administrator, but have been unable to overcome this problem. The security initialization code reads
CoInitializeSecurity(NULL, -1, NULL, NULL, RPC_C_AUTHN_LEVEL_NONE,<br />
RPC_C_IMP_LEVEL_IMPERSONATE, NULL, EOAC_NONE, NULL);<br />
which usually overcomes every problem for me. Thanking anyone in advance who gives this some attention.
|
|
|
|
|
If anyone is interested, I have now been able to resolve all my problems.
Once I had denied launch permission to everyone, and also reste the security info the OleView, everything worked fine, and continues to work perfectly.
This one took me a long to find, despite being in and out of the dcomcnfg program checking the permissions. I hope that this response will be able to help without anyone else that has similar problems.
|
|
|
|
|
Hi, I have a little knowledge in COM technology, in fact I have develop some(very simple ones) COM objects. As usual the requirements are demanding advanced technical solutions, and seems(remember I'm a begineer) that COM is not enough to accomplish this. What i have read is that DCOM and COM+ follows COM. But know is Services Oriented Architecture (Web Services?. So could anyone explain me COM evolution.
Besides, Can i throw an exception in a COM object and a Delphi app consume my COM??
Tnx
|
|
|
|
|
hi
see this link [^]
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
-- modified at 23:21 Monday 13th February, 2006
|
|
|
|
|
|
Good day.
Could anybody help to implement flicker-free support in ATL ActiveX (without MFC)?
Thanks.
|
|
|
|
|
Now I am creating a new web control in VS 2003
After I created a web control,
I add this web control in a new asp.net project and drag the control to a web form then the control
will displaying in word format rather than a image like generic microsoft web control.
Anyone may help on this?
|
|
|
|
|
I have ATL COm dll, Now I want to convert it to ATL EXE, But when I removed the DLL main stuff to Winmain... It still assumes, its dll. When I try to execute it on cmd-shell, it gives me error messsage, " Not valid Win32 application"
Any Soultion.
cheers
Balkrishna Talele
|
|
|
|
|
Hello Balkrishna,
There is no direct way to convert a COM DLL to a COM EXE. While the implementation codes of your objects will most likely remain the same, the server codes (i.e. the supporting global functions that help to expose your COM objects) are entirely different between a COM DLL and a COM EXE.
A DLL will typically export a DllGetClassObject() global function plus others (e.g. DllCanUnloadNow()). A COM EXE cannot export any functions and must use the CoRegisterClassObject() to expose your COM Object's Class Factory Object.
I suggest you refer to a good book on COM, e.g. The Essence of COM by David S. Platt.
|
|
|
|
|
Hi,
as far as I know a C++ com client needs the interface definition and GUIDS of the server which are taking from xxx.c and xxx_i.c.
my question is: how can I generate xxx.c and xxx_i.c files from a tlb or dll ?
Thank you in advance
|
|
|
|
|
I obtained the idl from Ole/Com Object Viewer. Then I compiled it with midl.exe, thus getting the xxx.h and xxx_i.c
|
|
|
|
|
Hello Fisico,
What is typically done is that you would use the .NET tool regasm.exe to register COM information for your C# assembly. You can also instruct regasm.exe to produce a .TLB (type library) file for the assembly by using the /tlb option, for example :
regasm CSharpAssembly.dll /tlb
You would then use this .TLB in the C++ client source code via a #import statement :
#import "CSharpAssembly.tlb"
The full definitions of the COM object available to your C++ client will be available via an automatically generated .tlh (type library header) file.
Best Regards,
Bio.
|
|
|
|