|
Hi,
I am tring to import Excel COM (Microsoft Excel 9.0 Object Liblary) to a .NET2.0 poroject's references and it dose not work. I receive errors about wrong assembly. I tried this under .Net1.1 and it worked. Dose it mean that this standart COM is not suported in .Net2.0? Did anybody have a problem like this?
Thanks in advance
Vizmunt
|
|
|
|
|
Hi,
I have some problem with this fn.
IMultiMediastream::GetDuration(..);
but this fn. worked well
IMultiMediastream::SetState(STREAMSTATE_RUN);
how to solve this problem
|
|
|
|
|
Error description?
"Watching non-programmers trying to run software companies is like watching someone who doesn't know how to surf trying to surf."
|
|
|
|
|
thankx for ur replay
now its working well
|
|
|
|
|
hi everyone, I have an old application VB6 and ASP.
the asp pages are on the webserver, the dll is registered on the webserver (win 2000), the dll is in the com+ also of the application server (win 2000). everything is working correctly.
When we change the webserver to a win 2003 server, I should register the com object on this new server, I made export from the application server, and I register this com on the new web server (win 2003).
I had this error: server.createobject failed.
it is like asp can't create any object.
what is the problem? security or configuration?
|
|
|
|
|
Can you specify the exact error which you are getting.
This most probably seems to be a security issue. There is a group called "Distributed COM Users" in the Groups. To use a COM Component from another machine through DCOM, user should be in this group. This group was not present with the original version of Windows 2003. It came only with SP1 of Win2k3.
Anyway, look at the exact error. It might be something else.
Tribute to Shog:
New CPhog is amazing especially with message posting, very well done Sir.
|
|
|
|
|
I'm writing Browser Helper Object (IExplorer plug-in) in C#, Microsoft VS 2005, Framwork 2.0.
1. I implement interface IObjectWithSite and add event handler for events SHDocVw.DWebBrowserEvents2_Event.DocumentComplete and SHDocVw.DWebBrowserEvents2_Event.OnQuit in function SetSite :
[System.Runtime.InteropServices.ComImport, System.Runtime.InteropServices.Guid( "FC4801A3-2BA9-11CF-A229-00AA003D7352" ), System.Runtime.InteropServices.InterfaceType( System.Runtime.InteropServices.ComInterfaceType.InterfaceIsIUnknown )]
public interface IObjectWithSite
{
void SetSite( [System.Runtime.InteropServices.In, System.Runtime.InteropServices.MarshalAs( System.Runtime.InteropServices.UnmanagedType.IUnknown )] object pUnkSite );
void GetSite( [System.Runtime.InteropServices.In] ref System.Guid riid, [System.Runtime.InteropServices.Out] System.IntPtr ppvSite );
}
[System.Runtime.InteropServices.ComVisible( true ), System.Runtime.InteropServices.Guid( "C06B3B91-769A-42d5-8BCD-CF70F8589FBA" ), System.Runtime.InteropServices.ClassInterface( System.Runtime.InteropServices.ClassInterfaceType.None )]
public class DOMPeek : IObjectWithSite
{
void IObjectWithSite.SetSite( object pUnkSite )
{
if(m_IUnkSite != null)
{
System.Runtime.InteropServices.Marshal.ReleaseComObject( m_IUnkSite );
}
m_IUnkSite = pUnkSite;
try
{
SHDocVw.DWebBrowserEvents2_Event WebBrowserEvents = (SHDocVw.DWebBrowserEvents2_Event)m_IUnkSite;
WebBrowserEvents.DocumentComplete += new SHDocVw.DWebBrowserEvents2_DocumentCompleteEventHandler( OnDocumentComplete );
WebBrowserEvents.OnQuit += new SHDocVw.DWebBrowserEvents2_OnQuitEventHandler( OnQuit );
}
catch // cast or no such interface exception
{
}
return;
}
void IObjectWithSite.GetSite( ref System.Guid riid, System.IntPtr ppvSite )
{
}
2. Implement event handlers OnQuit and DocumentComplete
void OnQuit()
{
System.Windows.Forms.MessageBox.Show( "OnQuit" );
}
void OnDocumentComplete( object pDispatch, ref object VariantURL )
{
System.Windows.Forms.MessageBox.Show( "OnDocumentComplete : " + VariantURL );
}
3. I register the object DOMPeek as Browser Helper Object in windows register.
Then I run IExplorer and see the messageBox "OnDocumentComplete : about:blank". Then I close IE window and see the messageBox "OnQuite".
The problem consist in that I take this result only in MSWindosw2003sp1 (server) with MS VS2005 installed. In MSWindowsXPsp2 without any updates, without MS VS2005, but with all Framework installed I didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". What's problem??? What updates need for correct working in MSWindowsXPsp2???
Then I try to install all updates for MSWindowsXPsp2 from Microsoft site and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Then I try to install MS VS2005 but didn't install all updates for MSWindowsXPsp2 and again didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit". Finally I install all updates for MSWindowsXPsp2 from microsoft site and then MS VS2005 then I see the messageBox "OnDocumentComplete : about:blank" and "OnQuit". But if I install MS VS2005 and then all updates for MSWindowsXPsp2 then not woking (didn't see the messageBox "OnDocumentComplete : about:blank", but see the messageBox "OnQuit").
What's problem??? What specifically updates need for correct working in MSWindowsXPsp2???
|
|
|
|
|
Hello,
I have created a server and client Automation; I manage to send commands, receive int ,strings,... but I need to receive a HBITMAP. How can I do that, I have read about IPicture but it does not work for remote automation.
Can somebody give me any clue?
Thank you,
Agnes
|
|
|
|
|
athomass wrote: have created a server and client Automation; I manage to send commands, receive int ,strings,... but I need to receive a HBITMAP. How can I do that, I have read about IPicture but it does not work for remote automation.
Can somebody give me any clue?
You have to read the bytes of the BITMAP and send that bytes,After receiving total bytes prepare the bitmap from that bytes of the BITMAP
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
Hello,
What type should I use to send the bytes? VARIANT with pbstrVal? or a SAFEARRAY?
|
|
|
|
|
athomass wrote: What type should I use to send the bytes? VARIANT with pbstrVal? or a SAFEARRAY?
Use just read the bitmap into byte array and simply send it ,not necessary to convert it from bytes to VARIANT with pbstrVal or a SAFEARRAY
because in send API it is typecasted into const void*
Knock out 't' from can't,
You can if you think you can
|
|
|
|
|
hi
iam trying to access remote WMI data using the following arguments in ConnectServer
hres = pLoc->ConnectServer(
_bstr_t(L"\\\\test\\root\\cimv2"),
_bstr_t(L"kumar"), // User name
_bstr_t(L"Keta001"), // User password
_bstr_t(L"MS_409"), // Locale
NULL, // Security flags
_bstr_t(L"CRAFT"), // Authority
0, // Context object
&pSvc // IWbemServices proxy
);
where test is the name of testPC
kumar is the username of remote PC
Keta001 is the password
CRAFT is the domain name
but when iam running my application iam getting error
cannot be connected error code 80041008
can u please suggest how to solve this.
Thanks In Advance
abhi
|
|
|
|
|
In the good old days I believe people were using the arcane technology which came to be known as COM+ to embed other application's document in their own document.
Like a Word with document a Windows Media Player or Excel or Visio document inside, double click on it and *bang* you coud start edit it using Excel/WMP/Visio toolbar.
Apparently even OpenOffice could do that.
Now here is my question:
I'm a new generation programmer. Blissfully ignorant of such thing.
But I would like to know and embed Word, Excel or other kind of document in my application's own document!
How could I do that?
And is there an up-to-date technology (i.e.: .NET API) to do that?
|
|
|
|
|
Super Lloyd wrote: Blissfully ignorant of such thing.
This is blissful for other people as well BTW.
Super Lloyd wrote: But I would like to know and embed Word, Excel or other kind of document in my application's own document!
Look at OLE and related technologies for this. you can create an Ole Container with the help of wizard in Visual C and even in a wizard-generated app you can add any OLE Server inside it. Word, Excel, Visio etc are OLE Servers, that's why they get embedded so easily.
Super Lloyd wrote: And is there an up-to-date technology (i.e.: .NET API) to do that?
I dont know much about .NET Alternatives but .NET Provides a Web Browser control through which you can add ActiveX controls in your winforms. There might be other ways as well. I will have to look into it.
Tribute to Shog:
New CPhog is amazing especially with message posting, very well done Sir.
|
|
|
|
|
The wizard tip & the IE is a good one!
Thanks!
|
|
|
|
|
Is it possible to block switch to retry message box while using com servers.
Thanks in advance.
|
|
|
|
|
Hai all
I need to get the count of all the open child windows in the current running instance of photoshop using COM i.e. not adding a reference in the references i am able to open a new instance and close it but my problem is if i have a few new document windows for editing open in photoshop can i have the count.
Thanks in advance,
I have been trying since 2 days.
Raj Kumar
modified 8-Aug-12 1:36am.
|
|
|
|
|
I saw this on MSDN:
RCW enforces built-in marshaling rules. For example, when a .NET client passes a String type as part of an argument to a managed object, the wrapper converts the string to a BSTR type. Should the COM object return a BSTR to its managed caller, the caller receives a string. Both the client and the server send and receive data that is familiar to them.
But this doesn't work for a .NET client passing a string by value to a COM server.
ATLSERVERLib.Object1Class obj = new ATLSERVERLib.Object1Class();<br />
<br />
unsafe<br />
{<br />
short k1 = obj.GetANum;<br />
Console.WriteLine(k1);<br />
<br />
string name = new string('o', 7);<br />
obj.GetName = "Check";<br />
string[] strArray = new string[1];<br />
strArray[0] = "N Prasad";<br />
obj.set_OtherName(ref strArray[0]);<br />
Console.WriteLine(obj.GetName);<br />
Console.ReadLine();<br />
}
If I comment out obj.set_OtherName(ref strArray[0]); , the obj.GetName doesn't yield the correct string.
It seems that the obj.GetName = "Check"; has no effect although it sets the COM server's private variable BSTR myValue; .
Thus it also seems that the .NET string to COM BSTR marshalling works properly inside COM server only if the string (.NET object) is passed by reference, which means it becomes a BSTR* in COM server.
Does anybody have an idea why this happens?
|
|
|
|
|
Why are you passing ref strArray[0] ? Could it be you COM server function looks like set_OtherName(BSTR bstrVal) and not set_OtherName(BSTR* bstrVal) ? Try calling obj.set_OtherName(strArray[0]) ;
Deus caritas est
|
|
|
|
|
Is it posible to use an automation object from a service?
I have created a service which listnens to tcp/ip calls and writes some info to a text file.
Now I want the service to call a procedure of an automation server.
When I call CoCreateInstanceEx(...) it fails
When I run exactly the same code from a normal program it works like a charm.
I tried to run the service as administrator but this didn't work either.
I also searched with google and posted the question on different newsgroups but I can't find the awnser to my question.
thanks,
Joep Admiraal
|
|
|
|
|
Hi,
Can anyone provide me a sammple program which uses mlang. I used
following lines of code in a simple win32 console application project
which gives me the errors specified below :
// code
#include "stdafx.h"
#include <mlang.h>
int _tmain(int argc, _TCHAR* argv[])
{
if(CoInitialize( NULL ) == S_OK){
IMultiLanguage *mReader = NULL;
CoCreateInstance(CLSID_CMultiLanguage,NULL,CLSCTX_ALL,IID_IMultiLanguage,(void
**)&mReader);
printf("Hello World!\n");
CoUninitialize();
}
return 0;
}
// output
eleting intermediate and output files for project 'Rnd', configuration
'Debug|Win32'
1>Compiling...
1>stdafx.cpp
1>Compiling...
1>Rnd.cpp
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(44) : error C2146: syntax error :
missing ';' before identifier 'IMLangStringBufW'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(44) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(44) : error C2146: syntax error :
missing ';' before identifier 'IMLangStringBufW'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(44) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(44) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(44) : error C2086: 'int
IMLangStringBufW' : redefinition
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(44) : see declaration of
'IMLangStringBufW'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(50) : error C2146: syntax error :
missing ';' before identifier 'IMLangStringBufA'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(50) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(56) : error C2146: syntax error :
missing ';' before identifier 'IMLangString'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(56) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(62) : error C2146: syntax error :
missing ';' before identifier 'IMLangStringWStr'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(62) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(68) : error C2146: syntax error :
missing ';' before identifier 'IMLangStringAStr'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(68) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(86) : error C2146: syntax error :
missing ';' before identifier 'IMLangLineBreakConsole'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(86) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(92) : error C2146: syntax error :
missing ';' before identifier 'IEnumCodePage'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(92) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(98) : error C2146: syntax error :
missing ';' before identifier 'IEnumRfc1766'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(98) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(104) : error C2146: syntax error :
missing ';' before identifier 'IEnumScript'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(104) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(110) : error C2146: syntax error :
missing ';' before identifier 'IMLangConvertCharset'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(110) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(128) : error C2146: syntax error :
missing ';' before identifier 'IMultiLanguage'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(128) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(134) : error C2146: syntax error :
missing ';' before identifier 'IMultiLanguage2'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(134) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(140) : error C2146: syntax error :
missing ';' before identifier 'IMLangCodePages'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(140) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(146) : error C2146: syntax error :
missing ';' before identifier 'IMLangFontLink'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(146) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(152) : error C2146: syntax error :
missing ';' before identifier 'IMLangFontLink2'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(152) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(158) : error C2146: syntax error :
missing ';' before identifier 'IMultiLanguage3'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(158) : warning C4091: '' : ignored on
left of 'interface' when no variable is declared
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(362) : error C2065: 'This' :
undeclared identifier
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(363) : error C2062: type 'long'
unexpected
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(376) : error C2062: type 'long'
unexpected
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(391) : error C2059: syntax error :
'const'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(405) : error C2062: type 'long'
unexpected
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(419) : error C2062: type 'long'
unexpected
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(446) : error C2371: 'IMLangStringBufA'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(50) : see declaration of
'IMLangStringBufA'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(651) : error C2371: 'IMLangString' :
redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(56) : see declaration of
'IMLangString'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(840) : error C2371: 'IMLangStringWStr'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(62) : see declaration of
'IMLangStringWStr'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(854) : error C2061: syntax error :
identifier 'IMLangStringBufW'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(869) : error C2061: syntax error :
identifier 'IMLangStringBufW'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(1097) : error C2061: syntax error :
identifier 'IMLangStringBufW'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(1130) : error C2061: syntax error :
identifier 'IMLangStringBufW'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(1220) : error C2371:
'IMLangStringAStr' : redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(68) : see declaration of
'IMLangStringAStr'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(1629) : error C2371:
'IMLangLineBreakConsole' : redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(86) : see declaration of
'IMLangLineBreakConsole'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(1864) : error C2371: 'IEnumCodePage' :
redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(92) : see declaration of
'IEnumCodePage'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(2038) : error C2371: 'IEnumRfc1766' :
redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(98) : see declaration of
'IEnumRfc1766'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(2264) : error C2371: 'IEnumScript' :
redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(104) : see declaration of
'IEnumScript'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(2448) : error C2371:
'IMLangConvertCharset' : redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(110) : see declaration of
'IMLangConvertCharset'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(2713) : error C2371: 'IMultiLanguage'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(128) : see declaration of
'IMultiLanguage'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(3228) : error C2371: 'IMultiLanguage2'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(134) : see declaration of
'IMultiLanguage2'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(4093) : error C2371: 'IMLangCodePages'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(140) : see declaration of
'IMLangCodePages'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(4275) : error C2371: 'IMLangFontLink'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(146) : see declaration of
'IMLangFontLink'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(4488) : error C2371: 'IMLangFontLink2'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(152) : see declaration of
'IMLangFontLink2'
1>d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(4779) : error C2371: 'IMultiLanguage3'
: redefinition; different basic types
1> d:\program files\microsoft visual studio
8\vc\platformsdk\include\mlang.h(158) : see declaration of
'IMultiLanguage3'
1>Rnd - 46 error(s), 15 warning(s)
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
It seems like there is some problem with the header file included
"mlang.h". Any insights will be of great help for me.
Thanks & Regards
Abhinav
|
|
|
|
|
Try adding a #include <windows.h> after the #include "stdafx.h" . Actually it would probably be better to put it in "stdafx.h".
Steve
|
|
|
|
|
Can we create COM DLL Servers which runs in a different thread than the Client? If so, could anyone point me to some websites where I may read about them.
Thanks.....
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|
|
TechyMaila wrote: COM DLL Servers which runs in a different thread than the Client
Depends on what you mean by different thread than the Client's...
You can create a server from a UI thread that is not the main thread of the client, i.e. a different thread than the one handling the GUI of the client, if such exist.
If you mean that the thread should not be in the same process as the client and it has to be a DLL server, as to my knowledge the only way I can think of is using DCOM where a surrogate process is created on the server machine. Then the thread in which the server runs would of course not be in the same process as the client hence a different thread.
If it doesn't have to be a DLL then a EXE server would have the server running in a different thread since it's an out-of-process server.
Not sure if I understood your question correctly...
--
Roger
It's supposed to be hard, otherwise anybody could do it!
Regarding CodeProject: "resistance is pointless; you will be assimilated"
|
|
|
|
|
Ok, First of all, thanks for your reply.
Now, let me clear your doubts. I have a client which creates and uses a COM Server. Its an InProc Server, so I assume that it runs in the same thread which created it. Am I right? With this scenario, what happens is, if something goes wrong with the server, it crashes the client too. I do not want this to happen. Also the server makes HTTP requests over the Web, so if the Internet connection is down, then the Server Sorta hangs in the middle while trying to find the connection which in turn hangs the Client.
What would be the best solution to tackle this problem? What I had thought about is, when the client creates the Server, it should automatically be created in a different thread in the same Process so that even if something goes wrong with it, then just the thread running the server can be destroyed, which I believe would not hurt the client. Is this possible? Or, Would I have to use DCOM and run the Server in a different Process? Would a DLL Server run in a separate Process or would it have to be an Exe? The COM Server is a DLL Server.
Thanks for your time....
---
With best regards,
A Manchester United Fan
The Genius of a true fool is that he can mess up a foolproof plan!
|
|
|
|