|
i want to create a dialog to get another app 'message ,
in the snapin->initialize()
i use this code to create a code
AFX_MANAGE_STATE(AfxGetStaticModuleState()); <br />
CSnapinDlg * dlg=new CSnapinDlg;<br />
dlg->DoModal();
but have a error dlg in runtime ,,the error info is:
debug assertion failed
program:C:\windows\system32\mmc.exe
file:f:\dd\vctools\vc7libs\ship\atlmfc\include\afxwin1.inl
line:24
how can i create a dialog ,,
can com object handle the wnd message?
thanks
|
|
|
|
|
Can any body please tell me how can I create a taskpad View to a particular
node Pro Programmatically.
|
|
|
|
|
Hello all,
I try to compile this sample but I got errors:
--------------------Configuration: MMCSnap - Win32 Unicode Release MinDependency--------------------
Creating Type Library...
Microsoft (R) MIDL Compiler Version 5.01.0164
Copyright (c) Microsoft Corp 1991-1997. All rights reserved.
Processing D:\projects\mmc1\MMCSnap.idl
MMCSnap.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oaidl.idl
oaidl.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\objidl.idl
objidl.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\unknwn.idl
unknwn.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\wtypes.idl
wtypes.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\ocidl.idl
ocidl.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\oleidl.idl
oleidl.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\servprov.idl
servprov.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\urlmon.idl
urlmon.idl
Processing C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\msxml.idl
msxml.idl
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\urlmon.idl(489) : error MIDL2025 : syntax error : expecting a type specification near "SECURITY_ATTRIBUTES"
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\urlmon.idl(523) : error MIDL2025 : syntax error : expecting a type specification near "DWORD"
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\urlmon.idl(764) : error MIDL2025 : syntax error : expecting a type specification near "HRESULT"
C:\Program Files\Microsoft Visual Studio\VC98\INCLUDE\urlmon.idl(765) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
Error executing midl.exe.
MMCSnap.dll - 4 error(s), 0 warning(s)
I dont know how to fix, is there any body how can help please?
|
|
|
|
|
Salam :
I have built your project and install the resultant dll file,
but when I click on HelpTopic from Help menu, I did not see
your help file integrated with microsoft help.
Can you tell me why ?
I want to add my help file to mmc HelpTopic, but I could not.
Any help please ?
Thanks very much
|
|
|
|
|
I want to develop two MMC Snap-Ins. One is adding a popup menu item on specific node. And another is adding a contextmenu under the popup menu. But they are two different Snap-Ins(dll files), when I handle the AdddMenuItem function, I don't know how to find the popup menu ID which is adding by another Snap-Ins, so I don't know what value I fill into the lInsertionPointID in the COMTEXTMENU struct.
Is there any solution for my problem , thanks.
|
|
|
|
|
when ever i change the images for the Right pane , the MMC does nt initialise , As eg if in Scope Pane there is a node Chocolate and on clicking Chocolate the result in Right pane Diffrent types of chocolate and with diffrent name bt the image does nt change can u help.
HBITMAP m_hSmallBmp = LoadBitmap(_Module.GetResourceInstance(),MAKEINTRESOURCE(IDR_SMICONS));
if (m_hSmallBmp != NULL)
{
HBITMAP m_hLargeBmp = LoadBitmap(_Module.GetResourceInstance(),MAKEINTRESOURCE(IDR_LGICONS));
i tried to change IDR_SMICONS & IDR_LGICONS but it gave error
i be thankful
|
|
|
|
|
i wanna create a new menu(Printing) whn any user right chicks the any item in result pane . I want a property page should be opened or any new page .
i be thankful
|
|
|
|
|
Hi,
I have implemented a Snap-In that displays PropertySheet/Page as a reaction to some specific action, and needs to process data entered in the dialog.
I implemented OnApply() in the class derived from CSnapInPropertyPageImpl and it gets called whenever user clicks on [OK]. So far so good.
From within OnApply() I do input validation and depending on success, I either do nothing [return FALSE] or call PropertyChangeNotify().
The latter is taken from the article -
HRESULT PropertyChangeNotify(long param)
{
return MMCPropertyChangeNotify(m_lNotifyHandle, param);
}
I understand that it should send a notification with a "user-defined" value param somewhere (I am no longer sure whether it would be node the had the property sheet created or perhaps IComponent class with lpDataObject == 0). I don't think in my case anyone receives the notofication.
Either way, I tried to dig into what's happening with a debugger and I don't see this event being processed.
I am however sure that MMCPropertyChange is being called. I just cannot figure out what happens from that point on.
Any ideas?
|
|
|
|
|
I had the same problem. The sample for CMsgViewNode::InvokeWizzard is wrong for the scope pane in the else condition. If it is a scope pane, you need to pass TRUE to the last parameter in AddPrimaryPages function. Also, be sure that bCreateHandle is TRUE.
|
|
|
|
|
In my project, MMC scope elements are derived from "CSnapInItemImpl".
I can access "Properties" of such elements by right-clicking and select "Properties" menu item, which calls the standard "CreatePropertyPages ()".
I would like to access to the same property pages by another way : a menu item other than "Properties".
I suppose it is possible because I saw that in EventViewer : right-click on "Application", click on "View", click on "Filter..." => property pages are displayed.
I tried a lot of things, none managed : I can't retrieve the "LPPROPERTYSHEETCALLBACK lpProvider" parameter of "CreatePropertyPages ()" from which I could use "AddPage ()".
Is there a message to send to display "Properties" ?
|
|
|
|
|
J'y suis finalement parvenu :
Ajout d'1 fonction membre "InvokePropSheet ( bool & bHandled, CSnapInObjectRootBase * pObj )" à la classe.
Dans la déclaration de la classe, ajout de "SNAPINCOMMAND_ENTRY ( MCID_, InvokePropSheet )" (appui sur le menu "MCID_" => appel à "InvokePropSheet ()").
MSDN explique la procédure à l'URL :
"http://msdn.microsoft.com/library/default.asp?url=/library/en-us/mmc/mmc/using_ipropertysheetprovider_directly.asp"
Malgrè ça, le code ne fonctionnait pas, et je m'en suis sorti en récupérant du code d'1 sample :
"
HRESULT CMsgViewNode::InvokePropSheet(bool& bHandled, CSnapInObjectRootBase* pObj)
{
CComPtr<iunknown> pUnk;
HRESULT hr = CoCreateInstance(CLSID_NodeManager, NULL,CLSCTX_INPROC_SERVER,IID_IPropertySheetProvider, (void**)&pUnk);
if (FAILED(hr))
return S_FALSE;
CComQIPtr<ipropertysheetprovider,&iid_ipropertysheetprovider> spPSProvider(pUnk);
CComPtr<idataobject> spDataObject;
hr = GetDataObject(&spDataObject, CCT_SCOPE);
if (FAILED(hr))
return S_FALSE;
hr = spPSProvider->CreatePropertySheet(L"Property", FALSE, (long)this, spDataObject,MMC_PSO_NEWWIZARDTYPE);
if (FAILED(hr))
return hr;
_ASSERTE(pObj != NULL && (pObj->m_nType == 1 || pObj->m_nType == 2));
HWND hWnd=NULL;
if (pObj->m_nType == 2) // Result Pane
{
IComponent* pComponent;
hr = ((CSimpleComponent*)pObj)->QueryInterface(IID_IComponent, (void**)&pComponent);
spPSProvider->AddPrimaryPages(pComponent, TRUE, NULL, FALSE);
if(pComponent != NULL)
pComponent->Release();
((CSimpleComponent*)pObj)->m_spConsole->GetMainWindow(&hWnd);
}
else //scope pane
{
IComponentData* pComponentData;
hr = ((CSimple*)pObj)->QueryInterface(IID_IComponentData, (void**)&pComponentData);
spPSProvider->AddPrimaryPages(pComponentData, TRUE, NULL, FALSE);
if(pComponentData != NULL)
pComponentData->Release();
((CSimple*)pObj)->m_spConsole->GetMainWindow(&hWnd);
}
hr = spPSProvider->Show((long)hWnd,0);
if (hr == S_FALSE) // recover from a failed Show
{
spPSProvider->Show(-1,0); // frees wizard resources
// held by MMC
return S_FALSE;
}
return hr;
}
"
|
|
|
|
|
How can i implement Multiselect in my MMC Snapin. ever you tried that ?
|
|
|
|
|
How i can display a PropertyPage when Doubleclick?
|
|
|
|
|
Hi,
I'm getting a compiler error:
C:\MMC\MMCSnap\basenode.h(157) : error C2061: syntax error : identifier 'IDisplayHelp'
According to microsoft, 'IDisplayHelp'should be defined in mmc.h, but it isn't.
Can anybody help?
Regards Martin
|
|
|
|
|
Check if it's surrounded in #ifdef block
|
|
|
|
|
Hi,
I've got an MMC app which uses the standard CreatePropertyPages functionality. This all works fine. But, the OnApply() on each page is called regardless of which page in the set has been altered. This again is fine, until I put a call to a function x which only needs to be done once in the OnApply of one of the pages. This function is now getting called n times where n is the number of pages that have been activated.
Has anyone got a smart way of ensuring that this function x only gets called once during a save of the property sheet? (Typically, I'd like to store a 'been-run' flag in the property sheet, but I don't know how to get at the context in MMC. Also, the order in which the pages are saved seems to be variable).
Any help appreciated.
DaveT
|
|
|
|
|
Hello Everybody,
I am trying to build and compile these example (Developing MMC Snap-Ins using ATL).However I am getting the following linking error. Cannot figure out what could be wrong.What be greatful if anyone can guide me what is wrong.
THanks
Kapil
Creating library Debug/MMCSnap.lib and object Debug/MMCSnap.exp
MMCSnap.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
StdAfx.obj : error LNK2001: unresolved external symbol "void __cdecl operator delete[](void *)" (??_V@YAXPAX@Z)
MMCSnap.obj : error LNK2001: unresolved external symbol "void * __cdecl operator new[](unsigned int)" (??_U@YAPAXI@Z)
Debug/MMCSnap.dll : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.
MMCSnap.dll - 4 error(s), 0 warning(s)
|
|
|
|
|
http://groups.google.com/groups?q=unresolved+external+symbol+%22void+%5F%5Fcdecl+operator+delete
|
|
|
|
|
when i compile with ms visual stdio 6.0 there was an error but whe i compile with MSVS 2003 all was good
Niko
|
|
|
|
|
Hello everybody,
I am trying to build and compile the example mentioned in these article. However I am getting compiling errors
as
StdAfx.cpp
cannot convert parameter 1 from 'char [29]' to 'unsigned short *'
Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
#pragma hdrstop cannot be inside an #if block
#pragma hdrstop cannot be inside an #if block
Error executing cl.exe.
MMCSnap.dll - 3 error(s), 0 warning(s)
Do I have to run MMC in my desktop to run these sample.
Please guide..
Kapil
|
|
|
|
|
thanks to this wonderful forum
very very good!
|
|
|
|
|
Hello all, thanks to this wonderful forum for providing a platform to share technical problems.
PROBLEM:
We've developed a MMC Snap-In and it loads (shows) properly when we login to the machine with a user having Administrator rights of that machine, but the Snap-In doesn't get displayed if a non-administrator user logs into that machine and tries to view it.
Your timely response will be very helpful for us.
Regards,
Aadil
|
|
|
|
|
hi,
I have executed your code on my machine(Win2k/WinXP) ,there is a strange problem when i tried to do this.
I build the code in debug mode and ran it. on pressing the help menu HTML help opened up and the snap-in help was clubbed with the MMC.
Now i changed the help file to some other .chm file( say MyChm.chm )and again ran the code, but this time no help was shown( although i made the necessary changes in Funtion GetHelpTopic() and OnShowContextHelp() ).
To make myself satisfied i rollback all the changes. Now the code is same as i had downloaded. Running again no help was shown.
If i do this process on other machines similar pattern occours.
Please help. I want to add my HTML help with my snap-in.
anshulso@noida.hcltech.com
|
|
|
|
|
Hi,
It was a long time since i looked at mmc snapins. One thing i remember
is that when you run from .msc file it will do a great deal of caching.
Did you pre-create .msc file and opening your snapin through it?
|
|
|
|
|
thanks Leon,
No i did not precreat .msc file.
I have now figured out the exact problem.
This may appear to be very strange but it is so, i have checked the same on 5 different machines.
Steps to reproduce the problem are:
1) Run your code , it will run fine.
2) change the .chm file path in code to MyHelp.chm ( this is a .chm which is using Japaneese font), nothing gets displayed. Although if i open my MyHelp.chm from explorer it open up.
3) Now undo the changes.Rerun your code.Table of contents does not appear, only the .hmt page which we specified during call to ShowTopic()is shown.
4) Now even if you try other .chm files , none will get executed with your code.Not even on rebooting the system.
Please guide what is wrong:
1) My .chm, but why/how can a .chm file do such thing.
2) something missing in my undestanding.
How can i send my chm to you for test
Regards
Anshul
|
|
|
|