|
Your question has nothing to do with ATL/WTL/STL. In addition it seems that you have asked this same question several times. I have given you a generic answer[^] in the past. In the future you need to be more specific and describe the problem you are having with greater detail.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi,
I have created ATL project as a server (.exe) and add Simple Object in it with Aggregation,SupportInfo,Connectable objects. Now I trying to write Addin for Word,Exccel and PPT. I have created same project for all three applications. Now I want add these 3 applications interfaces and events in a single application, which i created first. Now I am trying to add Interfaces of Word into a main file by adding its interfaces and events information in mail applications .h file. I am expecting it should create .idl from it and it will contain all the interfaces of word.
But the problem is when I am compiling the code it first overrites the .h file where I have added Interface and events for word. Also I have added _cp.h, .h and .rgs files for word but it gives me following error
"error MIDL2337 : unsatisfied forward declaration :" or undeclared interfaces.
Pls let me know how can i add all these three applcaitons Interfaces and events into a single application.
Thanks
SNI
|
|
|
|
|
SNI wrote: I am expecting it should create .idl from it and it will contain all the interfaces of word.
What makes you think that? YOU create the IDL in an ATL project and IDL generates the C and H files.
Do you actually need the Word, Excel and PowerPoint items in the IDL? If not, then I'd use #import[^] in the .cpp file to reference them.
|
|
|
|
|
Hi,
I have a simple ATL server project created with VS2008 (e.g. IDummy)
with an connection point event (e.g. Fire_test) and a stand-alone thread.
My thread should notify all connected clients with the specified event.
How can I accomplish this?
Maybe using EnumConnectionPoints, but how?
Any examlples?
Thx in advance
|
|
|
|
|
a) make sure the ATL server uses an appropriate threading model (e.g. free threading)
b) Make sure the thread has a pointer to the C++ class instance underlying your COM object.
c) call the COM object's Fire_test method.
The important thing is to make sure teh thread has visibility of the C++ object instance, not just the COM interface pointers - otherwise, it won't see the Fire_test method.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
|
Hey, guys.
I'm chasing some DEP voodoo with an IE add on and older versions of ATL have known issues in this regard. What I need to do is configure the project to specifically use ATL version 8 and nothing older, but for some reason I'm drawing a blank on how to specify this (I'm clearly spending too much time with C# these days!). It's a C++ dll project in VS 2005.
Any insights would be most appreciated.
Thanks!
|
|
|
|
|
Christopher Duncan wrote: What I need to do is configure the project to specifically use ATL version 8 and nothing older
The only way that the version of ATL can be reconfigured is to use a different version of Visual Studio, IIRC? There's only one version of ATL comes with each version of Visual Studio - Visual Studio 2005 has ATL 8, so if you rebuild with VS2005, you are, by definition, only using ATL 8?
So, unless you're manually setting include directories to point at an older ATL, I'm not sure what else you can do.
One last thing - you are obviously seeing usage of ATL older than ATL 8 - what have you seen that tells you that?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
#include <atldef.h>
#if _ATL_VER < 0x0800
#error This project requires ATL version 8 and nothing older
#endif // _ATL_VER < 0x0800
cheers,
AR
|
|
|
|
|
I don't actually have VS2005 installed (I don't use it - I've only got VS2003 and VS2008 installed) - and those only have one definition of _ATL_VER (0x900 for VS2008, 0x0710 for VS2003) so by interpolation, I'd presume the same for VS2005.
That implies that the compiler's finding the wrong atldef.h, so I'd suggest checking which atldef.h you're actually including - either by using the /P option (pre-process only) to the compiler and looking at the generated file for atldef.h, or using Process Monitor[^] to track which atldef.h the compiler finds.
Why would it find the wrong atldef.h? Project settings, the INCLUDE environment variable?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Good points. This project was originally created in VS 2003, and I know that the merge module used by the Wise installer currently includes ATL 7.1. However, I'm able to reproduce the bug in my dev environment from VS 2005 so I doubt that's the (only) issue.
You know, I've been away from in the trenches C++ for quite a few years now, and I feel I'm missing something fundamental conceptually. Regardless of _ATL_VER, at runtime how does my dll know which version of the atl.dll to load and reference? Is that handled internally in the version of the ATL code included in that version of the compiler (and driven by _ATL_VER), or are there other mechanisms at play.
Honestly, I don't recall feeling this stupid when I did C++ for a living...
|
|
|
|
|
Christopher Duncan wrote: at runtime how does my dll know which version of the atl.dll to load and reference
It doesn't - it'll go for the first one on the path.
You can statically link against ATL - open the project properties, go to General->Use of ATL and select Static Link to ATL. If you do that, then the version of ATL is fixed at build-time.
Christopher Duncan wrote: Honestly, I don't recall feeling this stupid when I did C++ for a living...
That's what C# does for you
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Stuart Dootson wrote: That's what C# does for you
Ain't it the truth...
|
|
|
|
|
Hi, Alain.
This makes sense, but isn't there also a dll involved, and if so, how do I guarantee that the appropriate version is being referenced since there could obviously be any number of versions on target machines?
|
|
|
|
|
Hi Christopher
Christopher Duncan wrote: isn't there also a dll involved
There is no need of any dll with atl since 7.1: set the Use of ATL property to Static Link to ATL on the General property page and set the Runtime Library property to Multi-threaded (/MT) on the Code Generation property page (C/C++ folder).
See Redistributing ATL and OLE DB Templates[^] for more.
cheers,
AR
|
|
|
|
|
Hadn't thought of static linking to verify the problem. Thanks for the help!
|
|
|
|
|
Statically linking solves everything.
|
|
|
|
|
Hey, Stuart.
Thanks for the help. We're chasing a DEP/NX related bug with an IE8 add on, and while we don't have proof, our sources at MS indicate that ATL is a known issue in this regard, thus we're investigating that possibility.
The simple truth of the matter is I don't know for sure which version of ATL is being referenced. I am assuming that part of the show involves an atl.dll, and I'm not finding one with a product version of 8.0, but I'm admittedly swinging in the dark here.
|
|
|
|
|
Hi,
I am very new to ATL and am working on ATL dll project and am finding it very difficult to debug the application, so if any 1 of u can help me out here by telling me how to debug these application.
Thanking u in advance
|
|
|
|
|
Tell the ATL DLL project what executable should be run in order to invoke the DLL, set breakpoint(s) on the DLL code and start the debug! That's all there is to it, really.
Has to be said, you've been a little stingy with detail about what you're finding difficult, so it's quite difficult to help you really...
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks for the support, as i posted in ma query am very new infact this is ma 3rd day in visual c++ , so i dont know much about any of this stuff....
Can u plz tell me in little more detail how to set executable path so than i can put break point and start debugging it. Right know am just executing the project and registering the DLL...
Thanks for ur Support
|
|
|
|
|
Looking at the documentation[^] will help you. For debugging COM objects, there is this page[^].
Also - please make sure you've got the 'Debug' configuration selected before you start debugging.
[edit]PS - (and this is a message for your bosses) Is a little training too much to expect before you ask people to use complex software like Visual Studio???[/edit]
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello All,
I have a standard map of type map<string, fileinfo=""> populated in one process and retrieving the values in another process using shared memory concept. The memory is being shared from the server and the client is retrieving the number of pair, but not the values. I am using the following code on the client side for retrieving
HANDLE hOptimizationShared = OpenFileMapping(FILE_MAP_READ, FALSE, szOptimizationShared );
if ( hOptimizationShared != NULL )
{
pOptimizeBuffer = (std::map<string, FileInfo> *)MapViewOfFile(hOptimizationShared, FILE_MAP_READ, 0, 0, 0);
HANDLE hEvent;
if ( pOptimizeBuffer != NULL )
{
mapFileDetails.insert(pOptimizeBuffer->;begin(),pOptimizeBuffer->;end());
UnmapViewOfFile(pOptimizeBuffer);
}
}
The second condition check is getting validated, and i can see proper size of the map, but the elements are not present.
Please help in solving this issue.
Thanks in advance.
Regards,
Neelesh K J Jain.
|
|
|
|
|
That's because a map uses dynamic memory that either a) lies outside the shared memory area, or b) won't be found because the virtual memory address of the shared memory is different in the two processes.
If you need to share a map across processes using shared memory, I'd suggest you use a map that has been expressly designed for that purpose[^].
Oh - and make sure none of the keys or values reference any dynamically allocated memory either, 'cause that won't work either.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Thanks stuart for the information and reply,
but I doubt whether boost/interprocess is present in VC++ 2008. Because I couldn't able to map it.
Thanks,
Neelesh K J Jain.
|
|
|
|