|
Hi people,
I have an ASP.NET application that uses a COM (locally) to do some number crunching. Everything works fine when the COM is installed on the same machine as the web application. In fact, the ASP.NET application uses a web service to access the COM. The web service is also on the same machine.
Now, for performance reasons, we have decided to distribute the COM to several machines on the network so that we can have some distributed computing. I am not the one who is responsible for the COM development. For testing purposes, we have installed the COM on a remote machine and have created a .NET assembly that will interact with it.
First, I tried the concept using a console application. I reference the assembly, instantiate the class and perform the calculations. The COM works fine on the remote machine with no problems.
Now I am trying to make the ASP.NET application do the same thing as the console application but it's not working. I reference the assembly in my web service code but the call fails.
I know that the COM needs to be configured on the remote machine to allow access and execution. I have noticed that the account that should be used to contact the COM should be a domain account. When I run the console application from my machine, the Dllhost process on the remote machine shows well my username as owner.
I have suspected that because the web application runs with the ASPNET account, it wasn't allowed to run the COM on the remote machine. I have tried using impersonation to switch to my account inside the web service code. The impersonation works fine inside the code. When I debug, I can see that the Environment.UserName field goes from ASPNET to my username. However this doesn't solve the problem.
To check if the impersonation was working, I have tried calling my console application from inside the web service application using the Process class. When I go to the taks manager to see the processes list, I see that ASPNET is the owner of the console application. I have tried calling notepad also and I got the same thing.
So my first questions are:
Does impersonation work only inside the code? Why is my process running under ASPNET?
I have also read some things about delegation to allow a COM to be called across a network. I did some research about the matter and there were some things that needed to be set by the admin, to allow the impersonating account be used for delegation and the impersonated account also. We did all that but still it's not working. I'm sure I'm still missing a lot of stuff since I didn't find any article online that would explain the whole process.
My second question is:
Can anyone point to a URL or maybe explain to me how this delegation works? or maybe if someone has a way to launch a COM across the network, some tips, etc...
Thank you all for your efforts.
Talal
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning."
--Rich Cook
|
|
|
|
|
Hi,
I'm a new dotnet developer and i always hear of COM and COM Components. What is it and why is it used? can u pls explain me abt it?
Regards
Vijay.
|
|
|
|
|
COM means Component Object Model and its a (binary) standard, language-independent, for Creating objects that can interact.
See here http://msdn2.microsoft.com/en-us/library/ms680573.aspx[^].
Event the first period of the above page:
COM is a platform-independent, distributed, object-oriented system for creating binary software components that can interact.
gives a lot of info about.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
Hi.
Anyone can tell me about COM+ and DCOM.
Are those same or different?
Please let me know it or any reference url.
Thank you.
Developer
|
|
|
|
|
They are not the same. DCOM is COM with the ability to have not just out-of-process objects, but objects that are on different machines.
COM+ provides a range of different features, such as thread pooling, object pooling, role-based security, and JIT object activation. It can also provide transaction support.
I suggest you look in MSDN online to learn more.
Steve S
Developer for hire
|
|
|
|
|
Hi Experts,
I want to create instance of a inteface(IPropertyBag) ,defind in a ProfMan.dll file so that i can use Add() method define in this interface.
And same name interface exist in ocidl.h file.How can i pass a correct GUID
so that i can access method defind in ProfMan.dll.
i try like this
IPropertyBag* Properties;
hr=CoCreateInstance(__uuidof(PropertyBag),NULL,CLSCTX_INPROC_SERVER,
__uuidof(IPropertyBag),(void**) &Properties);
I took help from visual studio ole to see the id of interface and coclass.
Then i write the following code
const GUID CLSID_IPropertBag ={0x47000673,0x7DB2,0x44C9,
{0x8A,0xC1,0x65,0x26,0x61,0x17,0xD2,0x80}};
const GUID CLSID_PropertBag={0xFC583D50,0xA2F5,0x4656,
{0x8B,0x1D,0x36,0x04,0x88,0xB1,0x83,0xD3}};
hr=CoCreateInstance(CLSID_PropertBag,NULL,CLSCTX_INPROC_SERVER,
CLSID_IPropertBag,(void**) &Properties);
But this time i am unable to access the Add method.
How can i resolve the problrm.
Help me.
|
|
|
|
|
As it's stated, your Interface name conflicts with an existing one. This is not a problem, since only interface UUID matters for COM.
Probably you have to tell us more about your problem, i.e. what kind of error are you experiencing?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
What is the difference between the two and which is used over the other? How does COM play into picture. I know this has something to do with dll hell. Would appreciate to know the divide between the two?
|
|
|
|
|
hi friends,
i am developing a web project using vb .net. here i am using an
activex component made in VB 6.0.it is working fine when run in VS.NET
developemnt server. But when i run this on iis it gives an error.
can not create activex component in line:
myobj= CreateObject("NDEMO.NGDEMO")
however i have registered NDEMO.ocx on machine.
Anybody please help me
thanks very Much.
life is all about helping each other
|
|
|
|
|
hi,
does anyone know a tool or a method to generate a stub COM library from a Type library (tlb)?
I want to provide a com dll without implementation to a customer so that he can start developping. The interface is fixed (type library shouldn't change) but my implementation is not finished yet, so I want to avoid that the customer is starting to work with an untested library...
Many thanks in advance...
gr,
Niko Tanghe
<< Nearly all men can stand adversity, but if you want to test a man's character, give him power. >>
|
|
|
|
|
I am new to the COM programming.
I am trying to dynamically allocate memory using CoTaskMemRealloc(). I am doing this multiple times. In the first call the pointer passed to the routine is NULL pointer. In this first call it allocates the memory and returns the pointer to the allocated memory. But the next call to realloc fails. Why?
I would like to get references where I can get more info on memory management in COM/OLE.
Thanks,
Vivek.
|
|
|
|
|
the following code snippet it's working fine on my system:
HRESULT hr =CoInitialize(NULL);
LPVOID lpvFirst = CoTaskMemRealloc(NULL, 1024);
LPVOID lpvSecond=NULL;
if ( lpvFirst )
{
lpvSecond = CoTaskMemRealloc(lpvFirst, 2048);
}
CoUninitialize();
bvivekb4u wrote: I would like to get references where I can get more info on memory management in COM/OLE.
I don't know specific reference for the above argument. you may find useful general info on the books suggested here [^] and here [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Hi all.
I want to implement frame activex control like "microsoft form 2.0 frame" that can contain my radio activex control with VC++/MFC. I have read msdn articles and I think I must implement ISimpleFrameSite interface on frame control.
How to implement ISimpleFrameSite in VC++/MFC Activex Control? Thank in advance.
|
|
|
|
|
Hi,
I have a COM object written under unmanaged C++ wrapped in .NET 2.0 . I'm wondering if there is a way to fill array of int (long) values in C++ and then read those values in C#. I need to create a method in C++ , which will look (after wrapped) in C# like
int FillValues(out long[] values);
I tried to use (from Interface IDL)
HRESULT FillValues([out] __int64 *values, [out, retval] int* count);
which is translated into
int FillValues(IntPtr[] values);
any ideas?
thanx
|
|
|
|
|
Maybe the following link will help http://msdn.microsoft.com/msdnmag/issues/02/08/CQA/[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
|
hi guys,
i developed an application that uses dll developed by me as well.
This application is win32 application and the main uses parameters.
when i run the application it is all right.
but something weird happened for 2 times the application break but at the end of it and i just donno why
and listen to this when i change its location it runs normally.
adn sometimes i cannot even delete them it seems there is still something work although i can't see it
anyone help pleeeeeeeeeeeeeeeeease
emma
|
|
|
|
|
Probably your appllication hangs (search for it in the Task Manager) check if it correctly deals with system resources (such as GDI objects handles, etc...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks,
it was just i had to free pointer so i free it without declaring the pointer as NULL especially that this variable is used by the dll as global variable but now everything is ok thanks
emma
|
|
|
|
|
Hi All,
I need to fetch all the Undelivered mail form my outlook inbox I am using ASP.NET 2.0(VB).
Can anyone suggest me with the code??
Thanks in advance...
|
|
|
|
|
Hi,
What is the difference between ordinary DLL n COM DLL? what is the advantage of COM DLL? Insted of COM DLL why dont we use ordinary DLL?
Thanks in Advance,
Nandu.
|
|
|
|
|
A COM DLL must satisfy additional requirements with respect an ordinary one. A COM DLL contains COM components, i.e. objects that satisfy COM binary standard requirements. (e.g. macroscopic feature of a COM DLL is that it must be registered).
The advantage of a COM DLL is that the binary standard allows to access the objects contained in a variety of different programming languages (e.g. C, C++, Visual Basic,...).
You can use an ordinary DLL if you don't need such binary compatibility.
Please note that the above survey is poor: if you really want to know the advantages of COM over standard libraries then you have to read a good book on the argument (for instance Inside Com[^], but there are a lot of good ones about...).
Hope that helps
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|
Thanks,
Can you suggest some good books for COM.
-Nanadu
|
|
|
|
|
Nandu_77b wrote: Can you suggest some good books for COM.
I've already done...
Anyway, other good books are Don Box's [^] and Eddon & Eddon's one [^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
|
|
|
|
|