|
is there a way to create a directory like this
"C:\somedir\subdir1\subdir2\subdir3"
when the directory "C:\somedir" does not already exist?
i have tried using CreateDirectory() but it seems to be only able to handle one directory at a time,
|
|
|
|
|
SHCreateDirectory
Pssst. You see that little light on your monitor? That's actually a government installed spy camera. Smile and wave to big brother!
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
hmm, none of the headers i have for Visual C++ seem to have this function, nor do any of the headers for Dev-C++ (MinGW),
|
|
|
|
|
Minimum operating systems Windows 2000
You'd have to change your _WIN32_WINNT define in stdafx.h to 0x0500.
I don't think there is another way of doing it unless you write your own routine using splitpath or the like.
Painted on the side of a dog trainer's van: SIT HAPPENS
|
|
|
|
|
This would work
system("MD c:\\somedir\\sundir1\\sundir2\\sundir3");
|
|
|
|
|
You'll need the Platform SDK. Look in Shlobj.h .
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I really hate to be mean, but perhaps you should read more carefully
"none of the headers i have for Visual C++" that would include "shlobj.h"
|
|
|
|
|
Most folks that pose such a question about missing functions are ignorant to the fact that a Platform SDK even exists, or that perhaps it contains newer prototypes. I was just making sure you had not overlooked that. Glad you're ok!
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
Visual Studio 6.0, C/C++
I would like to run a command (batch) file from within
my app that, among other things, copies some files that
are passed to it on startup.
In the 4th parameter of ShellExecute() I have 2 parameters
separated by a blank space.
=== the command file: copy.cmd
@echo off
REM the echo command is a dignostic.
echo 1 >> log.txt
copy %1 c:\dir1
copy %2 c:\dir2
=== the Shell Execute() call
ShellExecute(NULL, "open", "copy.cmd","C:\\file1.txt C:\\file2.txt", NULL, SW_SHOWNORMAL);
When this runs I get a quick flash of the screen.
I'm guessing that a command window is opening and
immediately closing.
The command file does not seem to run.
I've tried various machinations like running
cmd.exe in parameter 3, but still can't get
my command file to execute.
Any help would be very much appreciated
Robert
|
|
|
|
|
Check out CreateProcess().
Kuphryn
|
|
|
|
|
Thank-you Kuphryn for your help!
|
|
|
|
|
You should specify the fifth parameter.
For example:
I put copy.cmd, a.log, b.log all in my d:\\temp.
ShellExecute(NULL, "open", "copy.cmd", "a.log b.log", "d:\\temp", SW_SHOWNORMAL);
Ray
|
|
|
|
|
Thank-you for your help, Ray.
Yup, I've been ignoring the 5th parameter!
Got it working now.
|
|
|
|
|
Hi Robert,
You need not to specify fifth parameter. I have tested the following on my system:
HINSTANCE hInst = ShellExecute(NULL,NULL,"c:\\test\\copy.cmd","c:\\aa.txt c:\\tt.log","",SW_HIDE);
and this is working fine on my system.
Hope it will help you
Ritu Kwatra
|
|
|
|
|
Thank-you for your help, Ritu.
I've been ignoring the 5th parameter.
Got it working now.
|
|
|
|
|
<href ="www.google.com"="">
|
|
|
|
|
Can anybody tell me how to define, where a toolbar is displayed in a CRebar-Object. When I ad an second toolbar to a CReBar, this toolbar is displayed anywhere in the left free area od the CReBar. But I want the single toolbars displayed side by side.
Any ideas?
Gabriel
|
|
|
|
|
Hi, whenever I try to call OnOpenDocument within a function in my CDocument derived class, I get a debug assertion that I can't understand/
Example:
void CMyDoc::Whatever()
{
//call OnOpenDocument with pathname
CMyDoc::OnOpenDocument("C:\\whatever.txt");
}
This will cause a debug assertion at:
if (!CRichEditDoc::OnOpenDocument(lpszPathName))
return FALSE;
How do I fix this? It crashes on AssignCopy(SafeStrlen(lpsz), lpsz); at STRCORE.cpp
Thanks
|
|
|
|
|
How can get font info and change it for TextOut() function on a dialog?
|
|
|
|
|
a float variable recieves the value -1.#IND000 in my programm.
Can anybody tell me what that means?
Thanks
|
|
|
|
|
|
i would add that the floats can have 3 values up to the range of values it can support : positive infinite, negative infinite, NaN (Not a Number).
you are is the 3rd case here...
see the iso for more informations on this...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I am using MFC Application wizard provided with VC++.Net to generate an application with DocView Support. I have selected Full Server i.e. Active document server and Active Document container.
I want to separate the view class and data class. I.e I want a form to take input and then after processing the data the data should show up in a separate form. I am unable to include view class files in any of the other class files. When I do so I face errors as listed below.
Basically I want to call the view class methods from other class. So for doing that I included the view class file in the other class but it gives me the following errors.
Please help and send me some tips if you can.
------ Build started: Project: TEST, Configuration: Debug Win32 ------
Compiling...
TESTDM.cpp
e:\Data\TEST\projects\TEST\TEST\TestModule.h(15) : error C2065: 'IDD_DIALOG1' : undeclared identifier
e:\Data\TEST\projects\TEST\TEST\TESTView.h(17) : error C2065: 'IDD_TEST_FORM' : undeclared identifier
e:\Data\TEST\projects\TEST\TEST\TESTView.h(21) : error C2143: syntax error : missing ';' before '*'
e:\Data\TEST\projects\TEST\TEST\TESTView.h(21) : error C2501: 'CTESTView::CTESTDoc' : missing storage-class or type specifiers
e:\Data\TEST\projects\TEST\TEST\TESTView.h(21) : error C2501: 'CTESTView::GetDocument' : missing storage-class or type specifiers
e:\Data\TEST\projects\TEST\TEST\TESTView.h(21) : warning C4183: 'GetDocument': missing return type; assumed to be a member function returning 'int'
Build log was saved at "file://e:\Data\Test\projects\Test\Test\Debug\BuildLog.htm"
TEST - 5 error(s), 1 warning(s)
|
|
|
|
|
The errors for "IDD_DIALOG1 " and "IDD_TEST_FORM " sound like you need to #include "resource.h" before you #include "TestModule.h" .
I would guess you also need to #include the header for your document class before you #include "TestView.h" , since the other errors sound they're complaining about that.
Software Zen: delete this;
|
|
|
|
|
Thank you Gary. It fixed all my compilation problems.
Running the application where we feed the data from one window and display in another window having list view control - I notice that data is correctly passed on for display in view class. However, I tried to create a list view control pointer like this:
CListCTRL* pList = (CListCTRL *) GetDlgItem (IDC_List1);
which in turn gives me runtime error in winocc.cpp that debug assertion failed at line 94:
Line 94 in winocc.cpp is
ASSERT(::IsWindow(m_hWnd));
If you know how to fix this problem or have any tips, I would surely appreciate.
Bruce
|
|
|
|