Add new method/ Modify .odl file: control not coming to the new method while debugging

Posted on 2009-04-26
Last Modified: 2013-11-20

I have got a requirement to add a new display method in activex. I have added that and modified the .odl. When I debugged the activex using ActiveXtestContainer, it is found that the new method is displaying fine but  the control is not coming to the new method when invoked..All other existing methods were working..I have randomly given the id as 30 as uptil 29 was allocated. The code sample of the way I have tried is given..

When I checked the folder it is found that, the tlb, and res files have been created and it was by midl /mktyplib203.

Can any body help to figure out what is wrong and why its not debugging the new method added..Did I miss any thing..

Thanks In advance..
//test.odl : part of added code in .odl

dispinterface _programctrl


[id(30)] boolean newmethod(BSTR var1,BSTR var2, BSTR var3, BSTR var4, BSTR var5);



//testpgm.cpp : part of added code in cpp



BOOL testpgm::newmethod(LPCTSTR var1,LPCTSTR var2,LPCTSTR var3,LPCTSTR var4,LPCTSTR var5) 


return TRUE;



//testpgm.h : part of added code in h

dispidnewmethod = 30L

Open in new window

Question by:Epurchase
    1 Comment
    LVL 1

    Accepted Solution

    I have resolved the issue finally with the following changes to the code given..

    What I found was the DISP_FUNCTION usage couldn't exactly trace the id of the method..Instead when I used DISP_FUNCTION_ID, it started working..I have noticed that the DISP_FUNCTION_ID call having a parameter option to pass dispid of the method as well..Not sure why the DISP_FUNCTION couldn't work but anyhow my issue got resolved with DISP_FUNCTION_ID..

    Similarly in the .h file I have changed 30L to just 30. Rest all are same..


    //changed part of the code in testpgm.cpp 
    DISP_FUNCTION_ID(testcontrl, "newmethod",dispidnewmethod, newmethod, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR)
    //changed part in testpgm.h :
    dispidnewmethod = 30, ..

    Open in new window


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Better Security Awareness With Threat Intelligence

    See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

    Suggested Solutions

    Title # Comments Views Activity
    Which IDE to use to begin C++ training? 5 54
    List out all word 7 189
    mapAB Challlenge 35 50
    Change to event 1 48
    Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
    Before we dive into the marketing strategies involved with creating an effective homepage, it’s crucial that EE members know what a homepage is. In essence, a homepage is the introductory, or default page, of a website that typically highlights the …
    The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
    This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now