Hello everybody, I have a custom list and I use SharePoint created forms for that list (NewForm.aspx, EditForm.aspx, ...). One of these forms, i.e. NewForm.aspx has some controls on it, e.g. textbox, dropdownlist, etc. How can I define and attach an event handler function for one of these controls? for example the dropdownlist's item_changed. I am using visual studio developer tools for sharepoint. I would appreciate if someone replies to me. Thank you in advance, Roozbeh.
Roozbeh69
Posts
-
Event handler for controls on a SharePoint form -
Need help to return string value from COMI assume that you don't use attributes in your project, and you want to have a property named 'Title' of type BSTR (COM string type) in your IDL file: interface IYourInterface: IDispatch{ [propget, id(1), helpstring("property Title")] HRESULT Title([out, retval] BSTR *pVal); [propput, id(1), helpstring("property Title")] HRESULT Title([in] BSTR newVal); }; in the header file of your object: public: STDMETHOD(get_Title)(/*[out, retval]*/ BSTR *pVal); STDMETHOD(put_Title)(/*[in]*/ BSTR newVal); private: _bstr_t m_bstrTitle; // variable holding the property value and in the implementation file of your object: STDMETHODIMP CYourClass::get_Title(BSTR *pVal) { *pVal = m_bstrTitle.copy(); return S_OK; } STDMETHODIMP CYourClass::put_Title(BSTR newVal) { m_bstrTitle = _bstr_t(newVal); return S_OK; } -- modified at 15:53 Monday 19th June, 2006
-
Keyboard focusHi everybody, I have a WTL wizard generated MDI application with a form (Dialog based) view. The form has several controls on it. When it looses the focus (for example because of showing a message box) and then gets the focus again, the last active control wont have keyboard focus (In fact the first control gets the keyboard focus instead). I want to know why it happens and what the solution is? Thanks in advance
-
How to disable list view items?Hi Michael, Thank you so much. That's very kind of you. I use your articles before and they help me so much. I wish best things in your life. yours sincerely, Roozbeh.
-
How to disable list view items?Hi everybody, I want to disable a list view item. I know that I should use SetItemState method, but I don't know how. thank you in advance.
-
Getting messages generated by toolbar buttons click?Hi everybody, I have created a WTL MDI application. When it runs and the childframe window opens in the mainframe, I can capture the command messages generated by menu items selection in the OnForwardMsg handler of the childframe window. But I can't get the messages generated by toolbar buttons click with the same menu items identifiers. I want to know what is wrong here. Why can't I get command messages by toolbar buttons click in the childframe window? yours, Roozbeh.
-
How to use ExecWB method?Hello everybody, Does anybody know how I can use the method ExecWB of the WebBrowser control for opening a file on the local machine: ExecWB(OLECMDID_OPEN, OLECMDEXECOPT_DODEFAULT, ?, ?); I don't know the use of parameters 3 and 4. I Also don't want to use Navigate method because of the download prompting. thanks in advance Roozbeh. -- modified at 4:14 Saturday 3rd September, 2005
-
How to catch events?Thank you very much for your help. Regards, Roozbeh
-
How to catch events?Hi everybody, Does anybody know how to catch Microsoft word application events in a non MFC application (specifically WTL application) ? thanks in advance, Roozbeh
-
How to catch events?Hi everybody, Does anybody know how to catch Microsoft word application events in a non MFC application (specifically WTL application) ? thanks in advance, Roozbeh
-
How to use "GetWindowProc"?Thanks a lot for your help. Regards Roozbeh.
-
How to use "GetWindowProc"?Hi Everybody Does anybody know how to override the GetWindowProc method? I want to handle some specific messages in my own window procedure and direct the others to the base WndProc. Regards Roozbeh.
-
How to override WndProc?Hi everybody, I have created an MDI application with WTL Application Wizard. I want to handle some command messages (such as those generated when a user selects a menu item) in the active mdi child window. Since these messages are captured by the mdi main frame window, I think I should route these messages to mdi child window procedure and therefore override the mdi main frame's WndProc. Am I right? If so how can I reach this method? Would you please get me the answer in details with code? Thanks in advance. Yours Roozbeh.
-
How to call methods of an appobject directly?Hello everybody, I am a beginner in com programming, and i have a question: I have created an ATL 3.0 project including a simple object named MyObj with the attribute of 'appobject' on it's coclass. It has a property named MyString that holds string values. I have successfully built it and then tested it from vb. I have access to MyString property directly without instantiating MyObj. everythings is Ok. but I have problem with VC. From a Console application which has access to that type library (via import directive) MyString property cannot be accessed without qualification. With the statement: MyString = "Hello world!"; compiler generates following error: error C2065: 'MyString' : undeclared identifier what is the problem? do you think i should use a special syntax? if so, would you please help me to know how i can use it? thanks in advance Roozbeh
-
Calling methods of an appobject COM object?Hello everybody, I am a beginner in com programming, and i have a question: I have created an ATL 3.0 project including a simple object named MyObj with the attribute of 'appobject' on it's coclass. It has a property named MyString that holds string values. I have successfully built it and then tested it from vb. I have access to MyString property directly without instantiating MyObj. everythings is Ok. but I have problem with VC. From a Console application which has access to that type library (via import directive) MyString property cannot be accessed without qualification. With the statement: MyString = "Hello world!"; compiler generates following error: error C2065: 'MyString' : undeclared identifier what is the problem? do you think i should use a special syntax? if so, would you please help me to know how i can use it? thanks in advance Roozbeh
-
How to call methods of an appobject directly?Hello everybody, I am a beginner in com programming, and i have a question: I have created an ATL 3.0 project including a simple object named MyObj with the attribute of 'appobject' on it's coclass. It has a property named MyString that holds string values. I have successfully built it and then tested it from vb. I have access to MyString property directly without instantiating MyObj. everythings is Ok. but I have problem with VC. From a Console application which has access to that type library (via import directive) MyString property cannot be accessed without qualification. With the statement: MyString = "Hello world!"; compiler generates following error: error C2065: 'MyString' : undeclared identifier what is the problem? do you think i should use a special syntax? if so, would you please help me to know how i can use it? thanks in advance Roozbeh
-
Using CSplitterWindow with MFC?Hi everybody, Does anybody know, how I can use a WTL splitter window in an MFC 6.0 project? I want to have a more flexible splitter window in my MFC application. please explain it in detail. thanks in advance, Roozbeh.
-
Help me, pleaseHi everybody, Does anybody know, how I can use a WTL splitter window in an MFC 6.0 project? I want to have a more flexible splitter window in my MFC application. please explain it in detail. thanks in advance, Roozbeh.
-
Using CSplitterWindow with MFC?Hi everybody, Does anybody know, how I can use a WTL splitter window in an MFC 6.0 project? I want to have a more flexible splitter window in my MFC application. please explain it in detail. thanks in advance, Roozbeh.
-
How to use a WTL splitter windowHi everybody, Does anybody know, how I can use a WTL splitter window instead of a CSplitterWnd in an MFC 6.0 project? I want to have a more flexible splitter window in my application. please explain it in detail because I don't know much about WTL. thanks in advance, Roozbeh.