|
I have created a marshaling proxy/stub DLL to handle the custom data interfacing of a COM object. The COM is a .exe and I am having trouble getting the marshaller to work during deploy.
If I install the C++ application and COM server on a target machine and register the components this way... (COM server is SPDCom)
c:\TARGETFOLDER\SPDCom.exe /Regserver
regsvr32 c:\TARGETFOLDER\SPDComPS.dll
The COM object is started and running in memory properly by the application, but I do not get any data from the Proxy/Stub. (Just the first data item in the passed arrays.)
I was only able to get the project to work well after using VC++ 6.0 to build and register the SPDComPS project on the target machine.
Before I built and registered the PS project, I did verify that the PS was registered in the registry with all of it's GUIDs. Finally, with this background, my question is:
What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++? (That seems to be the only difference!)
David Leikis
ATK Thiokol Propulsion
|
|
|
|
|
David_Leikis wrote:
What is the difference between registering using regsvr32 from the 'RUN' prompt and from within VC++?
There is no difference, it still is the RegSvr32 that is used even if called from the DevStudio IDE.
However, if you don't alter the "Tools->Register control" command in DevStudio, RegSvr32 is run from your target directory and always puts quotation marks on each side of the path to your server.
Since it works when you build the application on the target machine you might have been missing some files that were installed with DevStudio.
Hope this helps
--
Roger
|
|
|
|
|
After a few phone calls to Microsoft support, I got the answer to the problem of the Proxy/Stub not working and seeming to need to be registered with DevStudio.
It seems that the Regsvr32 utility needs to have the COM object already installed BEFORE you install the PS!!! The bottom line is that the PS.DLL MUST be registered last! If you don't, there will never be any notification of error or warning, the COM object will fall back to standard marshalling and your custom marshalling PS.DLL will simply not be invoked.
I just had my client register the PS.DLL again (last) and it worked immediately.
-- modified at 9:00 Tuesday 11th October, 2005
|
|
|
|
|
Well, there's always a lesson to be learned.
I didn't think if this either, but afterwards it's quite logical since when the server is registered (DllRegisterServer gets called from e.g. RegSvr32) it simply writes registry values not knowing anything about the proxy/stub dll.
Nice of you to share the explanation. Thanks.
--
Roger
|
|
|
|
|
I am executing the following code in VC.
-----------
HRESULT hr = CoInitialize( NULL );
hr = CoCreateInstance( CLSID_RegExp, NULL,
CLSCTX_SERVER, IID_IRegExp, (void**)&m_pIRegExp);
CoUninitialize();
---------------
I find that in the first execution(i.e. after restarting my machine) the time taken to execute this code is more than the subsequent executions.
The main time taken in case of 1st run is by CoCreateInstance
I am measuring the time taken using IBM's Rational(so I can trust their output).
Can u help me figure out the problem?
Is it that for the 1st time I run the application, some dll's are loaded in the memory which doesnot happen in the subsequent runs? Is this some funda of COM?
Please help.
P.S. Performance improvement is my main focus
Chirag Saglani
|
|
|
|
|
The initial delay is because the operating system does much initialization under the hood (DLL loading, etc). This was the case under Windows 9x, but I have not observed this under Windows NT-based operating systems.
--
|
|
|
|
|
Thank you for the reply.
I am using Windows XP ans still facing this problem.
Can u also please tell me what exactly happens during CoCreateInstance (which DLL is loaded etc)that is taking more time in the first execution?
Thanx
|
|
|
|
|
Hi Chirag,
Check if the regular expression libraries are installed properly.
There might be some collision between your "RegExp" library CLSID's...
I am just guessing, you can have a look...
OR
Try to design some simple application in VB using "Regular Expression" library.
This might tell you where exactly the problem is...
I cant see other things that should take time...
all the best !
Cheers,
Vishal
-- modified at 8:09 Tuesday 11th October, 2005
|
|
|
|
|
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
|
|
|
|