|
My_Fun()
{
...
pFtpConn = mysession.GetFtpConnection( my_ftpserver, my_user, my_pass );
CFtpFileFind finder(pFtpConn);
BOOL bWorking = finder.FindFile("/My Projectinfo.inf" );
...
}
The Codes can not found file "My Projectinfo.inf", Why?
Are there some way to acces file has filname have space?
Thank!!!
|
|
|
|
|
Try removing space in the filename
[edit] Sorry, I didnt read your question in full the first time. I could not find a way to do it with a space and IMO, a filename with a space is not allowed on FTP Servers (not sure though) [/edit]
Einstein: "Two things are infinite: the universe and human stupidity; and I'm not sure about the the universe."
My Articles
|
|
|
|
|
I am using VC++ version 6.0 Although I can ADD files to a project build database using the menu item "Project\Add to project\Files", I'm darned if I can see how to REMOVE files (from the build database) that I have inadvertantly added (or superceeded, etc). I can obviously remove the files from the project directory easily enough, but I will then get build errors. What am I missing here ?
Doug
|
|
|
|
|
You can remove the file from the project pressing the delete key when you select the item. The other thing that you can do is press the right mouse button one the file you want to exclude and select the settings menu. In the tab general, you see the option 'Exclude file from build.' Select that and...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi Bob, Many thanks for your prompt response !! Magic ! (Another mystery solved !)
Doug
|
|
|
|
|
Glad that I could help you!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Hi,
today i saw a really nice feature. When Install Anywhere crashes (which it does really often; i think it can't handle the 64-Bit) it shows it own error report dialog. Not that stupid common Microsoft Dialog. Know i asked myself how they did it . Any one knows this ?
MFG
RedDragon2kx
|
|
|
|
|
A dialog is a dialog, regardless of what you put in it or who made it. Now if you've got a screen shot of it, we could probably hypothesize as to how it was created.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Maybe it's a predicted crash. This means that they had forseen the error situation and handled guarded the code using structured exception handling. From there they launched the custom dialog..
This would be IMHO the most obvious that they would have done that.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
Try this
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
|
|
|
|
|
Can som1 plz tell me how to add sound to AVI Files ... I can add frames but cannot audio to generate an AVI movie ... can some1 plz help me on it
|
|
|
|
|
you wont get any help because no one knows what editor your using, duh
IM PROUD TO BE A GMAIL;
|
|
|
|
|
I am using Visual Studio 6 and i also have the same question ... can somebody help me
|
|
|
|
|
I added a response to original Anonymous post in the thread. See if it helps you.
|
|
|
|
|
I have done this using SDK (not MFC, not C++). Is this any use to you?
If so I will clean the code a bit and post it.
|
|
|
|
|
OK, I had a quick look at my code.
This is SDK-based. Why make it easy?
Some background:
The video frames were captured into memory using libraries which came with my frame grabber card, and the audio was captured at the same time, in audio buffers having the same duration as a video frame (40 milliseconds for PAL video.)
Once I have a set of video frames and corresponding audio frames in memory, capture stops and I write an AVI file.
Here is the portion which writes the AVI (including audio stream initialisation but ignoring video stream initialisation):
<br />
uiResult = AVIFileOpen(&pAVIFile, AVIFileNameEtc.lpstrFile, OF_CREATE, NULL);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
memset(&AudioStreamInfo, 0, sizeof(AudioStreamInfo));<br />
<br />
AudioStreamInfo.fccType = streamtypeAUDIO;<br />
AudioStreamInfo.dwScale = 1;
AudioStreamInfo.dwQuality = -1;
AudioStreamInfo.dwRate = 11025;
AudioStreamInfo.dwStart = 0;<br />
<br />
AudioStreamInfo.dwLength = uiLocalNumFramesUsed * uiAudioBufferActualSize;<br />
<br />
AudioStreamInfo.dwSuggestedBufferSize = uiAudioBufferActualSize;<br />
AudioStreamInfo.dwSampleSize = 2;
<br />
uiResult = AVIFileCreateStream(pAVIFile, &pAVIAudioStream, &AudioStreamInfo);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
uiResult = AVIStreamSetFormat(pAVIAudioStream, 0, &AudioFormat, sizeof(AudioFormat));<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
for (uiCounter = 0; uiCounter < uiNumFramesUsed; uiCounter++)<br />
{<br />
<br />
uiResult = AVIStreamWrite(pCompressedVideoStream, uiCounter, 1, gpAVIBufBits, bitmapForAVIHeader.biSizeImage, 0, NULL, NULL);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
<br />
uiResult = AVIStreamWrite(pAVIAudioStream, uiCounter, <br />
1, pAudioDataBlock[(uiCounter],<br />
uiAudioBufferActualSize, 0, NULL, NULL);<br />
if (uiResult != AVIERR_OK)<br />
exit;<br />
}<br />
|
|
|
|
|
hello,
i searched codeproject, but couldn't find a description of how to support accelerator customization. i'd like users to be able to change accelerator keys at run-time, similar to the one in the Customize... command in visual c++.
thanks,
ed
|
|
|
|
|
Narf! Call CreateAcceleratorTable and make sure you use the handle returned in a call to TranslateAccelerator
|
|
|
|
|
Thanks!
From what I can tell, I'll have to override CFrameWnd::GetDefaultAccelerator() or CDocument::GetDefaultAccelerator(). Strange that these functions aren't documented in the MSVC help file, but it shouldn't be that complicated....
Ed
|
|
|
|
|
If you only want your accelerators to apply to the frame window, I am not sure you need to override for the document, since the only place the document's GetDefaultAccelerator() was called was from the same function in the mainframe. The document's default implementation just returns NULL anyways.
It would also have been ideal if the CFrameWnd::LoadAccelerator was a virtual function, but I never claimed the designers of MFC were particularly farsighted... Oh well As a result, you are going to have to load your own and keep track in the GetDefaultAccelerator() you override, and possibly destroy the one created by the default implementation of LoadAccelerator stored in CFrameWnd.m_hAccelTable member variable.
What you could do, is try to load yours, and if it is missing, then return the default handle.
This way, you could define a default set in the resource, and let the user override that with his own settings. A 'revert' would just replace his modified settings with a set from the original copy from the resources.
|
|
|
|
|
I thought what I'd do is to keep a copy of the latest accelerator table in the application object, and override the CDocument virtual GetDefaultAccelerator() method, returning the application's accelerator table, which will then be used by the CFrameWnd instead of the default. It's a bit of a hack, since as you noted, there's no point in storing an accelerator table in each document, but it allows easy reversion to the default (return NULL in the overridden GetDefaultAccelerator() method), and simplifies the management of the user-modified accelerator. I'll give it a try with a simple Hello World application....
|
|
|
|
|
I have an ActiveX control that is a dialog with various other child controls. When the dialog starts up, no control appears to have focus (I haven't explicitly given any child the focus). If I hit a key before giving a child control the focus (via a mouse click), I hang. This is the MFC loop I'm hanging in:
pWnd = pWndStart = _AfxGetChildControl(pWndDlg, pWnd);
while (TRUE)
{
pWnd = _AfxNextControl(pWndDlg, pWnd, CWP_SKIPINVISIBLE | CWP_SKIPDISABLED);
if (COccManager::IsMatchingMnemonic(pWnd, lpMsg))
break;
if (pWnd == pWndStart)
return NULL;
}
Obviously this loop is checking all child controls for a mnemonic that matches the pressed key. If it finds the control with the matching mnemonic, or loops through all of the controls without a match, it returns.
My problem is it never finds a match (whether I hit a matching key or not) and pWnd never equals pWndStart inside the loop.
I've checked my dialog for duplicate mnemonics (though that shouldn't cause this problem).
I'm running out of ideas. Any thoughts?
Thanks!
NOTE: I'm also not getting control Tabbing behavior. I've set my tab order but the Tab key does nothing. I'm thinking these problems are related?
-Ian
|
|
|
|
|
Hello,
I have a question about expanding CTreeCtrl items. What I first do is populate a tree like this:
void CMain:oDrive(const CString& str)
{
local = true;
m_tmain.DeleteAllItems();
CString cstr = _T(str);
TV_INSERTSTRUCT root = {0};
::ZeroMemory(&root, sizeof(TV_INSERTSTRUCT));
root.hParent = NULL;
root.hInsertAfter = TVI_LAST;
root.item.iImage = 1;
root.item.iSelectedImage = 1;
root.item.pszText = (LPTSTR)(LPCTSTR)cstr;
root.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
HTREEITEM root_item = m_tmain.InsertItem(&root);
TV_INSERTSTRUCT tvstruct;
CFileFind find;
BOOL bDir = FALSE;
bool cDir = false;
BOOL bContinue = find.FindFile(cstr + _T("\\") + _T("*.*"), 0);
tvstruct.hParent = root_item;
CString strFileName;
while (bContinue)
{
bContinue = find.FindNextFile();
strFileName = find.GetFileName();
if (find.IsDirectory())
{
bDir = TRUE;
cDir = true;
tvstruct.hParent = NULL;
tvstruct.item.iImage = 0;
tvstruct.item.iSelectedImage = 0;
tvstruct.item.pszText = (LPTSTR)(LPCTSTR)strFileName;
tvstruct.hInsertAfter = TVI_LAST;
tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
HTREEITEM hThisItem = m_tmain.InsertItem(&tvstruct);
tvstruct.hParent = hThisItem;
m_tmain.InsertItem(&tvstruct);
}
else
{
tvstruct.item.iImage = 2;
tvstruct.item.iSelectedImage = 2;
tvstruct.hParent = NULL;
tvstruct.item.pszText = (LPTSTR)(LPCTSTR)strFileName;
tvstruct.hInsertAfter = TVI_LAST;
tvstruct.item.mask = TVIF_IMAGE | TVIF_SELECTEDIMAGE | TVIF_TEXT;
m_tmain.InsertItem(&tvstruct);
}
}
find.Close();
}
This works fine and the tree gets populated with right items. However, when I try to expand a directory by clicking on a + Nothing happens. What I first trying to do is just get a directory name. This is my function that is trying to get a directory name:
void CMain::OnTree(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_TREEVIEW* pNMTreeView = (NM_TREEVIEW*)pNMHDR;
HTREEITEM hIT = pNMTreeView->itemNew.hItem;
CString path;
if (pNMTreeView->hdr.code == TVN_ITEMEXPANDING)
{MessageBox("Expanding");}
path = m_tmain.GetItemText(hIT);
while (true)
{
hIT = m_tmain.GetParentItem(hIT);
if (hIT == NULL)
break;
path = m_tmain.GetItemText(hIT) + _T("\\") + path;
}
path += _T("\\*.*");
MessageBox(path);
*pResult = 0;
}
The MessageBox only shows *.* and I can't get a directory name from m_tmain.GetItemText(hIT). Does anybody know what the problem is here? It is necessary to get a directory name to pass that variable to ExploreDirectory(CString some_directory) function. Please help.
Thank you,
Victor.
|
|
|
|
|
vi has a key that will convert a character from lower case to upper case, by holding down that hot key you can convert a whole string of characters like that. Does VC++ 6.0 IDE have that kind of shortcut key? It would be handy to highlight some literal text, hit a key and convert it to upper-case.
|
|
|
|
|