|
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.
|
|
|
|
|
Neelesh K J Jain wrote: but I doubt whether boost/interprocess is present in VC++ 2008.
No it's not - but it's open source and has a nice license, so why not just download it (Boost Consulting have Windows installers for Boost[^] - use the 1.38.0 version) and use it?
If you restrict yourself to just what comes with VS2008, you'll make a lot of work for yourself.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hello Stuart,
Thanks alot for the information / suggestion. But still I have a doubt.
I am not creating either the key or its value dynamically and as well how its possible to recieve the actual size of the map that is shared from other process using the Named Shared memory. Can you please point me into this concept, If you can share any documents or information URL, that would be great so that I can understand much more thoroughly about the maps.
Thanks once again,
Regards,
Neelesh K J Jain.
|
|
|
|
|
Neelesh K J Jain wrote: I am not creating either the key or its value dynamically and as well how its possible to recieve the actual size of the map that is shared from other process using the Named Shared memory
The map definition in Visual Studio's map class is effectively this:
template<class Key, class Value>
class map
{
_TreeNode<std::pair<Key, Value> >* _Myhead;
size_type size;
};
_TreeNode is this:
template<class Value>
class _TreeNode
{
_TreeNode* _Left;
_TreeNode* _Right;
_TreeNode* _Parent;
Value _Myvalue;
char _Color;
char _Isnil;
};
So, you can see that a map object contains only its size and a pointer to the head of the tree it uses to contain its elements. It uses a red-black tree (I think - or it could be an AVL tree?) because that makes it easy to maintain an element ordering.
Does that answer your query?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Full Marks, I got it, I was thinking, there is something wrong in my code, for that reason, only the size is being retrieved and not the data. I have an explanation now for using the boost/interprocess/map.hpp
Thanks alot.
Thanks and Regards,
Neelesh K J Jain.
|
|
|
|
|
Hi!
I have made an ATL composite control and i want to use it in Siemens ProTool(is like an activex
container with editing and runtime mode).
In runtime mode everything works ok, but in editing mode my control in not drawn is just
gray rectangle with text in it (ATL : Compostie Control).
The reason for this is that container in editing mode fires just OnDraw function...
So is there any way to draw my composite control also in OnDraw function, because it will be nice
to see controls also in editing mode.
I find some solutions where you just override OnDraw function and then you draw something wich
looks like your composite control, but is there any way to draw control that looks like in runtime
(or Resource editor).
Can also someone tell me wich class or function in responsible to show control in runtime mode?
If you want i can post my code.
Best Regards,
Igor
|
|
|
|
|
can i know something about iinternetprotocol. HOw i buid a ATL application with using this interface.
Cheeerzzz
jooohn
modified on Monday, May 4, 2009 6:55 AM
|
|
|
|
|
hiiiii
HOW do i debug ATL (dotnet 2008) project step by step.and its a DLL project.
Smile
jooohn
|
|
|
|
|
I would like to copy file from local to remote machine using WMI in C++. Not quite sure how to do this.
According to MS doc, "Win32_Directory" can be a good candidate. Anybody got idea? Thanks in advance.
Jack Rong
|
|
|
|
|