|
how many arguments we can pass to the new process?
Is there any limit on arguments or the size of buffer
that we are giving to CreateProcess as second parameter??
Harshal
|
|
|
|
|
Is there any limit on arguments or the size of buffer
that we are giving to CreateProcess as second parameter??
lpCommandLine
[in, out] Pointer to a null-terminated string that specifies the command line to execute. The maximum length of this string is 32K characters.
Windows 2000: The maximum length of this string is MAX_PATH characters.
The Unicode version of this function, CreateProcessW, will fail if this parameter is a const string.
The lpCommandLine parameter can be NULL. In that case, the function uses the string pointed to by lpApplicationName as the command line.
If both lpApplicationName and lpCommandLine are non-NULL, the null-terminated string pointed to by lpApplicationName specifies the module to execute, and the null-terminated string pointed to by lpCommandLine specifies the command line. The new process can use GetCommandLine to retrieve the entire command line. Console processes written in C can use the argc and argv arguments to parse the command line. Because argv[0] is the module name, C programmers generally repeat the module name as the first token in the command line.
If lpApplicationName is NULL, the first white-space – delimited token of the command line specifies the module name. If you are using a long file name that contains a space, use quoted strings to indicate where the file name ends and the arguments begin (see the explanation for the lpApplicationName parameter). If the file name does not contain an extension, .exe is appended. Therefore, if the file name extension is .com, this parameter must include the .com extension. If the file name ends in a period (.) with no extension, or if the file name contains a path, .exe is not appended. If the file name does not contain a directory path, the system searches for the executable file in the following sequence:
The directory from which the application loaded.
The current directory for the parent process.
The 32-bit Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
Windows Me/98/95: The Windows system directory. Use the GetSystemDirectory function to get the path of this directory.
The 16-bit Windows system directory. There is no function that obtains the path of this directory, but it is searched. The name of this directory is System.
The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
The directories that are listed in the PATH environment variable.
The system adds a null character to the command line string to separate the file name from the arguments. This divides the original string into two strings for internal processing.
I win because I have the most fun in life...
|
|
|
|
|
Can you explain what do you need exactly?
|
|
|
|
|
A simple example:
I have a non-mode dialog ,and there are one Button, one ListBox in it.
Aim:
When the ListBox is empty the Button state is Disable, otherwise is Enable. And I want to use ON_UPDATE_COMMAND_UI message to do it.
Thanks very much!
|
|
|
|
|
|
I have developed a static library in Visual Studio 2005 using C and C++.
Now I would like it to be available in Visual Basic applications.
Currently I build a library file and include that and the header file of prototypes and build the solution.
I have included a typical libray function and my question is what do I need to do to allow access in VB.
Data Structure
static char EventText[][60] = {
"WAPI-000 Successfully Completed. ",
"WAPI-001 Initialisation Has Failed. ",
"WAPI-002 Failed to set the voltage level for coupling mode.",
...
...
etc
"WAPI-049 Failed to Write a Frame "};
}
Prototype in Header file
char * GetEventText429( UINT event_id);
}
The code of the function
char * GetEventText429( UINT event_id )
{
return &EventText[event_id][0];
}
e.g. Data structure, call in header file and code of function.
Many thanks,
Andy.
|
|
|
|
|
VB cannot use C/C++ static libraries. you'll need to put your code inside a DLL which exports functions using the stdcall convention.
|
|
|
|
|
Hi all,
The CFileDialog has on the bottom-right
corner a button labeled as "open".
How can i change the label into "save" ?
Thanx in advance,
Desmo16.
|
|
|
|
|
Did you read the documentation about the function ? (it's on MSDN).
If you read it, you would have seen that the first argument to the function is a boolean that specify if the file dialog is a load or save dialog box.
|
|
|
|
|
damn it !!!
i gave you the link to the constructor CFileDialog::CFileDialog()[^]... you didn't even bother reading it
msdn says :
bOpenFileDialog
Set to TRUE to construct a File Open dialog box or FALSE to construct a File Save As dialog box.
|
|
|
|
|
toxcct wrote: damn it !!!
cool cool buddy.
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|
|
brahmma wrote: cool cool buddy
seriously... why answering to people when they don't listen to you...
|
|
|
|
|
I'm sorry you're right.
I didn't think it was so easy, I supposed i had to use
fd.m_pOFN->something to do it.
I found that immediately after the post.
Excuse me again.
|
|
|
|
|
nevermind, it's ok... but read the docs before asking too easy question
|
|
|
|
|
In additional you can use GetSaveFileName or GetOpenFileName
|
|
|
|
|
|
Bagaturia david wrote: char *Get(void)
{
static char a[]="thanks for any help!!!!";
char *p;
p = a;
return p;
}
p is a local variable even though it points to static buffer so it gets destroyed as soon as the function exists. This kind of coding should be avoided.
char *Get(void)
{
static char szString[] ="thanks for any help!!!!";
return szString;
} The same applies for long too.
|
|
|
|
|
The first case seems to work fine: it displays the entire string in our tests. What do you mean by "I get only one element and not array"?
In the second case the "<<" operator has a special meaning for your pointer: it display the address stored in the pointer, i.e. the address of your array. In order to display the pointed value (actually the first element from the array), try this:
cout << *p;
In order to display all of values, I think you need a loop.
-- modified at 6:14 Tuesday 14th November, 2006
|
|
|
|
|
Hi.
I want to do a small MFC application with a green background. I've seen in codeproject one quick way is to change OnEraseBkgnd() to:
BOOL CTestDlg::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
CBrush brTapete(RGB(0,127,0));
pDC=this->GetDC();
CBrush* pBrush = (CBrush*)pDC->SelectObject(&brTapete);
CRect Recto;
pDC->GetClipBox(Recto);
pDC->PatBlt(Recto.left,Recto.top,Recto.Width(),Recto.Height(),PATCOPY);
pDC->SelectObject(pBrush);
return TRUE;
}
It works, but now I have problems when putting controls like static texts on it. Their backgrounds are not the same as the application, so it's quite ugly. I've tried to change the control's property "Transparent" to True, but it doesn't work. I guess it's a problem in OnEraseBkgnd not redrawing the background behind the control, but I don't know what to do.
Someone can give me any orientation?
Thanks!
Rad.
|
|
|
|
|
You need to handle WM_CTLCOLOR message for static control.
Set background mode as TRANSPERANT there.
|
|
|
|
|
That was the problem! Now it works perfectly. Thanks, prasad_som!
Rad.
|
|
|
|
|
It seems you find your answer but also see another messages WM_CTLCOLOR* for EDIT,STATIC,LISTBOX and...
|
|
|
|
|
One file is created. I want to set the file attribute as "READ ONLY" from VC++ coding. when file is in read only mode it can not write data. Right click on created file and uncheck the "Read Only" property of file, this file property change information ahould get notified in VC++ code.
After unchecking the file property, it is able to write data into created file.
How to set file permission/property in VC++? and how to get the notification of file property into VC++?
Enjoy Life........
|
|
|
|
|
Poonamol wrote: One file is created. I want to set the file attribute as "READ ONLY" from VC++ coding
SetFileAttributes[^].
Poonamol wrote: and how to get the notification of file property into VC++?
Dont know about this, if it is possible .
|
|
|
|
|
Hello,
Thanks for instant reply,
But still I am facing problrms while removing read only attribute from file properties, this file is not opened for writting data.
Using GetFileAttribute[^] is it possible to get the notification of file properties whether it is read only / write?
Enjoy Life........
|
|
|
|