|
I have take this sample program at microsoft.com
ms knowledgebase 238228 how to create office2000com addin in vb
and trying to create addin for office application. I am using the sample with
IDTExtensibility2. the problem is when using this sample i can't get the event to DocumentBeforeSave,DocumentBeforeClose some how
anyone has sovled this problem?
Shin
|
|
|
|
|
|
hi - i wanted to know what code i need so that i can click a button with a url as the buttons command, so that the data from the xml file will appear in the richtextbox.
the data from the xml file ( on the web ) will appear in the textbox
the button parts etc are all sorted its just the part that reads from the web ( xml file ) to the textbox.
Thanks
|
|
|
|
|
Hi there,
Perhaps use IXMLHTTPRequest object?
e.g. on the button handler:
IXMLHTTPRequestPtr pXMLHTTPReq = NULL;
try
{
pXMLHTTPReq.CreateInstance(__uuidof(XMLHTTP40));
if (pXMLHTTPReq)
{
CString strURL = "my.url.com";
pXMLHTTPReq->open("GET", (LPCTSTR)strURL, VARIANT_FALSE);
pXMLHTTPReq->send();
m_strRichTextBox = (LPCTSTR)pXMLHTTPReq->responseText;
UpdateData(FALSE);
IXMLDOMDocument2Ptr pXMLDoc = NULL;
pXMLDoc.CreateInstance(__uuidof(DOMDocument40));
if (pXMLDoc)
{
if (pXMLDoc->loadXML(pXMLHTTPReq->responseText))
{
}
else
{
}
}
}
}
catch(_com_error& e)
{
TRACE1("Exception: %s", e.Description())
}
Any questions, just ask
Hope this helps,
Andy
|
|
|
|
|
What is the CallBack function? How to use a CallBack function? When to use?
Can someone help me? I am a beginner.
curiosity
|
|
|
|
|
curiosity5374 wrote:
What is the CallBack function?
A user supplied function. (Example: WndProc)
curiosity5374 wrote:
How to use a CallBack function?
A callback (function pointer) is usualy passed as an argument to anouther function, so that it can be called back to process some of the information required for that function.
Examples:
1) qsort(elem1,elem2,compare) where compare is the callback function.
2) SetTimer(hWnd,nIDEvent,uElapse,lpTimerFunc) where lpTimerFunc (timer procedure) is the callback function.
curiosity5374 wrote:
When to use?
When a function you are calling requires it, or when a structure (or class) requires it as a member variable (normaly passed as argument to some other function).
INTP
|
|
|
|
|
Nice answer but I would like to add something to 'when to use'
Callback function is used to get events without having to keep on polling them or keep waiting for them in a loop
For example lpTimerFunc mentioned above will be called when the time is elapsed,the program need not bother about it in meantime and continue to do other tasks
|
|
|
|
|
How about:
When your program is written in C instead of C++.
In 'C', since you want to allow the 'client' to override some basic functionality, you need to provide a callback - the client provides the pointer to his function that will do the special processing.
In 'C++' you can just provide a stub virtual fuction in a base class and the client can create a derived class and override the virtual function to do something special for his purposes.
Sounds like a good test question...
|
|
|
|
|
Hi,
I currently have both a keyboard and mouse hook (both non-low-level) to monitor various events. Occassionally, I need to block both types messages after my hook function processes them, so the hook Proc function returns -1. The problem is that the mouse hook is inserted first, and so when that function returns -1, the keyboard proc is never called, so my application can't process the events it needs to. Is there some way I can work around this or should I change my hook setup? According to MSDN, a JournalRecord hook shouldn't modify the messages that it recieves. So any suggestions would be appriciated.
Thanks,
Aaron Stubbendieck
modified 12-Jul-20 21:01pm.
|
|
|
|
|
maybe a WH_GETMESSAGE hook can do this...
|
|
|
|
|
Actually, that seems like the right kind of hook to use, I'll switch to that and see how it works.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
I am having a problem with a treeview not showing tooltips. I'm using Borland builder C++ which uses VCL (MFC for Borland).
The treeview has the TVS_INFOTIP style set but not the TVS_NOTOOLTIPS style. I have verified that the WM_NOTIFY message is not getting sent to the parent window or the treeview itself. So unless I am missing something, the TVN_GETINFOTIP notification message is not being sent.
Has anybody else run into this type of problem?
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Well, I figured out what my problem was. I USE $%@@ing Borland Products. Stupid software deletes the window and recreates it when you try to re-parent a form window. This results in your tooltip controls attached to the treeviews being deleted.
I HATE VCL!!!!
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Hey can anyone possibly give me some tips on how i can make a detachable dialog that can be inserted back into the main part of the main dialog or poiint me to an article about it i did a seach here but only 3 artciles came up and non where what i was looking for
i think the thing im looking for is a dialogbar but i havent seen any articles on how to use them let a lone using them in a dialog based app
thanks for all the help
|
|
|
|
|
Hello.
I've made a MFC SDI app with the AppWizzard. The main window is a CFormView child, with an associated dialog. I've created another dialog (IDD_D2), and with the appwizzard i've created another class, a CFormView child, and i've associated it to the new dialog IDD_D2.
The project is called jmn. In jmnView.h & jmnView.cpp i've got the main window. The new CFormView is in other files.
Should i declare an object for the new CFormView i've created? where? in jmnView.h?
How do i create, show it, and close it?
i know that with dialogs you've got the DoModal function. I don't want a dialog, i want a resizable window, that's why i want a CFormView child.
thanks!!
|
|
|
|
|
Depends on what you're really trying to do. If you wanted to use your formview, in your app's InitInstance() you'll see something like:
CSingleDocTemplate* pDocTemplate;<br />
pDocTemplate = new CSingleDocTemplate(<br />
IDR_MAINFRAME,<br />
RUNTIME_CLASS(CTest1Doc),<br />
RUNTIME_CLASS(CMainFrame),
RUNTIME_CLASS(CTest1View));
AddDocTemplate(pDocTemplate);<br />
replace your formview's class name with whatever you named it with in the wizard. e.g. above CTest1View would be replaced with the name of your form view.
I may have missed something else but I believe that is basically it. If on the other hand you want to keep your appwizard's auto generated formview and your formview, you'll have to either switch views and/or use a splitter window implementation to show both views simultaneously. This is usually done in mainframe.cpp. HTH.
|
|
|
|
|
that's not really what i meant, sorry..
i don't want to change the main view. What i want, is to open another window, for example when i press a button. If i used a dialog, i would use the DoModal method, but i want to open a Frame window, a window which i could resize. i think i didn't have to use the word CFormView
|
|
|
|
|
Does anyone have code that downloads a file from the internet and saves it into a file. I know I have to use this:
HRESULT URLDownloadToFile( LPUNKNOWN pCaller,
LPCTSTR szURL,
LPCTSTR szFileName,
DWORD dwReserved,
LPBINDSTATUSCALLBACK lpfnCB
);
But I am not sure how I get this to work.
-Ryan M.
|
|
|
|
|
CString strUrl = _T("http://ravib.com");
CString strFilename = _T("C:\\ravib.txt");
HRESULT hResult = ::URLDownloadToFile (NULL, strUrl, strFilename, 0, NULL);
if (hResult != S_OK)
error(); /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
|
|
Hey can someone please point me to an article about how to set up a keyboard accelerator in a dialog based application i didnt see a link for stuff on accelerators here :P
|
|
|
|
|
|
:-Opleas help my to creat a graphic veiw to telnet aplication
thenk for all
|
|
|
|
|
Im having trouble using sockets with MFC
i have downloaded many examples
but everytime i try to compile my own they wont work
i need a simple tutorial to get me started with them
i would also like to figure out how to use sockets without MFC
|
|
|
|