Whenever I use MMCPropPageCallback() with MFC (either static or dynamic), I get a link error as follow. Any suggestion for me? Thank.
mmc.lib(apimfc.obj) : error LNK2005: "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) already defined in mfc42d.lib(MFC42D.DLL)
mmc.lib(apimfc.obj) : warning LNK4006: "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) already defined in mfc42d.lib(MFC42D.DLL); second definition ignored
Same for STATUS_SXS_EARLY_DEACTIVATION
Posted by landonb
on 09/20/2006 04:37pm
I had a similar problem with MMC.lib, but at runtime.
If you see any thing like this:
(adc.57c): Unknown exception - code c015000f (first chance)
[Where c015000f <==> STATUS_SXS_EARLY_DEACTIVATION]
You'll want to check the include of MMC.lib. I had to pull some stuff out of AFX.h and include it before MMC.lib, i.e., "mfc80d.lib mfcs80d.lib msvcrtd.lib MMC.LIB"
The library was causing activation context pollution whenever a thread exited, and also when making some SetupDi calls, like SetupDiCallClassInstaller.
///////// MMC.LIB UAFXCWD.LIB UAFXCW.LIB /////////////
I believe you need to force VC8.0 to load UAFXCWD.LIB before MMC.LIB. You ca
n do this via the project property settings: Linker | Input | Additional Dep
It worked for me.
I have a similar problem building with VS2005 and unicode:
uafxcwd.lib(afxinl2.obj) : error LNK2005: "public: __thiscall AFX_MAINTAIN_STATE2::~AFX_MAINTAIN_STATE2(void)" (??1AFX_MAINTAIN_STATE2@@QAE@XZ) already defined in mmc.lib(apimfc.obj)
Did you manage to solve your problem?
This sample is nice. But I am facing some problem to invoke an wizard.
I have created an extension snpins (extending IExtendContextMenuImpl for 'Active directory users and compuetrs') and added a menu item 'Invoke' under 'NEW'. I followup the coding as described in this sample, but I am getting m_spConsole as NULL while invoking this menu and as result I am unable to invoke wizard successfully. How I can proceed? Have any idea?
Nice article and helpful source code. I'm now running some small test programs successfully with stand alone and extensions. However I have not found a way to pass custom data from the primary to the extension. For example, after the extention is loaded, I need to pass some dynamically-ccreated data (by the primary) to initialize the extension. I would greatly appreciate it if someone can point the way or even share some code.
Good article and source code. I learnt a great deal about building MMC snap-ins.
I have a question that I hope someone can answer. I have just implemented renaming of MMC a node in the scope pane and want to reorder the nodes alphabetically. Unfortunately, the ability to position nodes using SDI_PREVIOUS, SDI_PARENT...etc is only available when inserting new nodes. How then do you reorder existing nodes? Obviously you could remove the old node and create a new node with the new name, except that MMC crashes if you do it while handling the MMCN_RENAME notification. Any ideas?
I am experimenting with a snapin for mmc and I have problems with the help.
I tryed setting the pat for the help file (.chm) to another directory where I have my file. The help didnt work (only shows mmc help). When I returned to the old pat it didnt work again. I am always inserting the snapin newly in a console file but it is the same. I tryed different types of recompiling but all I could manage is to have the web pages being displayed when I invoke a help for certain node but my help itself is not shown under the help of mmc. Is the path being cashed somewhere because the recompiling (which also does the registration) does not helps. I tryed the same stuf on your code and I got the same problems.
I implemented multiselect in my snapin and it works fine in Windows 2000 - MMC 1.2. but on Windows XP - MMC 2.0 i have a little problem, i don't see any context menu to select an option, only the standard toolbar is active.
Any Info about changes in MMC version 2.0 related with multiselection?