none
develope OneNote addin in C++ and ATL RRS feed

  • Question

  • I want to create a addin for OneNote using C++ and ATL. I refer to the example of this link: 

    https://www.codeproject.com/Articles/8016/Developing-an-Office-COM-add-in-with-VC-ATL.

    I just implemented this interface _IDTExtensibility, which is in the  MSADDNDR.DLL type library, and Let this add-in display a window to test. I registered it  in Word and it work normally. But when I registered it in OneNote, there was a error:a runtime error  occurs during loading the add-in. I do above work on office2016 and vs2015. And I also repeat it on office2010 and vs 2010. The same error occured. IIs this method unsuitable for OneNote? Can anyone help me? Thanks! 
    Here's a part of my code:

    //Connect.h

            . . .

    STDMETHOD(OnConnection)(LPDISPATCH Application, ext_ConnectMode ConnectMode, LPDISPATCH AddInInst, SAFEARRAY * * custom) { MessageBoxW(NULL,L"OnConnection",L"Native Addin",MB_OK); return S_OK; }

    . . .

    //Connect.rgs

    . . .

    HKCU
    {
        NoRemove Software
        {
            NoRemove Microsoft
            {
                NoRemove Office
                {
                    NoRemove OneNote
                    {
                        NoRemove Addins
                        {
                            OneAddinATL.Connect
                            {
                                val Description = s 'Sample Addin'
                                val FriendlyName = s 'Sample Addin'
                                val LoadBehavior = d 3
                            }
                        }
                    }
                }
            }
        }
    }






    Monday, November 13, 2017 2:34 PM

All replies

  • Hi ruemng_rumeng,

    generally we provide support for C# and VB.

    I can see that you are using the C++ ATL.

    so I escalate this issue to some senior engineers and further they will try to provide you suggestions to solve the issue.

    until they provide any suggestion to you , please have some Patience.

    Thanks for your understanding.

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Tuesday, November 14, 2017 7:22 AM
    Moderator
  • Hi Deepak. thanks for your help. I also tested my add-in in Excel and it worked fine. So I want to know if C++ and ATL only support main office applications, such as Word, Excel, etc., but do not support office applications which are used less by users. If it does, is there a way to develop OneNote add-ins using C ++ and ATL? Also, thank you for reminding.
    Wednesday, November 15, 2017 9:35 PM
  • Hi ruemng_rumeng,

    I have met the run-time error issue before when I developed a OneNote com add-in using C#. The progress of loading com add-in is different between OneNote and other Office products.

    I developed an OneNote add-in for 32-bit OneNote on 64-bit Windows. And I got the run-time error when I try to build the dll for the target any CPU and x86. After I changed it to x64, the run-time error was fixed. 

    If you were also developing with same scenario with mine and to verify whether this issue was caused by this, you can kill all the progress of dllhost.exe or restart the computer to start a clean environment. And then try to load the add-in again in OneNote. After that you should can find this progress in the Task Manager. If the loath of this dll is C:\Windows\System32, then you can try to build the solution to x64 to see if helps. And if the loath of this dll is C:\Windows\SysWOW64, the x86 target platform should work.

    Please let me if it helps. 

    Regards & Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, November 20, 2017 9:52 AM
    Moderator
  • Hi,

    I am facing same issue, can you share if you found a solution for this ?

    Friday, September 11, 2020 9:15 AM