|
Fire up the macro explorer. Find a suitable module, or create a new one. Add this to the module:
Sub BuggerOff()
Dim i As Integer
For i = 1 To DTE.Windows.Count()
Dim w As Window
w = DTE.Windows.Item(i)
If w.Caption = "Output" Then
w.Close()
End If
Next
End Sub
Then customize a keystroke to call that function.
--
20 eyes in my head, they're all the same![^]
|
|
|
|
|
|
|
Hi,
I'm porting a Java app to C++ using MFC (I need C++ because I feel java too slow for my needs and I must perform some optimizations on memory management ) and am having serious troubles to create some dialog. Here is the Java/swing dialog I want to create with MFC: http://www.calodox.org/morbac/other/javaform.jpg
The scrollable field contains some groups of controls and the number of these groups may vary during execution time, so I must create them dynamically.
I've already solved the problem of the scrollbar with the tutorial "How to implement a Scrollable Child Dialog" I found here at codeproject, but I can find any good way to put several "Comb pair" boxes together into a single placeholder.
I've tried using the CFormView and CPropertyPage without any success: I don't know how to use the CFormView (and I'm not sure it is a good idea to use it) and the elements of the CPropertyPage disapear when scrolling.
Any idea/advice how I can make it working ?
Thanks in advance
morbac
|
|
|
|
|
I'd put all the controls you needed onto the page at design time and hide/show them at run time.
I believe a form view is a normal window that uses a dialog template. It's probably the way to go, to get a scrolling dialog. You'd actually create an SDI project and use CFormView, then lay out the dialog on the form.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I recommend using a table view (i.e. a CListCtrl control with editable fields) to provide the same functionality. There's ample sample code @ CP to help you do this.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
ok, thanks for answers
I have finally chosen to use an option tree control: http://www.codeproject.com/treectrl/coptiontree.asp
This is a very cool and good looking library (maybe still needs some debug but is almost ok).
Thanks again
morbac
|
|
|
|
|
|
I need to first of all read a line of a file until a newling or '\n'. I would then store that to a string and put it into the first element in the array, then I will turn the previous string to empty then read the line until another newline '\n' and store that line to a string which will be stored at the next array element. I know that I have to allocate the array since I don't know how much lines will be in the array, could be hundreds to thousands of elements but I need to do this in win32. I will do the storing into the array elements until the end of the file is reached. I will be very happy if someone could help me, I so far have the following code:
int *p;<br />
int uc = 0;<br />
string all;<br />
cout <<"has something in it\n";<br />
try<br />
{<br />
p = new int;<br />
}<br />
catch(bad_alloc xa)<br />
{<br />
cout << "Allocation Failure\n";<br />
exit(1);<br />
}<br />
do<br />
{<br />
all = null;<br />
do<br />
{<br />
all = all + data.get(); <br />
} while(data.get != '\n');<br />
p[uc] = all;<br />
uc++;<br />
} while(data);<br />
delete []p;
Please help me, I would appreciate it if someone can make a similair but simpler program like this or help me with this or even an article about this if anyone know something like this.
|
|
|
|
|
Why not use a vector ? Why does it matter that you need to do it in Win32 ? Then use getline() to read the file.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I don't know how to use vectors and I have to do it in win32 is because I already started on a project with it and I can't go back and change its type... it would take too long. I also don't know how to use getline().
|
|
|
|
|
Snyp wrote:
I have to do it in win32 is because I already started on a project with it and I can't go back and change its type
What I asked is why does it *matter* that you're using Win32 ? The Microsoft libraries sit on top of the C++ language and should only be your first port of call if you're trying to do something OS specific, like throw up a window. Stuff C++ doesn't support.
Snyp wrote:
I don't know how to use vectors
Snyp wrote:
I also don't know how to use getline().
I have articles on this site on both, use the search box above.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Ok I think I know how I'm going to do this, first if I find the getline() function and how it works I will get the line store it to first element and then on and on until the end of file is reached. I will then use a sort to sort the big list.
|
|
|
|
|
Yes, exactly. One benefit of the STL is you get your sorting algorithms for free.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Thankyou very much, I don't use the stl alot to none but I think you made me 'cross over'
|
|
|
|
|
Then my job here is done
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
I need one more thing, I can't seem to find the getline function anywhere, can you tell me in which subtitle it is located in, like files or c++/mfc or whatever...
|
|
|
|
|
|
#include <vector>
#include <algorithm>
#include <functional>
What do those headers mean
|
|
|
|
|
vector contains the dynamic array vector class. algorithm contains all the algorithms that work on STL containers ( well, most of them ), and functional contains stuff you need to write your own function objects ( from memory ).
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
Sry about that but I was looking at codeproject articles... wow what a nice collection there is at cplusplus.com
|
|
|
|
|
I need one more thing, I can't seem to find the getline function anywhere, can you tell me in which subtitle it is located in, like files or c++/mfc or whatever...
|
|
|
|
|
Snyp wrote:
...if I find the getline() function and how it works...
Try here.
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
i tried to convert the code showed in this article (http://www.codeproject.com/bitmap/screencapture.asp) to non-mfc Standard Win32 code, with a bit of WTL. I came up with this:
void CMainDlg::CopyWndToClipboard(HWND pWnd )
{
CBitmap bitmap;
CClientDC dc(pWnd);
HDC memDC;
RECT rect;
memDC = ::CreateCompatibleDC(dc.m_hDC);
::GetWindowRect(pWnd,&rect);
bitmap.CreateCompatibleBitmap(dc.m_hDC, rect.right-rect.left,rect.top-rect.bottom );
CBitmap* pOldBitmap= (CBitmap*)(HBITMAP)::SelectObject(memDC,&bitmap);
::BitBlt(memDC,0, 0, rect.right-rect.left,rect.top-rect.bottom, dc.m_hDC, 0, 0, SRCCOPY);
::OpenClipboard(::GetParent(pWnd)) ;
EmptyClipboard() ;
SetClipboardData (CF_BITMAP, (HBITMAP)bitmap ) ;
CloseClipboard () ;
SelectObject(memDC,pOldBitmap);
bitmap.Detach();
}
Which doesn't seem to work. All is does is throw some rubbish on the clipboard.
Does somebody know a function to replace my code or does somebody know what i'm doing wrong?
Thanks
|
|
|
|
|
The problem i think its because of Detaching bitmap at the end.
Comment out that and try.
May be you can move Bitmap variable to class variable.
Hope this helps!!!
|
|
|
|