POST
|
Yes it is C++. I've got one COM object MyCommand class ATL_NO_VTABLE CLogoLayerCommand :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CMyCommand, &CLSID_MyCommand>,
public ISupportErrorInfo,
public IMyCommand,
public ICommand The tool is created using the following code in the onClick() method hr = m_ipGtScopeLayer.CreateInstance(CLSID_CustomLogoLayer); The tool part is declared as follow : class ATL_NO_VTABLE CMyTool :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CMyTool, &CLSID_MyTool>,
public ISupportErrorInfo,
public ICustomLogoLayer,
public ILayer,
public ILayerEffects,
public IPersistStream
... View more
03-19-2012
02:05 AM
|
0
|
0
|
622
|
POST
|
It's arcmap 9.3.1 build 40500 with service pack 2. Yes it's a dll that I register with regsvr32. It's a custom component then. In the button part of the code which is a ICommand, as in the exemple code LogoLayer, the onCreate method contains only m_ipApp = hook; the onClick() method contains the creation of the tool. My tool is a ILayer, some initialisations are made in an init() method, some code in the Draw() method using computations made in another DLL. Even without clicking on the Button, when the code into the Draw() method is commented, the program works, when not, the debugger stops on the heap issue. Wondering if the COM objects creation settings have been well done in visual, I tried to put my code in the custom logo layer cexample code. It does the same : heap issue if the draw method code isn't commented even if I don't push the button. edit : after going a little further, I notice that the declaration of one my object into the .h file of the layer could cause problems. It is declared as MyObject *_pMyObject; That object is never used. But when i comment that declaration, arcmap seems ok. Turning MyObject *_pMyObject; to MyObject _myObject; stills throw the heap problem. But adding MyObject *_pMyObject; in the .h of a new Custom logo layer example code doesn't reproduces the problem.
... View more
03-15-2012
02:37 AM
|
0
|
0
|
622
|
POST
|
I think it's an add-in button and tool : it provides a new button into arcmap. I don't know how it has been created, I did not start the project but I think it was from scratch using the visual studio 6 wizard. For the exit button, I talked about the ArcMap's built-in Exit button.
... View more
03-14-2012
12:45 AM
|
0
|
0
|
622
|
POST
|
Hello, I'm debugging a plug-in for arcmap. Arcmap crashes just after the exit button is pressed. These crashes appear on windows vista 64 sp2 or vista 32 (don't remember if sp) but not on windows xp sp3. According to the crash log produced by arcmap, it appears that I have some heap issues, so I debug with page heap activated. Almost starting from scratch, I took the logo layer example code in which I gradually added my code. My plug-in adds a button which creates my tool. The tool and the button are two separate COM objects. The button is always created, but the tool object is created only if I push the button. Now, I added some code in the tool part, the code is not executed, the tool object isn't even created, but arcmap crashes. Without that part of code, it does not. It doesn't seem to be dependent of that part of the code, when I comment it and add some code elsewhere (which won't be executed too), arcmap crashes the same way. adplus tells me : corrupted heap pointer or using wrong heap xx : Heap used in the call xx : Heap block xx : Block size xx : Heap owning the block Any idea or debugging strategy I could start with ? Thanks.
... View more
03-13-2012
07:55 AM
|
0
|
6
|
752
|
POST
|
Hello, In my ILayer, I check the projection system by calling the get_Name(&name) method. However, when I have a new data frame and want to create an instance of my layer, get_Name doesn't return. It is a way to avoid that ? thx.
... View more
05-17-2011
03:42 AM
|
0
|
0
|
386
|
POST
|
Hello, I'm developing a plug-in that creates a layer. Many layers can be created sharing an HMI for user entry. I use IActiveViewEvents to catch add/delete events. I store the id of the layers, and the HMI can act only on the layers that are showed. That works pretty well, anyway, I have some issues : - if my layer is created inside a data frame or a layer group and when I delete the data frame or the layer group, my layer doesn't receive a delete event. Then I should catch the "delete data frame event" and the "delete layer group event". Is it possible to read the id of a layer (the one that is given when the event ItemAdded(VARIANT Item) is received), and of a map ? - when I load the layers using IPersistVariant, when the load method is called, the ICommand that I take the IMxDocument object from isn't yet initialised, so I can't wire to IActiveViewEvents. Then as these layers don't receive an AddLayer event, I don't have their id. Then is it possible to have the IMxDocument object by another method ? thanks
... View more
10-06-2010
01:35 AM
|
0
|
0
|
657
|
POST
|
Hello, I'm attempting to use IActiveViewEvents to catch any table of contents changes. Following http://edndoc.esri.com/arcobjects/9.1/ArcGISDevHelp/DevelopmentEnvs/Cpp/ArcGIS%20Development/eventhandling.htm, I should instanciate my class extending IActiveViewEvents using new. However visual won't do that, as told in http://support.microsoft.com/kb/181265 due to the pure virtual function error. Now I'm attempting to use IDispEventImpl as in http://msdn.microsoft.com/en-us/library/06wtz4t5%28v=VS.80%29.aspx . I should derive my class from IDispEventImpl. Putting public IDispEventImpl</*nID*/ 1, CMyClass,&__uuidof(IActiveViewEvents)>
seems OK, but filling SINK_MAP failed, I used BEGIN_SINK_MAP(CMyClass)
SINK_ENTRY(1,__uuidof(IActiveViewEvents), 3, OnContentsChanged)
END_SINK_MAP() Here, I'm stuck. Should my class implement IActiveLayerEvents too ? Thanks all.
... View more
07-13-2010
06:31 AM
|
0
|
0
|
971
|
Online Status |
Offline
|
Date Last Visited |
11-11-2020
02:23 AM
|