|
I overrided the open file dialog handler. I want to get names of files inside the file selecting area simultaneously while navigating through files with arrow keys. I see that domodal function opens the dialog but i cannot find how i can do the things above.Thanks for helps coming. (MFC)
|
|
|
|
|
Subclass the CFileDialog
then you have methods that do, what you want.
like: OnFileNameChanged or OnFolderChanged or onLBSelChangedNotify
|
|
|
|
|
Well, based on suggestions I got from members of CodeProject and CodeGuru, and reading too much MSDN literature, I finally got a PropertySheet w/ PropertyPages to be firmly planted inside the client area of my app's View in an SDI application. It even works!
However, according to things I've read, I should be able to use TCS_VERTICAL and TCS_RIGHT in a ModifyStyle() call to move the tabs to the right side of the control. It took some finagaling, but finally wrote the following code to do it:
<br />
CTabCtrl *pTabs = m_pMyPropSheet->GetTabControl();<br />
pTabs->ModifyStyle( 0, TCS_VERTICAL | TCS_MULTILINE | TCS_RIGHT, 0 );<br />
When I do this, the tabs do move - but I lose the text on each of the tabs, and they get drawn in such a funky way as to not really display properly, and I have to click on tab2 to get things to redraw properly (except the text is still not there).
Here's another really wierd thing: Right after the GetTabControl() call, while running in the debugger, the pTabs variable has a valid pointer in it. However, if I then do this:
<br />
TCITEM tci;<br />
pTabs->GetItem( 0, &tci );<br />
The pTabs variable immediately gets a NULL in it. Say Whaaat??
What am I missing? I know one of you Masters out there probably could solve this in your sleep... Any help would be greatly appreciated!
BTW - I'm using Visual Studio 6, writing in C++, and am coding on a win98 box.
Many Thanks.
|
|
|
|
|
ThePilgrim wrote:
However, according to things I've read, I should be able to use TCS_VERTICAL and TCS_RIGHT in a ModifyStyle() call to move the tabs to the right side of the control. It took some finagaling, but finally wrote the following code to do it:
A better way would be to specify the style on creation, but if you want to use ModifyStyle() , call RedrawWindow() afterwards to force the control to redraw itself. As for the text disappearing, sorry, can't help there.
ThePilgrim wrote:
Right after the GetTabControl() call, while running in the debugger, the pTabs variable has a valid pointer in it. However, if I then do this:
TCITEM tci;
pTabs->GetItem( 0, &tci );
The pTabs variable immediately gets a NULL in it.
You have to initialise the TCITEM structure before you call GetItem() .
TCITEM tci = {0};
tci.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM | TCIF_STATE;
tci.pszText =
tci.cchTextMax =
pTabs->GetItem( 0, &tci ); You have almost definitely found a memory-smashing bug caused by not initialising the structure.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ah! Many, Many thanks, Ryan.
I have to use the ModifyStyle() method because the Create() is on the PropertySheet and it ignores these styles. The ModifyStyle() is actually the one for the associated TabCtrl that the PropertySheet set up (which I get hold of via GetTabControl() after the Create() ). But I will try the RedrawWindow() bit.
Thanks, also, for the info on the TCITEM thing. Yeah, I can see now where that would really mess up memory!
-----------------------------
In the meantime, I've tried an experiment with adding a CTabCtrl (from the resource editor) to my view pane, and by using the settings it comes with (in the properties box in the resource editor), I've been able to get vertical tabs, with vertical text, even! However, now how do I attach my PropertyPages/Dialogs to the tabs? I'm thinking of maybe dispensing with the PropertySheet part altogether - unless that's unwise?
|
|
|
|
|
Well! I stumbled upon a solution, believe it or not...
The RedrawWindow() call did not do a thing. What I ended up doing was:
<br />
pTabs->SetCurFocus( 1 );<br />
pTabs->SetCurFocus( 0 );<br />
Which simulates hitting the second tab then going back to the first one. How bizzare is that!
Then, to get the text to show up (which I KNOW is there) on the tabs, I did the following:
<br />
CFont NewFont;<br />
NewFont.CreateFont (14, 0, 2700, 0, 800, TRUE, 0, 0, 1, 0, 0, 0, 0, _T("Arial") );<br />
pTabs->SetFont (&NewFont);<br /> The 2700 in the third parameter is the key: It states that the line the characters follow is rotated 270 degrees counterclockwise (ie, 90 degrees clockwise).
Voila! The tab titles showed up! Guess that's what the tab control in the resource editor does for me behind the scenes. Anyway, all is well now, and I even have my PropertPages showing up and everything...
Just thought anyone reading this thread would like to know a solution...
|
|
|
|
|
I'm working on a project that needs VERY accurate timing (to an order that none of the built-in windows timers will work). I have a card that I'm getting count information from that is also able to produce accurate timing counts in the form of interrupts. Unfortunately for me , I've never done anything at all with interrupt handling! All the information I've seen thus far shoots right over my head. Can anybody help? Articles, links, code, tutorials, anything appreciated. Thanks!
Phil A.
|
|
|
|
|
Hello:
I am at the very beginning of a project using USB. This is a USB device that records digital data (data logger) that is afterwards transfered to a PC.
What is the classified as: interupt, bulk or isochronous? None of them seem to fit. It is digital data so I need error checking so isochronous is out. If understand it correctly bulk is for drives. Iterrupt is for small packets of data, and there may be large amounts of data in the data logger, and ideally it should be synchonous transfer.
Any ideas? Thanks in advance
|
|
|
|
|
Does the device stream the data to the PC in real time? If so, then it is almost certainly isochronous. Otherwise it's a bulk data transfer. Interrupt transfers are not intended for data transfer. They just alert the host that there is data available to be read.
I assume you're writing the driver, otherwise you don't need to know what transfer method it uses...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
I've got a custom control, and i've registered it
WNDCLASS windowclass;
.
.
.
windowclass.style = CS_DBLCLKS | CS_PARENTDC;
i want to add a border to it... adding WS_BORDER to the styles doesn't work
any ideas?
thanks!
|
|
|
|
|
Wouldn't you have to handle the WS_BORDER style yourself for a custom control? If that style is set, on drawing/painting your control, you'd have to draw the border.
|
|
|
|
|
i got it
in the resource editor, i changed the ExStyle of the custom control from 0x0 to 0x1.
just got lucky by playing!
|
|
|
|
|
oh cool,
good find. never had to use it myself. learn something new everyday )
jubjub
|
|
|
|
|
I need a fast way to parse Header files to obtain a list of function within an add-in written for MSDEV 6
Is there any related topic to this?
Thanks,
Nic
|
|
|
|
|
It's a slightly frustrating process
I'm currently doing an UML-editor, where I parse header files to import them into the editor. There are several things to take care of - so I'm doing a multi-pass parse. First, you'll have to get rid of comments, the "/* */" variety. I do this by loading the file into a single CString and just cuttong them out.
Then, I parse the file into separate lines. For each line, trim it, check if the beginning of the line contains the string "class ". If you find any "{}"'s before the next ';', this is not an ahead declaration, but rather the class declaration itself.
Collect the lines after the first '{' and before the last '}' (you can loop, keeping a count until you reach a matched pair). The next operation is to get rid of all inline functions. Cut everything between "{}" (including the brackets themselves, of course. You also want to strip lines from any "//" to the end.
Now, you can start parsing the lines in a state machine. One state is the access "markers", "public", private "protected". Another state is "variable declarations". Those are the lines ending in a ';', but with no parantheses '(' or ')' in the line. Split them from the last space, and the left part will contain the declaration, the right the variable name. The third state is lines ending with a ';', containing '('s and ')'s. You can get the function name by splitting the string, getting the contents from the first space before the first '(' and the first '(' itself. Parameters comes after, you have to split them at the ','s. Remember that a function declaration can contain several paranthesis, such as:
virtual void SomeFunction( int index, const CString & string = _T( "test" ) ) const;
Note that the parameter declaration might be split into several lines...
You should consider defines as well, then you'll have to read all the includes, and included includes, and create a list of defines to expand - but I didn't go down that way...
So, basically, you are after all lines containing paranthesis and ending with semi-colons inside the brackets of the class. You want the part between the first '(' and the space before the first '('. You should remove the bodies of all inline functions before you do this.
|
|
|
|
|
Hi all,
I need to add Automation features to my MFC app, and I did not include it when I started the project. How to add it now? I do not know much of automation, I only built some DLLs in ATL and they work fine, I need to do a work similar to the automation in MS Word (but orders of magnitude simpler). how can I accomplish it?
Thanx in advance.
Best Regards,
Andrea
|
|
|
|
|
Hi!
In most programs, when you type a password, asterisks are shown instead of the letters you type.. do you know how to do it?
There must be some code for it.. i'm not the first one trying to do that.
thanks!!
|
|
|
|
|
SetPasswordChar(TCHAR ch)
|
|
|
|
|
Check the "Password" box in the edit control's properties in the resource editor.
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
thanks!!
i tought it was going to be harder!
|
|
|
|
|
who can tell me a way of getting the smpt server of any address that I want to send to. For ex if my program wants to send a mail to hotmail I will use mx1.hotmail.com but what is the smpt for yahoo or other mail clients. If someone can tell a way o deducting these smpt server I'll be very greatful
Thank you
PS:or just tell me the one from yahoo
gabby
|
|
|
|
|
sounds like spamming to me
but just make a yahoo account and send urself a message from it
then look at the headers and see what server relayed it
"there is no spoon" biz stuff about me
|
|
|
|
|
Not spam but I want to make a very nice Trojan and All I needed wqas this .
Thanks .
Hope it works.
But I was more interested in a way of detecting the smpt server automatically and another thing if you can help me in making my computer a smpt server. HOW?
gabby
|
|
|
|
|
|
I've just built it. But what is the matter with doing one. I do it to practice my VC++ skills;
gabby
|
|
|
|
|