|
If you have written your COM EXE Server using atl, then to register the exe you do
mycomserver.exe /RegServer
regsvr32 is just for DLL's.
There should be no problem in calling a DLL COM server from a COM server EXE. I use this technique a lot.
Michael
|
|
|
|
|
The basic rule of COM says, In COM, once you "publish" an interface contract by shipping a component, the contract is immutable—it cannot be changed in any way. You can not add. You can not delete. You can not modify.
But, when you open Microsoft Word 97/98 and Microsoft Word 2000 's .OLB files, you will see that for extending the interfaces, they have added methods to the old interfaces. For example, in MS Word 2000 they have added methods in Application interface, and all the other interfaces. Why So? I feel the right approach is to add new interface if you want to extend an interface. Can somebody tell me its' reason??
|
|
|
|
|
I managed to get four files by compiling the *.idl file.But I have some problems in compiling the four files and the *.def file.When these files were being linked,I was told the following information:
MyProxy.def : error LNK2001: unresolved external symbol DllRegisterServer
MyProxy.def : error LNK2001: unresolved external symbol DllUnregisterServer
I think the *.idl file will define the two functions for me.Is it true?And what's wrong?Do I have to define the two functions on myself?Inform me of the details,please.Many thanks for you read my question.I'm waiting for your reply.Thank you for reading my question.
|
|
|
|
|
Thank you for anyone try to help me.
|
|
|
|
|
hey
since you cant run these things the only way to debug them is to run the calling client in debug mode and then to step into CoCreateInstance
but when I did that I got the message in the newly opened VS that there is no source code and so am I interested in seeing the disassembly
not apleasing sight - all that disassembled code - I can tell you that
so just how do i debug the code and put break points?
Nish
|
|
|
|
|
Is your COM server a DLL?
If it is, load up the project and put a breakpoint in the code you want to debug.
In the Project Settings Debug Tab, set your client exe in the Executable for Debug Session. Hit F5, your client app will run. When it runs the code you are debugging Visual Studio will stop at your breakpoint.
Michael
|
|
|
|
|
nope
its an exe com server[containing a com dll]
and when I tried the above technique you suggested I got a msg saying that the breakpoints cannot be set and so program will break at the beginning of the program
I am in the process of learning some COM
not much luck so far
Nish
|
|
|
|
|
Try stepping into the Invoke call instead of the CoCreate call. That works for me. When the new VS IDE comes up, it will be in some Microsoft ole code. If you don't have the source for the MS code you will get the kind of message you describe. Just press on.
When the new IDE opens up, open the source file(s) for your server, insert break points and hit GO. For some reason, breakpoints set up in the original IDE don't work while debugging. If you save the second environment (when prompted) the break points will be retained.
Hope this helps,
Bill
|
|
|
|
|
Hello
I am having some trouble....
I knew it was faliling at the CoCreateInstance so I did these checks...thinking that CoCreateInstance returns only one of three values and nothing else
if(hr==REGDB_E_CLASSNOTREG )
MessageBox("REGDB_E_CLASSNOTREG trouble");
if(hr==CLASS_E_NOAGGREGATION)
MessageBox("CLASS_E_NOAGGREGATION trouble");
if(hr==S_OK)
MessageBox("S_OK");
But I dont get mesg boxes.
so I tried this
DWORD d1=GetLastError();
and put a break point on the next line
d1 was 1008...which stands for An attempt was made to reference a token that does not exist.
whats that supposed to mean????
|
|
|
|
|
in debug, after the call to CoCreateInstance
on the WATCH variables window type "hr,hr" this will display the error string for the call to CoCreateInstance.
Normski - Windows Professional Programmer
|
|
|
|
|
Hi Norm
I did that and got this
E_NOINTERFACE
Nish
|
|
|
|
|
Is object properly registered, have you execeed the method count (check your IDL)?
Normski - Professional Windows Programmer
|
|
|
|
|
actually its a simple container com server
was trying out how to create a container com server
I created it as an exe
I guess that might be the whole trouble
I put a mesg box in the oevr-ridden FinalConstruct()and am getting it okay
Thus I know its registered and I also know its getting called
but some other error
by the way when I manually tried to register it using regsvr32 I got an error. apparently you are not supposed to do that. am quite new to COM and am dead-stuck!
I tried to call the same container server from VB and got some VB error message saying the component doesnot have an exposed interface or some such stuff
maybe I did something wrong with the app wizard options
there are too many options and I must have selected one wrong radio button or hit the wrong chk box...
Nish
|
|
|
|
|
prolly containing servers are a bad idea
waaaaaaaaaaaaaaaaaah
Nish
|
|
|
|
|
Whats the application do?
Normski - Professional Windows Programmer
|
|
|
|
|
The error code you got when you tried to register manually, is describing what you have done wrong in your implementation.
Placing COM objects inside a .EXE is creating what is called a Full Server. This is a common technique and works quite well.
I sounds like the problem is in the component iteself. Pay attention to the error returned from the manual registration attempt.
Hope this helps,
Bill
|
|
|
|
|
Sorry to bother you guys yet another time , but I keep getting a stack overflow whenever I call this line:
g_pThis->m_spWebBrowser2->ExecWB(OLECMDID_NEW,OLECMDEXECOPT_DODEFAULT,Var1,Var2);
I thought I was doing everything right, but I guess not...
|
|
|
|
|
Ok, I think the problem is that there is more than one item under the File->New menu. Is there any way that I could call the New->Window submenu? Possibly with a value in Var1?
If there isn't, does anyone know an easy way to open a new IE window, which my ATL object could control?
|
|
|
|
|
You can use the Navigate2 function and pass the flag navOpenInNewWindow and use about:blank for the URL.
Bret Faller
Odyssey Computing, Inc.
|
|
|
|
|
I need to develop COM application using C++. Please help me with some complete code samples which I can execute. Also please give some reference to COM resources using C++ on Internet. Thanks in advance.
Nilotpal
Nilotpal
|
|
|
|
|
Hi,
There are some good samples of COM using C++ in MSDN.
Same you may get from MSDN online...
I think Inside-COM by Dale Rogerson is a good book...(in C++) for beginners.
Firoz
|
|
|
|
|
|
hello,
i need a little help.
i have:
1) my ATL COM (lets say A) with MFC support which calls another my ATL COM (lets say B) with MFC which uses ADO(COM)
2) my ATL COM NT service(object C) created by wizard(server type=executable)
and what's my problem?
I can create instance of object A in object C, no problems, object A can create object B, still no problems, BUT there's no way for me to force the object B to pass the Open method of ADO's Connection, i'm still geting 0x80004005 - Unspecified error.
Is there anybody there who could help me, i would really appreaciate that.
thanks a lot in advance
johny flash
|
|
|
|
|
definitely i'm not able to use even directly(without my objects descibed in the message above) ADO(COM) from executable service created with ATL COM AppWizard. Still can't open the connection, method Connection::Open
|
|
|
|
|
I have got ADO working in my NT Service without any problem.
Are you calling ::CoInitialize and CoUnitialize in all your threads. You need to load the OLe libraries in all your threads. ADO requires this as it is a COM Object.
|
|
|
|