[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2009-04-26
1
Medium Priority
?
365 Views
Last Modified: 2013-11-20
Hello,

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
DISP_FUNCTION(testcontrl, "newmethod", newmethod, VT_BOOL, VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR VTS_BSTR)
 
//
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

0
Comment
Question by:Epurchase
1 Comment
 
LVL 1

Accepted Solution

by:
Epurchase earned 0 total points
ID: 24237231
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..

Thanks,

//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 :
public:
enum{ 
dispidnewmethod = 30, ..

Open in new window

0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.

829 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