|
Hi,
I am developing an application with several components in it. The main application will have a GUI and there are several components like BHO, MS Office Addins, Clipboard trackers etc. I have a problem here.
These components should communicate with the main application by some means. It has to pass some events or some values to the main application. I will be creating both the components and the main application and I would like to know, the best method to connect the components to the main application.
I have pretty good exposure to COM and Windows programming.
Also Is it possible to create a Singleton Automation server ?
Thanks and Regards
Jugs
"A robust program is resistant to errors -- it either works correctly, or it does not work at all; whereas a fault tolerant program must actually recover from errors."
|
|
|
|
|
>>I am developing an application with several components in it. The main
>>application will have a GUI and there are several components like BHO, MS
>>Office Addins, Clipboard trackers etc. I have a problem here.
What kind of appliction is this, I mean do you have some activex control inside this application which in turn has IE instance, Office instance and so...
>>These components should communicate with the main application by some
>>means.
You can get the HWND of your applications main window... there are several ways
to get HWND, like get HWND using "caption" or "class name" for window with the
help of FindWindow API...
Once you get the HWND you can very well use "SendMessage" or "PostMessage" for
further communication...
All these things would go inside your BHO, Office addin or so...
>>Also Is it possible to create a Singleton Automation server ?
sorry no idea about the Singleton automation server...
Hope this would help you!
Cheers,
Vishal
-- modified at 8:28 Tuesday 11th October, 2005
|
|
|
|
|
Hi folks... it's me again....
Now approaching wit another strange problem.
I just upgraded my systems to Platform SDK Feb '03 to permit me to declare UUIDs in structs in IDL files.
I finished redesigning all the project, put the structs in right places, made the appropriate modifies, then I compiled the server and that went OK, compiled the proxy/stub DLL and that was OK again, compiled the client and it went OK.
After that I picked up the server executable and the DLL and copied in my folder on client side, and tried to register both of them. The DLL was OK, but not the client. I got a MessageBox that told me of a memory leak, but the title of that MessageBox left me breathless. (LWTCPJSOCKWNDYCLASS: STTRServer.exe - Application Error). I tried to search about that string but don't know what it is. I just can guess that is something about the network, but just nothing more.
So I fulfilled the registration part with log statements and I saw that the program executes ALL the instructions (and the return code is ALWAYS S_OK!). So I was stuck. Just to try, I saw that the component registered however, so I tried to start it.
Well, it does some strange things.
1) It executes on both client and server (when I configured it to run ONLY on remote machine) and fills BOTH logs
2) It gives me an error 0x80029c4a: cannot load library/DLL.
The only thing I've not yet done is to rebuild the project on client (since it's an XP Pro machine, while the server is a 2000 Pro machine), but it should work anyway, not event vice versa, but an older engine should work on a newer OS, not?
Is there someone that can help me? I can send (not post due of size) code to anyone that would like to analyze it.
Thanks again (and I hope this would be the last, for this project! I'm getting crazy! )
Morenz
|
|
|
|
|
As soon as I got a Win2k machine, I noticed that i couldn't register ONE out of my FOUR classes.
I went in my source code, and I noticed that when I tried to modify project for custom marshaling, I commented out the COM_INTERFACE_ENTRY(IDispatch) for two interfaces, and the third I modified it into COM_INTERFACE_ENTRY (IUnknown). The ONLY class that was right, was the only one that could not be registered. Fixing it, on a 2k machine registers and starts regurlary. Now, it's to try on a XP machine... but I think it will work.... Yesterday was a bad day, you know, I made so many bad things.... Today is a good day, many problems getting away...
|
|
|
|
|
i am new in COM, can anyone plz tell url of COM ebooks or links
|
|
|
|
|
Hi,
I searched some months ago for ebooks on the web, but I just found the COM Specification on Microsoft Web Site.
I purchased a book that has been a bible for me, Don Box's "Essential Com".
That's all, I'm sorry
Morenz
|
|
|
|
|
I recommend you to have a look in the MSDN library[^]
. There is a lot of information there.
And there are a lot of articles very helpful here in The Code Project. For example...
From Joao C. Morais -- All of them. The articles are a very good introduction to COM Architecture[^]
From Lim Bio Liong -- All of them are indispensables. Have a look in the Beginners and COM sections.
-- modified at 11:43 Tuesday 4th October, 2005
|
|
|
|
|
Perhaps more information on the nuts and bolts of how one actually *writes* this software may be helpful.. I have a step-by-step DCOM tutorial, where I build a simple server which says "Hello, world!" back to the client, may help put some of this in practical perspective...
The tutorials are written as a series of separate articles, called Steps, which cover the major breakpoints in the development of the system.
Step 1 of the tutorial for VC 6 is at
http://www.codeproject.com/com/HelloTutorial1.asp[^]
And Step 1 of the turtorial for Visual C++.NET 2003 is at
http://www.codeproject.com/useritems/HelloTutorial1NET.asp[^]
I tried to write the tutorials in Microsoft-ese, so you can follow along as if you were reading the Scribble tutorial. The VS.NET version is still a work in progress; that's why it's still in "Unedited User Constributions."
Not all the Steps have been written for the VS.NET version yet. But I am working on it!
Stay tuned!
Sincerely Yours,
Brian Hart
Department of Physics and Astronomy
University of California, Irvine
|
|
|
|
|
|
Hi,
I want to access sql store procedure.It has 3 input parameter and 8 output parameters. store procedure also retun the result set. Can you please give me reference of sample code to access store procedure. I am totally new to DB.
Thanks
|
|
|
|
|
Try looking at some of the ADO, OLEDB, or ODBC samples in code project.
|
|
|
|
|
hi,
i dave developed a .net component that is working fine in dot net projects but i want to add this component to a vb 6.0 project for that i have assigned strong name to the project but following problem is hindering
i am using some activex components (one of them is Microsoft.Scripting and other is thirdparty component) in my dotnet component, and i am not able to assign any string name to these components,
what should i do to make my component workable with vb 6.0
regards,
Arus
-- modified at 11:02 Monday 3rd October, 2005
|
|
|
|
|
This is just a query asking clarification. I have heard that due to the arrival of .Net, COM is getting phased out. Is this true.
|
|
|
|
|
prcontact@hotmail.com wrote:
Is this true.
Well, have you seen anything new on the COM-front? It'll be around and supported for quite some time I believe for legacy reasons, but I doubt there will be any new features.
--
Look straight into the light!
|
|
|
|
|
Don Box wrote something about this
http://msdn.microsoft.com/msdnmag/issues/1200/com/[^]
I agree with the previous post. I'm new in COM (6 months ago I didn't known anything about), and it's true that there won't be anything new, but somehow it's surviving. People continue developing components (starting at me).
|
|
|
|
|
Hi there,
I have an addin to ms Word written in visual c++ implementing the IDTExtensibility2 interface.
I sink events properly and launch my functions...
My question is..how can I call those functions from a different c++ project?(that should be possible)need I to register them as word native functions, can I use messages to call them?...
thanks and happy codding
AB.
|
|
|
|
|
I am beginner in COM.
I have come across a InvokeHelper Function.Most of them contain the syntax as follows
InvokeHelper(0x1f, DISPATCH_PROPERTYPUT, VT_EMPTY, NULL, NULL);
I understood the rest of the parameters except for the first one.
The MSDN says it identifies the method.I would like to know how to check the what that hexadecimal number(the 1st parameter) refers to??
is it method name translated to hexadecimal form??
I mean how to check which number refers to which control??
Any Kind of Help Would Be Highly Appreciated
|
|
|
|
|
Look for the function number in your component's idl, if its written by yourself,
or in the typelib of the component.
interface IMySecurity : IDispatch<br />
{<br />
[id(1), helpstring("First function.")] <br />
HRESULT First();<br />
[id(2), helpstring("Second function.")] <br />
HRESULT Second();<br />
};
The numbers are the ids.
|
|
|
|
|
I created win application with comboBox1, axAcroPDF1, button1.
The code looks like this:
…Button1_Click()…
{
if(comboBox1.Text =="myfile1.pdf")
{
axAcroPDF1.LoadFile(@"\myfile1.pdf");
axAcroPDF1.Show();
}
else if(comboBox1.Text =="myfile2.pdf"))
{
axAcroPDF1.LoadFile(@"\myfile2.pdf");
axAcroPDF1.Show();
}
}
It displayed "myfile1.pdf" when I chose "myfile1.pdf" from comboBox1 and pressed the button but gave me the error when I tried to display "myfile2.pdf". Does anybody know how to fix this problem?
Thanks
|
|
|
|
|
I fixed it. It was easy.
|
|
|
|
|
Did anyone tried event handling on activex controls from Grid present on property sheet provided by MFC ActiveX control wizard.
If yes can anyone let me how can this be done
from
ashwin kumar
|
|
|
|
|
Did anyone tried event handling on activex controls from Grid present on property sheet provided by MFC ActiveX control wizard.
If yes can anyone let me how can this be done
|
|
|
|
|
Hai..
I am extracting the data from the various webpages using com interface IHTMLDocument, IHTMLElement and some other. If any utf-8 occurs in the webpage i am getting the data in ????? symbols. I am building my application with UNICODE. How to solve this bug.
Thanks,
Veera Raghavendra
|
|
|
|
|
hi folks;)
I need to put a struct (in which i have another struct...) into a VARIANT to pass it between DCOM client and server methods.
I would like to avoid custom marshaling (i've never done it and the customer is getting angry... so I have no time to spend on it...).
How can I do?
Thanks in advance!
Morenz
|
|
|
|
|