|
Hi I would like to have some valuable suggestion from you people.
Let me explain me my problem scenario.
I have an xml file which will serve the clients as a database. Now the situation is that this file could be accessed simultaneously from different clients, so the maintaining the state of the file becomes a serious concern. Now what we have thought is to make an out-of-process COM exe that will expose 2 interfaces to the client through which they can extract the record. As the 2 clients can call the interface at the same time we have used the critical section in each function call. In this way all the call will be serialized.
The second approach is to make an in-process dll and use some synchronization objects to handle the simultaneous calls.
Now the thing what I want to know is that which is the better approach keeping in mind the performance, maintainability and robustness.
What I think in any way as the database file is single the calls need to be serialized at any level regardless they are from the same process or different process. Also when we will use the in-process dll we need to use the mutex for synchronization purposes which itself is very heavy as compared to the critical section (out-of-process exe).
Please provide your suggestion as soon as possible as I have to face my boss tomorrow with the design issues.
Thanks
|
|
|
|
|
I would choose the in-process solution personally, not only because the out-of-process calls are quite slow (even mutex complexity is nothing compared to it) but you can drop into the problems with security settings at the specific machine.
But anyway it seems that it's a bit late for my suggestions
|
|
|
|
|
Can anyone tell me where I can find some information on what explorer bars can contain? Can they display HTML, graphics...?
Rola
|
|
|
|
|
|
I've searched and can't find not way for my servicedComponents to learn about the application Root folder of the COM+ Application, the application.Manifest trick does not solve my problems, I am thinking that there should be away to access this property of COM+ in the .net framework, traverse throght the com+ catalog in he unmanaged code seems ugly,
any one can enlighten?
thanks
|
|
|
|
|
What's causing the following error?
I'm using VC++ 6.0 on WinXP Home???
Any takers?
Linking...
Creating library ReleaseMinSize/mycom.lib and object ReleaseMinSize/mycom.exp
LIBCMT.lib(wwincrt0.obj) : error LNK2001: unresolved external symbol _wWinMain@16
ReleaseMinSize/mycom.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Thanks
How do I print my voice mail?
|
|
|
|
|
You need to provide an entry point for the executable. Goto Project settings, Linker, Output and type wWinMainCRTStartup into the "Entry-point symbol" field.
|
|
|
|
|
Nada...
I have tried that before
And i've tried _wWinMain@16 and about a million others.
How do I print my voice mail?
|
|
|
|
|
If you have not already tried this, remove _ATL_MIN_CRT from the project settings.
I had the same problem when I needed exception handling in a recent ATL project.
Cheers
Shaun
|
|
|
|
|
Did you ever know you my hero * sings like Bette Middler - Or more like that weird girl on WB superstar!!!
That worked...
Schweet!!!
Thanks you kindly!!!
How do I print my voice mail?
|
|
|
|
|
Hi,
I want to implement scrollbars in my control which is implemented by atl,
how to implement it ?
thanks in advance!
------------------------
Tell me the truth!
|
|
|
|
|
You can implement scrollbars in an ATL ActiveX control by setting the WinTraits in the class declaration:
<br />
CWindowImpl<CMainWindow, CWindow, CWinTraits<WS_CHILD | WS_VSCROLL, 0> ><br />
Another way to enable scrollbars in the control is to passs WS_VSCROLL and/or WS_HSCROLL to the CWindowImpl<>'s Create function (dwStyle).
Then you can add event handlers for the scrollbars by using the Add Windows Message Handler wizard.
Does this help? or did I completely misunderstand you post?
Regards,
John
|
|
|
|
|
thanks for your idea !let's have a try,thank you again
------------------------
Tell me the truth!
|
|
|
|
|
Hi,
i wrote an application which can communicate with excel.
I have build an dialog based project with automation.
The next step was including the classes from a Type Library (Excel.exe).
Now i can start excel via
m_pApp.CreateDispatch("Excel.Application");
and select Ranges and Fill Cells.
My Question is:
How to communicate with excel without starting excel.exe (in Taskmanager as an proccess).
Is it possible to do this.
I heard a lot of COM i always thought automation means COM.
My C++ Skills are not the best.
I won´t use ActiveX elements in my Project.
Is there any tutorial or can anybody help me to communicate with excel
without starting a excel.exe proccess.
Thx in advance.
Sorry for bad english.
Bye
|
|
|
|
|
Communicating with Excel.Application requires that excel be started. If your issue is that this application is visible, then you can probabaly find a visibility method in excel itself.
It should be something like m_pApp->SetVisible(false), althought i'm pretty sure my syntax isnt the right one.
Other than that, there is a package that is being sold that allows to manipulate excel at the file level but its not free. Can't remember the package name thought.
|
|
|
|
|
Hi darkbyte,
thx for reply!!!
Your code is totaly correct ->SetVisible(true)
If i dont use:
->SetVisible(false)
Excel is hidden and not visible @ the Taskbar but i can
see it in the Taskmanager as an active process.
If i use:
->SetVisible(true)
Excel appears in the Taskbar and is started as proccess and application
in Taskmanager.
My Question is:
Is it possible to communicate with excel without having an running excel.exe proccess?
I thought COM doesnt need an active procces to communicate.
Thx darkbyte maybe anybody else can help too.
|
|
|
|
|
Most Automation Application will be running when you create an instance of them in your application.
The reason being that for most operations to be performed, excel need to be running. This makes things a little complex sometimes. Like trying to do something that pops a dialog box only when certain conditions are met. Then the excel application seems like it is stale, but its waiting for a user to click on the "OK" button of the dialog it just popped.
Same applies to most members of MS Office family.
So, its a definitive NO, you cannot communicate with Excel without having a running excel.exe
COM Automation does require to have an active process.
This of it this way: if you start your program 3 times, you will have 3 different Excel applications running, and this is a good thing. You dont want a process intensive task to prevent your 2 other programs to wait when all they do is a simple task each.
|
|
|
|
|
As it is possible to
"Add to Favorites" using the IShellUIHelper,
is it possible to
set the homepage using IShellUIHelper?
|
|
|
|
|
Nope, it is not possible.
But you could always try and find which registry key keeps this information.
|
|
|
|
|
Hi,
How do I connect to my COM server, written with VS C++ 7.1 (2003). I have been writing COM servers and clients for about 5 years now. For the past 3 or 4 years, I have used the #import statement and the __uuidof operator with smart pointers to connect to my servers with no problem. Now when I try to use __uuidof() in a VS 7.1 client, it throws an exception "Class not registered" when it clearly is registered. Anyone know what's going on?
Thanks,
Royce
|
|
|
|
|
A better and safe way other than smart pointers is invoking the COM runtime and obtaining interface explicitly. Compile the IDL file to get a '.h' and '.c' file. Using CoCreateInstance and QueryInterface methods you can get interface without breaking the code in VC++ 6.0 as well as 7.0. If you are hardcore C++ programmer I suggest you use this method rather than smart pointers. If the same problem persists with this method then it really is a problem I can get with. You can get lotsa tuts on codeproject to using COM without smart pointers. If u need the code lemme know, I hav efunctional client-server code running. May ur problem be solved with this!!!
--:: VANDE MATARAM ::--
|
|
|
|
|
Vande,
Thanks - I'll try your suggestion.
Royce
|
|
|
|
|
Mayur,
Yes, please post your code. I have never tried what you are talking about.
Thanks,
Royce
|
|
|
|
|
Mayur Mahajan wrote:
A better and safe way other than smart pointers is invoking the COM runtime and obtaining interface explicitly.
How is that safer? Raw interface pointers are almost always the source of memory leaks when dealing with COM. Raw interface pointers are for C programmers only, IMO.
Heck, COM is hard even with smart pointers. Why make it harder by using raw pointers?
--
...Coca Cola, sometimes war...
|
|
|
|
|
I know COM is hard. And pointers in C++ is something people like to stay away But I'm a c++ fan and like to get things done the hard way! Also using smart pointers is something like setting references in VB and too 'unornamented' method to understand the workings of COM. /* And memory is sure to leak out of most progs unless u code with a cool head be it COM or C++ objects */
coding n debugging; two sides of same coin
|
|
|
|