|
A couple of thoughts occur to me, though I haven't tried using this function...
The documentation isn't clear whether the leading / in "/kothi/cc/" is required, or forbidden - it's possible that the current directory to which this would be appended may already include that character. Instead of using a relative path you might want to try using GetCurrentDirectory() first, then appending your target information to it and calling SetCurrentDirectory with the absolute path. Failing that, use GetLastError to find out what is going wrong. It may be that the target server doesn't have the correct permissions set on the subdirectories, too. Not all servers default to inherited permissions from parent directories.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Help, anyone...I need to know the syntax to search for all files that start with any 10 characters and have a DLL extension. I know the *.dll but what do I put for the 10 characters?????????
Thanks in advance
|
|
|
|
|
|
thank you very much....that was what I thought
|
|
|
|
|
Hi there,
I wish to read a character from an input file one at a time, then process the character and finally write the processed character back to the place where it is initially read from (ie from the same input file, and same location in the file).....
how can i do that (preferably with not much too advance command as I am only a beginner )
Thanks very much...
|
|
|
|
|
|
if you use CFile Class, try CFile::Seek(-1,CFile::current)
|
|
|
|
|
Hello,
I'm new to MFC. I'm having 2 document type. Is there a way to have them both created when a user press file new, without that dialog asking which type the user want?
Thanks
|
|
|
|
|
Handle the OnFileNew() function with the code:
[firstDocTemplateName].OpenDocumentFile(NULL);
[secondDocTemplateName].OpenDocumentFile(NULL);
That should also stop the dialog from coming up.
Happy Programming and God Bless!
Internet::WWW::CodeProject::bneacetp
|
|
|
|
|
|
Using the Forms of Visual C++, I have designed
the appearance of an application
having menus, buttons, progression, etc.
I would like to put on this interface
three sizeable windows. In each window
a thread will display a .avi file.
How should I proceed?
Thanks for any advice.
Dr. Pastor.
|
|
|
|
|
Hello,
this might be simple, but i haven't found how to do it. I've got to disable a menu item from the ***View.cpp of my mfc app.
i don't know how to use EnableMenuItem as i don't have the variable for the menu around. I have the ids of the menu options in resource.h, that's all i know.
I don't know how to use ON_UPDATE_COMMAND_UI. I think that's the way to go, but i've read about it and didn't understand what it was about. Anybody would care to explain or link me to a nice place to find about how it works and how to use it? your help will be really appreciated
thanks!!
|
|
|
|
|
|
Try:
CWnd *pWnd;
pWnd = (CWnd*)GetDlgItem(YOUR_RESOURCE_ID);
pWnd->EnableWindow(FALSE); //or TRUE
ON_UPDATE_COMMAND_UI works on itself. eg.:
void CYourClass::OnUpdateYourMenuItem(CCmdUI* pCmdUI){
pCmdUI->Enable(NAME_OF_BOOL);
}
then you can set your NAME_OF_BOOL to true or false and (in my app) it magically works
Good luck.
"If I don't see you in this world, I'll see you in the next one... and don't be late." ~ Jimmy Hendrix
|
|
|
|
|
thanks for the tips V.
they really helped!!
|
|
|
|
|
I must urgently develop a listener which will catch tooltips (or focus) and will return their text/information to me. The thing I want to do is to get the text and use it to identify where my current tab/mouse/focus stands. Using MFC but any application sample/code/suggestion is acceptable. Thanx in advance.
|
|
|
|
|
You mean catch _all_ tooltips? Even from other apps?
Look up windows hooks, start at SetWindowsHookEx - you will need to intercept all messages for all processes (though you may be able to use a CBT hook and just check for the window class equal to TOOLTIPCLASSA\TOOLTIPCLASSW) and work out when a tool tip is created and dispayed and get the text from it.
|
|
|
|
|
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
|
|
|
|