|
You can do what JkDefrag does when evaluating paths for mount points etc. Get the short path and short name (to eliminate the relative paths), then get the long path and name. Do this for both files, then either do a case insensitive compare of the long path/name strings, or force the path/file strings to lower or upper case before the compare.
Dave.
|
|
|
|
|
Thanks for the input. Have been trying IShellItem::Compare , but can't get that to work unless files on the same share are specified the same way (\\share\path or X:\path). IShellItem::Compare can handle differences in case, however. I'm using SHCreateShellItem to create the objects, and that call fails if I'm using a relative path such as \\share\bohoo\tada\..\tada\file.txt. As always, this could be due to user incompetence on my side, so feel free to check this one for errors:
PIDLIST_ABSOLUTE pid1;
PIDLIST_ABSOLUTE pid2;
IShellItem* itm1;
IShellItem* itm2;
pid1 = ILCreateFromPath(szPath);
SHCreateShellItem(NULL, NULL, pid1, &itm1);
ILFree(pid1);
for(unsigned i = 0; i < m_rgGlossaries.size(); i++){
BSTR strPath;
pid2 = ILCreateFromPath(strPath);
SysFreeString(strPath);
SHCreateShellItem(NULL, NULL, pid2, &itm2);
ILFree(pid2);
itm1->Compare(itm2, SICHINT_ALLFIELDS, &nCmpResult);
itm2->Release();
if(nCmpResult == 0){
AfxMessageBox(_T("Hurrah"));
}
}
Eagerly awaiting suggestions. Would prefer not to do lots of conversions and resolving on my own.
|
|
|
|
|
I really cannot comment on the C++ code, I am mainly a ANSI C and MASM programmer. I am currently away from my development system and my laptop has no compiler or source code. At this week's end (Friday) I will send you the JkDefrag code that is used for this.
It is interesting that JkDefrag is labled as C++ (JkDefrag.cpp), but contains only ANSI standard C coding. If you do not want to wait until Friday, Google JkDefrag 3.36 (4.0 is NOT open source), download the open source Zip, expand the Zip, and hunt for DefragOnePath in JkDefragLib.cpp.
Dave.
|
|
|
|
|
Hi Dave, David here.
I'm curious as to why you believe JkDefrag source code will solve this problem?
1.) JkDefrag uses DeviceIOControl to query local device drivers for NTFS-MFT and/or FAT disk cluster offsets. So he cannot possibly use these techniques for remote drives.
2.) If your eluding to the usage of GetVolumeNameForVolumeMountPoint then how will this help for non-mounted shares accessed with \\Server\\Path\\To\\File type URI? These paths do not have a mount point.
3.) If he needs to resolve relative paths into full paths he can use the GetFullPathName Function[^] and/or GetLongPathName Function[^].
So can you explain why you believe JkDefrag adds anything useful into this particular situation?
Best Wishes,
-David Delaune
|
|
|
|
|
David,
As I mentioned, I do not have the source with me right now, but remembered that it did resolve path/name matches by a double transform (trying to match a path name with a mask containing wild cards including the case where a mount point when expanded to its full hardware path did match the mask).
It is true that JkDefrag will not defrag an unmounted share. I think it will not even handle a share because the API can only handle local drives. Again, I do not have the source here right now, so can't check.
Dave.
|
|
|
|
|
Consider the code below:
CListCtrl* list;
list->SetView(LV_VIEW_DETAILS);
list->InsertColumn(0,_T("en"),LVCFMT_LEFT ,30,0);
list->InsertColumn(1,_T("fa"),LVCFMT_RIGHT,30,0);
list->ModifyStyleEx(NULL,WS_EX_RTLREADING);
this code make the Whole CListCtrl in Right to Left Reading Order Mode.
But I want to have only the secound column in this mode?
What should I do?
|
|
|
|
|
Hi guys I have the following problem when I insert the WINAPI calling convention while exporting a function
for example __declspec(dllexport) VOID ServiceMain(DWORD dwArgc, LPTSTR *lpszArgv); the Visual Studio compiler exports the function in the dll as _ServiceMain@8 while without the WINAPI the ServiceName is exported like ServiceMain.
Why is this happening??
|
|
|
|
|
See, for instance, here.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It's because the different conventions place the requirement of cleaning parameters off the stack on different entities.
See this Wikipedia entry[^] - WINAPI implies stdcall (callee clean-up), so the caller needs to be told how much stack the called function will clean up - that's what the '@8' at the end of the ServiceMain symbol indicates.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
i just want includes image in the rich edit...
like a braille image...how can i do it??
and how can i set the key S+d for the image a, key D+F+S for image b and so on...
|
|
|
|
|
You can stream images into a RTF control, if you encode the image according to the RTF spec. I don't understand what "S+d" and "D+F+S" refers to, could you please elaborate?
|
|
|
|
|
i wanted to set...if i push the key s+D+f means that three key i enter at the same times...how to set its??
|
|
|
|
|
Here[^] is an example of inserting images and other OLE objects in Rich Edit Control.
mr bard2 wrote: how can i set the key S+d for the image a, key D+F+S for image b and so on...
This part of your question is totally unintelligible for me... What are these keys and what they have to do with the images?
If you want useful answers you should try to be accurate and specific in explanation of your problems.
Regards
Nuri Ismail
|
|
|
|
|
i wanted to right a braille programme...its mean that the key used for the programme are F,D,S,J,K,and L...its mean that the if i enter S+D..the image are for image A...so i mush enter S+D at the same times to make the image A display...
|
|
|
|
|
Very poor sample.
See instead the classic MSDN sample in SDK , 10x better
|
|
|
|
|
I build a program using Visual C++ 6.0.
My project used dialog based type.
My program creates a log file in a text file. I used CStdioFile when make this log file.
Now, I want print these log file from my program.
How to show print dialog and connect it with my text file?
In Visual Basic, there are commondialog component that equipped with print options.
Is there any similar class on Visual C++ 6.0, like commondialog on Visual Basic?
Please help me solve my problem...
Thank you before,
Eka Candra
//---------------------------------
I am a beginner in visual C++, even in C++. So that I need help from all of you.
I will try every suggestions and explore them...
Thanks once more...
modified on Saturday, September 12, 2009 1:40 AM
|
|
|
|
|
Eka Candra wrote: Is there any similar class on Visual C++ 6.0, like commondialog on Visual Basic?
Yes, see here.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thank you for your quick reply yesterday.
Until now, I still confuse how to link my document file to CFileDialog, so that I can print my document file.
I am a beginner in Visual C++, even in C++. So that, please help me...
Thank you...
|
|
|
|
|
My SDI application is divided into many views using CSplitterWnd.
In each view, there are Frames again which are having views separated using CSplitterWnd.
Currently I am saving and reading mainframe size by GetWindowPlacement and SetWindowPlacement function.
When closing the application, I would like to save each view size and while loading I want to set the same size.
I have idea of using GetClientRect() on each view destructor and save it in registry or INI file.
Any suggestion on how to do this would be greatly appreciable.
Thanks
--
"Programming is an art that fights back!"
|
|
|
|
|
Hi,
I'm developing this particular project to transfer images from a client to server and vice versa, along with chat function.
Chk this project
http://filesanywhere.com/fatemp/20090911/TMPRAVITEJA20200.7557130.9079510.424814/SockIm1.rar
The project now functions for chatting only.
However I've written some part of code for image opening and diplaying part.
But the display function is not working correctly.
The program is compiling fine.
Please go through the code and point out the mistake in the code.
P.S. the send button on the image side is not yet been assigned any function.
|
|
|
|
|
raviteja2020 wrote: Please go through the code and point out the mistake in the code.
Please, use the debugger to find out the bogus code and (optionally) post here the relevant part.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The code is compiling properly.
Debugger showing no errors but its not showing expected output.
|
|
|
|
|
Well, now you should have some insights about what's going wrong, so please post the relevant code.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
void CPictureBox::ShowBitmap(CPaintDC *pdc)
{
CDC dcMem;
dcMem.CreateCompatibleDC(pdc);
CRect lRect;
GetClientRect(lRect);
lRect.NormalizeRect();
CBitmap* pOldBitmap = (CBitmap*)dcMem.SelectObject(&m_bmpBitmap);
pdc->StretchBlt(0,0,lRect.Width(),lRect.Height(),&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
}
This part might be the major problem, since its not displaying the picture.
modified on Friday, September 11, 2009 7:08 AM
|
|
|
|
|
raviteja2020 wrote: pdc->StretchBlt(0,0,lRect.Width(),lRect.Height(),&dcMem,0,0,bm.bmWidth,bm.bmHeight,SRCCOPY);
Why are you using bm (instead of m_bmpBitmap ) in the above line?
BTW use the code block button when posting code snippets.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|