|
Please, help me to find tutorial or a samples how to do it
|
|
|
|
|
I am also trying to achieve same what you are trying to.
If you find any answer or any link please share.
|
|
|
|
|
NOTIFY_HANDLER (IDC_LISTVIEW, LVN_BEGINLABELEDIT, OnGridBeginEdit)
LRESULT OnGridBeginEdit(int idCtrl, LPNMHDR pnmh, BOOL& bHandled)
{
RECT rcpos;
// size rcpos to the subitem rect...
HWND hwnd_edit = m_lv.GetEditControl();
CComboBox combo;
combo.Create(m_lv,&rc_pos,_T("drop_list"),CControlWinTraits::GetWndStyle(0) | CBS_DROPDOWNLIST);
combo.AddString(_T("a"));
combo.AddString(_T("b"));
combo.AddString(_T("c"));
string sText="a";
combo.SelectString(-1,stext.c_str());
combo.ShowWindow(SW_SHOW);
run a local messageloop that exits on VK_CANCEL | VK_RETURN | WM_MOUSEDOWN on other windows
// read out the combo
combo.DestroyWindow();
return -1; // prevent the standard edit control
}
|
|
|
|
|
Hi. I'm working in a software wich has a system menu, an icon tool bar, and recently, i've added another tool bar just down the other.
I've been using AddSimpleReBarBand(...) to create them, but i would like to control this last tool bar to make it appear and disappear when i want.
I've tried to destroy it, and it does, but i can't make disappear the space made to place the menu.
Could anyone tell me the way to do it? It seems not to be very difficult, but a can't find the way.
Thank you in advance.
Ricard
|
|
|
|
|
Hi again! I still don't have the solution (maybe it's not as easy as i thought) and i've been thinking for another possibility.
Well, the main toolbar occupies half of the width, so it would be possible to place the second toolbar just next to the first one. Then, it would be ok to manipulate it without affecting any vetical spacing. But, of course, i've found another problem. When i place the second toolbar it is placed very far from the first one, and it falls out the menu. I've tried to fix the length with the AddSimpleReBarBand(...) parameters, but it doesn't seem to work.
I've been checking the 4th and 5th parameter. 4th seems to be a width (maybe the toolsbar's width?) and 5th is a boolean that seems to avoid minimizing the toolbar. Well, none of the them seems to change my toolbar separation. Any idea?
Let me know your experiences with atl toolbars. Any opinion will be very useful for me. Thank you all!
Ricard
|
|
|
|
|
I'm coding an ATL IE plugin as the article from msdn(below is the link)
http://msdn.microsoft.com/en-us/library/bb735853(VS.85).aspx
I did step by step as it describes in the dll part, but there is no responding of the Exec method which should run when I click my tool menu 'Image Download'. I can debug into the STDMETHODIMP CImageFetcher::SetSite(IUnknown* pUnkSite) method.
I have no idea where I made a mistake, any one can help?
Thanks previously!
|
|
|
|
|
|
Dude what is your damage? Why have you asked this question in this forum?
What do you do just pick a random forum?
That is an Operating Systems / SysAdmin[^] question.
Come on man at least make an effort. I mean you are asking people here to help you for free and you can't even make the effort to put your question in the correct forum, how lame is that?
led mike
|
|
|
|
|
Hi
I Create a ATL Dialog box and I host a Webpage on Dialog using CAxWindow and webpage having 1 close button, I want when user click that close button (Which call window.close()), My Dialog is Close without any Internet Explorer Alert Notification. What can I do in my Workspace to Remove this Notification.
Thanks in Advance.
|
|
|
|
|
I want to something like serialization using string , but don't know whether the string class in STL supports this any way.
Thanks.
system
|
|
|
|
|
Are you saying you want to save a string to a file? If so, then this code illustrates how to write a string to a file and the different mechanisms available when reading strings from a file.
None of them are totally satisfactory, as it's difficult to determine where the original string's end was after it's been written to a file. To be more reliable, I'd probably write the string length out first, as that will tell you how many characters to read in. Other approaches (e.g. quoting the string) would work, but would require you to process the string, escaping quote characters.
#include <iostream>
#include <iomanip>
#include <fstream>
#include <string>
int main(int, char**)
{
{
std::ofstream a("a.a");
std::string s = " Hello World";
a << s << std::endl;
}
{
std::ifstream a("a.a");
std::string s;
a >> s;
std::cout << s << std::endl;
}
{
std::ifstream a("a.a");
std::string s;
a >> s;
std::cout << s << std::endl;
}
{
std::ifstream a("a.a");
std::string s;
getline(a, s);
std::cout << s << std::endl;
}
}
|
|
|
|
|
Well, the 2nd and 3rd parts are the same.
Do you know to do std::string serialization?
system
|
|
|
|
|
Whoops - the line a >> s; in the third part should have been a >> std::noskipws >> s;
followait wrote: Do you know to do std::string serialization?
What do you mean by serialization? If you want a generic serialization framework, then look at Boost.Serialization[^]. Otherwise....well, you need to define what you mean by serialization.
|
|
|
|
|
Stuart Dootson wrote: What do you mean by serialization?
save/load the object
It seems that I should learn Boost first.
system
|
|
|
|
|
followait wrote: save/load the object
Yeah, there's no standard way of doing that, really. Either you use some framework such as the one in MFC, or the one in Boost, or you have to work out how you're going to it yourself.
If only it were as easy as in (say) .NET or Python, where serialization is a standard concept.
|
|
|
|
|
Hi everyone:
I have this Single Document Interface MFC project that has quite a lot of code in it (mostly View/Doc interaction and lots of CString usage). Now I came to a realization that I have to convert it into Multiple Document Interface project. By doing so I will need a tab control for the documents, docking bars for side controls, splitter windows, etc. My original thought was to develop all the GUI myself, but then I came across the WTL 8.0. I played around with some of their samples and it sounds very promising.
My question is, or maybe I should better say, what would you suggest - shall I try to switch this SDI MFC project into an MDI WTL 8.0 (I believe it now supports MDI as well), or shall I tough it out and stick with good-ol' MFC (and poor GUI)?
Thanks in advance!
|
|
|
|
|
I haven't tried with VC 8 or later, but in 6 you can certainly use MFC and WTL in the same app. You'll need to tweak the WTL headers a bit and change a couple references to "CDC" to "CDCT<1>" but I think that's the only error you'll hit. I haven't actually tried MFC and WTL together in a while, those problems might have been fixed in a newer VC or WTL.
|
|
|
|
|
Hi
I Create a ATL Modelless Dialog Box and Host Webpage on Dialog Box using CAxWindow , I want that tab and Accelerators work on Webpage , But delete Key , Tab Key , Enter Key ...
Keys are not working properly , I use code from CodeProject Site.
http://www.codeproject.com/KB/atl/cdialogmessagehook.aspx
But this code is not working for me , in InstallHook I gave my DialogBox Handle .
Thanks in Advance.
|
|
|
|
|
I'm using ATL and c++ to develop an Add-in for Microsoft Word. The problem
that I'm having is that the parameters for the events that I'm trying to
capture aren't being filled with data. They're essentially null. The
problem is only happening with events that pass back more than one parameter.
The events that I am trapping are DocumentOpen, NewDocument,
DocumentBeforePrint, and DocumentBeforeSave
DocumentOpen, and NewDocument event trapping work fine.
The dispinterface is ApplicationEvents2; I've also tried using
ApplicationEvents3, and ApplicationEvents4 with the same results.
/***********************************************
* IDL for DocumentOpen, NewDocument and DocumentBeforePrint
* and DocumentBeforeSave
************************************************/
[id(0x00000004), helpcontext(0x00061a84)]
void DocumentOpen([in] Document* Doc);
[id(0x00000009), helpcontext(0x00061a88)]
void NewDocument([in] Document* Doc);
[id(0x00000007), helpcontext(0x00061a86)]
void DocumentBeforePrint(
[in] Document* Doc,
[in] VARIANT_BOOL* Cancel);
[id(0x00000008), helpcontext(0x00061a87)]
void DocumentBeforeSave(
[in] Document* Doc,
[in] VARIANT_BOOL* SaveAsUI,
[in] VARIANT_BOOL* Cancel);
/**********************************************
* Here is the SINK_MAP
***********************************************/
BEGIN_SINK_MAP(MyAddin)
SINK_ENTRY_INFO(1,__uuidof
(Word::ApplicationEvents2),4,DocumentOpen,&DocumentOpenInfo)
SINK_ENTRY_INFO(1,__uuidof(Word::ApplicationEvents2),9,NewDocument,&NewDocumentInfo)
SINK_ENTRY_INFO(1,__uuidof(Word::ApplicationEvents2),7,DocumentBeforePrint,&DocumentBeforePrintInfo)
SINK_ENTRY_INFO(1,__uuidof(Word::ApplicationEvents2),8,DocumentBeforeSave,&DocumentBeforeSaveInfo)
END_SINK_MAP()
/******************************************************
* Here are the ATL_FUNC_INFO structures I've declared
*******************************************************/
_ATL_FUNC_INFO NewDocumentInfo = {CC_STDCALL,VT_EMPTY,1,
{VT_DISPATCH|VT_BYREF}};
_ATL_FUNC_INFO DocumentBeforePrintInfo = {CC_STDCALL,VT_EMPTY,2,
{VT_DISPATCH|VT_BYREF, VT_BOOL|VT_BYREF}};
_ATL_FUNC_INFO DocumentOpenInfo = {CC_STDCALL,VT_EMPTY,1,
VT_DISPATCH|VT_BYREF}};
_ATL_FUNC_INFO DocumentBeforeSaveInfo = {CC_STDCALL,VT_EMPTY,3,
{VT_DISPATCH|VT_BYREF, VT_BOOL|VT_BYREF, VT_BOOL|VT_BYREF}};
void __stdcall MyAddin::DocumentOpen(IDispatchPtr ptr)
{
//Process DocumentOpen Event
}
void __stdcall MyAddin::NewDocument(IDispatchPtr ptr)
{
//Process NewDocument Event
}
void __stdcall MyAddin::DocumentBeforePrint(IDispatchPtr ptr, VARIANT_BOOL*
pvtCancel )
{
//The __vfPtr in ptr comes back as 0x00000000. I don't know why
}
void __stdcall MyAddin::DocumentBeforeSave(IDispatchPtr ptr, VARIANT_BOOL*
pSaveAsUI, VARIANT_BOOL* pCancel )
{
//The __vfPtr in ptr comes back as 0x00000000. I don't know why
}
|
|
|
|
|
I've just tried this with a modified version of Microsoft's 'ATLEventHandling' sample (which happily uses Word::ApplicationEvents too). I think you'll find that replacing the IDispatchPtr with IDispatch* will solve your problem. A COM interface will always pass a raw pointer, not a managed one - managed COM interface pointers are purely VC++ (_ptr_t ) and ATL (CComPtr ) inventions.
Anyway - the code I used was:
void __stdcall DocumentBeforePrint(IDispatch* doc, VARIANT_BOOL* pvtCancel )
{
*pvtCancel = VARIANT_TRUE;
Word::_DocumentPtr pDoc(doc);
CComBSTR bstrName;
if (pDoc)
pDoc->get_Name(&bstrName);
}
This cancelled print operations and retrieved the document name successfully.
HTH.
|
|
|
|
|
Your suggestion did not work for me.
I am using VC6 on Windows XP sp3 using Word 2003.
I'm willing to bet when you step through your code if you check the value for doc->IUnknown->__vfptr has a value other than 0x00000000 in it. Mine comes up with 0x00000000 and of course once I get to
Word::_DocumentPtr pDoc( doc );
I get the dreaded and tiresome 0xC0000005 access violation error.
Any other thoughts on this?
|
|
|
|
|
The only thing I can suggest is going to something that has been demonstrated to work (i.e. the Microsoft ATLEventHandling sample that I used - I modified the CNotSoSimple class in that to have the DeomentBeforePrint method). Try that. If that doesn't work, there's clearly something not right with the setup on your machine.
BTW - I was using VS2008 + Word 2007.
|
|
|
|
|
The platform was the trick. I switched to vs2005 and the program ran as expected. Thanks for the input.
|
|
|
|
|
I've created a CSplitterWindow that works perfectly except when resized. My Code[^] I use SetWindowPos to move the splitter as my "view" is resized, while sizing there is alot of flicker. How does the CSplitterWindow update it's panes when the splitter is moved so smoothly? Any suggestions would be greatly appreciated.
Thanks,
Nathan
|
|
|
|
|
Nathan Going wrote: How does the CSplitterWindow update it's panes
Not sure what you mean. Everything in windows get's painted more or less the same way, in response to a WM_PAINT message.
Perhaps you can rephrase your question for clarity?
led mike
|
|
|
|
|