|
And I also read these information.I have uesd the file mark to realize the R/W code of the tape backup.I use the file mark to do it.Now I want to know the advantage of the long file mark and the short file mark.Then how to use them.I can use the file mark to realize the function.If I use the long file mark and the short file mark,what benefit can I get?Thanks!
|
|
|
|
|
I'm thinking that the long filemark would enable you to append to a file without rewriting the entire partition, while the short one will require you to rewrite everything. This would be handy if the files you are backing up grow over time, but rarely change existing information. I know I'm reading a lot into a few descriptive lines here, since I've never worked with this function before, but it seems to me that the short filemark would be used for a full backup, and the long one for incremental backups.
Some people think of it as a six-pack; I consider it more of a support group.
|
|
|
|
|
Hi,
I am using CFtpConnection class to deal with FTP server.
I am able to Get file from and Put file into the Root Directory.
Now, I want to access the sub-Directory under Root Directory for that I m using FtpConnection::SetCurrentDirectory() function but it always return FALSE.
I have tried out to use the CFtpConnection::Command() function , but that is not supported by my VC++ 6.0 version. Why this is so, Does any one know?
Below is my code snippet:
CInternetSession sess(_T("MyProgram/1.0"));
CFtpConnection* pConnect = NULL;
pConnect = sess.GetFtpConnection(_T("ftp.corsoft.com","UNIVERSE\UserName","Password",21));
BOOL ret = pConnect->SetCurrentDirectory("/kothi/cc/");
Please give me appropriate solution or Is there any other alternative to set the Current Directory.
|
|
|
|
|
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?
|
|
|
|