|
You can use the CreateDirectory function to create your target directory, followed by CopyFile to copy the files.
|
|
|
|
|
Or you can use the SHFileOperation function (which also supports recursive copying) to copy. See the following MSDN page[^] for more detailed information.
|
|
|
|
|
Hello guys,
I want to generate Ctrl-Alt-Del key sequence programmatically.
I have searched a lot on net but don't get any solution.
I have tried to fill keyboard buffer with 'keybd_event()' function. But it is also not working. It seems that it fills application's key buffer.
Anyway......can anybody help me to solve this problem ?
Thanking You,
C.R.Naik
|
|
|
|
|
It's not an easy one to solve. That key combination is special. When you press the Ctrl+Alt+Del keys on the keyboard, the keyboard driver is detecting that and passing the instructions on to the OS, rather than any application(s). Trying to stuff the keyboard buffer does not get "low enough" in the hierarchy.
These two articles don't directly answer your question, but they might help you get started:
http://www.codeproject.com/useritems/preventclose.asp
http://www.codeproject.com/useritems/GINA_SPY.asp
|
|
|
|
|
Hi,
how are the big buttons done in the add/remove programs on XP?
they look great and i would like to use them.
any ideas how to do something like it or has anyone done it?
what would you call it? just buttons? listbar?
thx
|
|
|
|
|
According to Spy++, the buttons are part of the DirectUI window classes. I've not found any good information on this stuff sadly. (Probably more undocumented API's)
However you can easily simulate the effect using
http://www.codeproject.com/buttonctrl/cbuttonst.asp[^]
or
http://www.codeproject.com/buttonctrl/cxpstylebuttonst.asp
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
Hi,
can i use the new VS. Net IDE to write and compile my old mfc42 code without converting it to mfc7??
where and what do i have to setup?
and of course i still want to write mfc7 code as well... would there be a way to choose the settings on startup?
thanks guys
|
|
|
|
|
That's just my experience. Worked fine though:
1. Have parallel to .NET 2003 IDE -- VC6 installation;
2. Created simple MFC project (Dialog);
3. Project Settings/C/C++/Preprocessor/Ignore Standard Include Path - set to Yes;
4. Project Settings/C/C++/General/Additional Include Dirs - put the same that I have in VC6/Tools/Options/Directories/Include files and in the same order;
5. Project Settings/Linker/Additional Library Directories - put the same as I have in VC6 VC6/Tools/Options/Directories/Library Files and in the same order;
6. For Debug configuration: Disable Basic Runtime Check: Debug/Project Settings/C/C++/Code Generation/Basic Runtime Check/Set to Default;
7. For Release configuration: Disable Buffer Security Check: Release/Project Settings/C/C++/Code Generation/Buffer Security Check/Set to No;
8. If you are using CRT with floating point you may get:
LNK2001: unresolved external symbol __ftol2
To fix that add the following switch to C command line: /QIfist
9. If you are using C++ Exception Handling (/EHsc) you may get the following error at Link stage (usualy in Release):
LNK2019: unresolved external symbol __SEH_prolog referenced in function...
To fix that add sehprolg.obj at the link stage (Link/Additional Dependencies).
You can find it in latest MSDN Platform Microsoft SDK Lib subdir.
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|
|
I'm trying to use a static const data member in a function from a different class as follows:
class A
{
public:
static const int m_iMaxClmTextSize;
};
const int CClmListCtrl::m_iMaxClmTextSize = 10000;
#include "A.h"
void B::MyFunc()
{
int MyArr[CClmListCtrl::m_iMaxClmTextSize];
}
And get these errors:
B.cpp(178) : error C2057: expected constant expression
B.cpp(178) : error C2466: cannot allocate an array of constant size 0
B.cpp(178) : error C2133: 'MyArr' : unknown size
According to Lipmann/Lajoie on Pg 645 this should be ok. Mind you there example uses a global C style function for my B::MyFunc() but I can't see that that should matter. Any thoughts?
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
I bet it's due to how C++ treats const s at file scope. IIRC (and this is a fine technical point that I may be misremembering) a const at file scope has internal (ie static) linkage and as such, can't be used as a template parameter, nor used in other translation units where a constant is required.
You can probably fix this by doing:
class A
{
public:
enum { m_iMaxClmTextSize = 10000 };
};
--Mike--
Ericahist | Homepage | RightClick-Encrypt | 1ClickPicGrabber
Latest art~!@#2rDFA#@(#*%$Rfa39f3fqwf--=
NO CARRIER
|
|
|
|
|
Michael Dunn wrote:
I bet it's due to how C++ treats consts at file scope. IIRC (and this is a fine technical point that I may be misremembering) a const at file scope has internal (ie static) linkage and as such, can't be used as a template parameter, nor used in other translation units where a constant is required.
Yes you maybe right about file scope, but I couldn't see that mentioned in my ref. book. I did try adding: extern const int A:m_iMaxClmTextSize; in B.cpp but the compiler didn't like that either.
Thanks for enum idea. Sort of overkill, but should work fine.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
According to your example, the m_iMaxClmTextSize data member is declared in class A, therefore definition must be:
// In A.cpp
const int A::m_iMaxClmTextSize = 10000;
and the usage
// In B.cpp
#include "A.h"
void B::MyFunc()
{
int MyArr[A::m_iMaxClmTextSize]; // Will compile
}
Serge
|
|
|
|
|
My mistake in the code sample. Where you see CClmListCtrl, it should have been A, which agrees with your post. CClmListCtrl is the real name of the class.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
ActiveX keeps running after closing IE ?
Hi, all:
When browsing a web page which contains a CAB incluing DLLs and INF, the content within this CAB are downloaded and started to run. And it stops when IE is closed. How to keep the ActiveX running after closing IE?
My ActiveX is a DLL developed with VC ATL.
TIA
-gusd
|
|
|
|
|
Could somebody provide any idea ?
|
|
|
|
|
We are trying to add existing files from a project (C++ application) into a DLL. It gets to Generating code and produces about a hundred linker errors (LNK 2005 and LNK 2019). it says an object (or variable) is already defined in a libriry (the names of variables and libraries vary in errors).
When we tried to add those files to a new C++ application, that has an .exe file as an output, everything worked just fine.
any suggestions?
|
|
|
|
|
Hi all.
How i can recognize which thread launch current thread???
Thanks.
|
|
|
|
|
start reading up on "critical sections" "mutexes" "semaphores" etc
|
|
|
|
|
Dear All,
Need your help again...
I am developing an application in MFC VC++ Version 6.0 for Windows 2000.
Is there any API provided for finding whether the given path is a filename or folder
eg.
c:\rfolder\mfolder\xyz.txt
is a filename
C:\Documents and Settings\Administrator.TEST
is a folder
Feel free to ask any further queries in this regards,
Thanks
Rohit Dhamija
|
|
|
|
|
You can call GetFileAttributes and check if the returned DWORD has the FILE_ATTRIBUTE_DIRECTORY bit set.
(You may also want to take a look at GetFileAttributesEx ).
|
|
|
|
|
Thanks, you are great henchook.
Rohit
|
|
|
|
|
Hi !
I'm thinking about using a CVS (I know there is a free one), but I'm wondering how it is to work with such a tool...
We'll be 4 people working on the same project (but on different classes), with Visual Studio 6. I guess the files will be stored on the server, but what happens when I want to compile my class, and test the whole project ? Are the files built on the server and the executable run on the server as well, or do I have a copy of the files on my local disk ?
Does any one have some experience with such a tool ?
Thanks !
Jerome
|
|
|
|
|
I used PVCS for a brief time (11+ years ago), moved to Microsoft Delta (it was either free or extremely cheap at that time), and most recently Microsoft Visual SourceSafe.
The files are stored in a proprietary format. If you are working on a team environment, this will most likely be a common folder out on some server. Each person installs their own copy of the software, and opens the same VSS database (it's actually just an INI file that has all the goodies about the underlying hierarchy). A VSS admin will add users and assign rights as necessary.
Typically, you will check out files or a whole project (to your own development area), make the appropriate changes, and check everything back in. The next person that comes along will check out the files s/he needs, makes the appropriate changes, and checks everything back in. If a file is checked out, no other person can check out that file (note: there are exceptions to this).
I personally don't store DLL, EXE or HLP files in VSS as they can easily be rebuilt and storing binary files takes up a lot of space.
Once a file has two or more versions, only the delta is stored. This keeps disk usage to a minimum. If you had a 10KB file and added a few lines to it, VSS will only store those lines that were added, rather than making a duplicate copy of the original 10KB plus the added lines. Its "differences" feature is used to see what was changed between version A and version B of a file. You can retrieve any version of a file with ease.
In some situations, a file can be checked out by more than one person. When the second person goes to check the file back in, VSS will go through some sort of intelligent merge. I've never used this feature so I cannot elaborate on it.
|
|
|
|
|
Dear All,
I am developing an application in MFC VC++ Version 6.0 for Windows 2000. Is there any API provided for finding extension name from a given path (except using CFile class)
eg.
c:\rfolder\mfolder\xyz.txt
OR
C:\Documents and Settings\Administrator.TEST\Cookies.txt
In both the above cases txt is the extension name
Feel free to ask any further queries in this regards,
Thanks
Rohit Dhamija
|
|
|
|
|
splitpath()
"...Ability to type is not enough to become a Programmer. Unless you type in VB. But then again you have to type really fast..."
Me
|
|
|
|