Hello all, Correction I was useing CopyFile() not MoveFile() sorry. I did use SHFileOperation() and it works perfectly. Now I am working on the compare function. I want to check for added files to the directory and list the added file in a listbox then check for changes made to any file in the directory.
I'm currently migrating projects from VC6 to VS10 and encountered a problem using template classes with friend template functions. The following example was reduced to the minimum to reproduce the problem. The code compiles without errors/warnings in VC6:
------------------- 8< -------------------------------- 1>templ.cpp(44): error C2248: 'attributeimpl<T,P>::attributeimpl' : cannot access protected member declared in class 'attributeimpl<T,P>' 1> with 1> [ 1> T=std::string, 1> P=myobj 1> ] 1> templ.cpp(28) : see declaration of 'attributeimpl<T,P>::attributeimpl' 1> with 1> [ 1> T=std::string, 1> P=myobj 1> ] 1> templ.cpp(85) : see reference to function template instantiation 'attribute *MakeAttribute<std::string,myobj>(const std::string &,const std::string &,factory *,T myobj::* )' being compiled 1> with 1> [ 1> T=std::string 1> ] 1> 1>Build FAILED. ------------------- 8< --------------------------------
AFAIK I don't need to explicitly declare a friend function. The compiler should take the "friend" declaration to declare the function in the next outer scope that is not a class (in the example this is the global scope). But even if I explicitly declare the function "MakeAttribute()" in the global scope and reference the friend declaration to ::, the compiler gives me errors. In such a case VS10 says it cannot deduce the template parameters T and P of "MakeAttribute()".
At this point I'm totally clueless... :-| So how do I have to declare the friend function?
However, the modified code has still troubles with the linker, on my VS 2010.
The example was not made to link correctly. Anyway - your suggestion solved the problem. I always believed that the compiler uses the template parameters from the class where the friend was declared in, but I was obviously wrong...
BTW: did the code author contributed to ATL?
Sure not The whole library was written in plain C++ with STL.
// not work
SwfWnd * w = new SwfWnd;
While(GetMessage(&msg, SwfWnd->GetHWnd, 0, 0))
SwfWnd * w = new SwfWnd;
// edit controls created without a window are multiline by default// so that paragraph formats can be
dwStyle = ES_MULTILINE;
fHidden = TRUE;
// edit controls are rich by default//fRich = TRUE;
fRich = FALSE;
The problem is, when the bottom line is empty the vert scrollbar can not scroll to bottom
hello guys... I need to get the file path of the current document that im using. For example if I am using MyMainClass.cpp as the current document in VS 2008 then I want to get the full file path of the current document and print in console app. Using google I got to GetModuleFileName() but dont know whether it is the right function or not.
Your question is not clear. Do you want to get the path of the source module you have open in Visual Studio? Then GetModuleFileName() won't do it. That will get you the full path of the running executable.
I'd expect a compiler error on the original code; single quotes mean a character is between them and \r\n is two characters. If you still want to check for \r\n rather than for any occurence of \r separately, you could use something like this:
for (int i = 0; i < len; i++)
if(!(buff[i] == '\n' || (buff[i] == '\r' && i+1 < len && buff[i+1] == '\n')))
temp[x] = buff[i];
Last Visit: 31-Dec-99 19:00 Last Update: 23-Feb-17 2:04