Control not coming to the new method after .odl modification? [modified]
-
Hi, I had to modify the .odl file for adding one more method. Any idea why its not coming to the newmethod while debugging..I have checked the MIDl and the tlb is created file with res. test.odl
dispinterface _programctrl { [id(30)] boolean newmethod(BSTR var1,BSTR var2, BSTR var3, BSTR var4, BSTR var5); }
The method is coming fine when I have tested on the activextest container but the problem is when I invoke the method it is not coming to the program while debugging..I have opted 30 as id random number.id[30] I have called the method like this testpgm.cppDISP_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.hdispidnewmethod = 30L
Thanks, Rahul..SoftwareDeveloper(.NET)
modified on Sunday, April 26, 2009 9:11 AM
-
Hi, I had to modify the .odl file for adding one more method. Any idea why its not coming to the newmethod while debugging..I have checked the MIDl and the tlb is created file with res. test.odl
dispinterface _programctrl { [id(30)] boolean newmethod(BSTR var1,BSTR var2, BSTR var3, BSTR var4, BSTR var5); }
The method is coming fine when I have tested on the activextest container but the problem is when I invoke the method it is not coming to the program while debugging..I have opted 30 as id random number.id[30] I have called the method like this testpgm.cppDISP_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.hdispidnewmethod = 30L
Thanks, Rahul..SoftwareDeveloper(.NET)
modified on Sunday, April 26, 2009 9:11 AM
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 : public: enum{ dispidnewmethod = 30, ..
Thanks,SoftwareDeveloper(.NET)