|
Also, for any verb, explore, find, etc also give the same visual error.
modified 12-Jul-20 21:01pm.
|
|
|
|
|
SHELLEXECUTEINFO
typedef struct _SHELLEXECUTEINFO{
DWORD cbSize;
ULONG fMask;
HWND hwnd;
LPCTSTR lpVerb;
LPCTSTR lpFile;
LPCTSTR lpParameters;
LPCTSTR lpDirectory;
int nShow;
HINSTANCE hInstApp;
// Optional members
LPVOID lpIDList;
LPCSTR lpClass;
HKEY hkeyClass;
DWORD dwHotKey;
HANDLE hIcon;
HANDLE hProcess;
} SHELLEXECUTEINFO, FAR *LPSHELLEXECUTEINFO;
Contains information used by the ShellExecuteEx function.
cbSize
Size of the structure, in bytes.
fMask
Array of flags that indicate the content and validity of the other structure members. This can be a combination of the following values: SEE_MASK_CLASSKEY Use the class key given by the hkeyClass member.
SEE_MASK_CLASSNAME Use the class name given by the lpClass member.
SEE_MASK_CONNECTNETDRV Validate the share and connect to a drive letter. The lpFile member is a Universal Naming Convention (UNC) path of a file on a network.
SEE_MASK_DOENVSUBST Expand any environment variables specified in the string given by the lpDirectory or lpFile member.
SEE_MASK_FLAG_DDEWAIT Wait for the DDE conversation to terminate before returning (if the ShellExecuteEx function causes a DDE conversation to start).
SEE_MASK_FLAG_NO_UI Do not display an error message box if an error occurs.
SEE_MASK_HOTKEY Use the hot key given by the dwHotKey member.
SEE_MASK_ICON Use the icon given by the hIcon member.
SEE_MASK_IDLIST Use the item identifier list given by the lpIDList member.
SEE_MASK_INVOKEIDLIST Use the item identifier list given by the lpIDList member to invoke an application. If this member is NULL, the function creates an item identifier list and invokes the application. This flag overrides the SEE_MASK_IDLIST flag.
SEE_MASK_NOCLOSEPROCESS Leave the process running after the ShellExecuteEx function exits. The hProcess member receives the handle to the process.
hwnd
Window handle to any message boxes that the system may produce while executing this function.
lpVerb
Address of a string specifying the name of a verb. The verb specifies an action for the application to perform. This member defaults to Open if no verb is specified.
lpFile
Address of a null-terminated string that specifies the name of the file to open or print. The function can open an executable file or a document file, but it can only print a document file. If the path is not included with the name, the current directory is assumed.
lpParameters
Address of a null-terminated string containing the application parameters. The parameters must be separated by spaces. To include double quotation marks, you must enclose the marks in double quotation marks, as in the following example:
sei.lpParameters = "An example: \"\"\"quoted text\"\"\"";
In this case, the application receives three parameters: An, example:, and "quoted text".
If the lpFile member specifies a document file, this member should be NULL.
lpDirectory
Address of a null-terminated string that specifies the name of the working directory. If this member is not specified, the current directory is used as the working directory.
nShow
Show flags. Can be one of the SW_ values described for theShowWindow function. If the lpFile specifies an executable file, this member specifies how the application is to be shown when it is opened.
hInstApp
Receives a value greater than 32 if successful, or an error value that is less than or equal to 32 otherwise. Error values can be one of the following: SE_ERR_FNF File not found.
SE_ERR_PNF Path not found.
SE_ERR_ACCESSDENIED Access denied.
SE_ERR_OOM Out of memory.
SE_ERR_DLLNOTFOUND Dynamic-link library not found.
SE_ERR_SHARE Cannot share an open file.
SE_ERR_ASSOCINCOMPLETE File association information not complete.
SE_ERR_DDETIMEOUT DDE operation timed out.
SE_ERR_DDEFAIL DDE operation failed.
SE_ERR_DDEBUSY DDE operation is busy.
SE_ERR_NOASSOC File association not available.
lpIDList
Address of an ITEMIDLIST structure to contain an item identifier list uniquely identifying the file to execute. This member is ignored if the fMask member is not set to SEE_MASK_IDLIST.
lpClass
Address of a null-terminated string specifying the name of a file class or a globally unique identifier (GUID).This member is ignored if fMask is not set to SEE_MASK_CLASSNAME.
hkeyClass
Handle to the registry key for the file class. This member is ignored if fMask is not set to SEE_MASK_CLASSKEY.
dwHotKey
Hot key to associate with the application. The low-order word is the virtual key code, and the high-order word is a modifier flag (HOTKEYF_). For a list of modifier flags, see the description of theWM_SETHOTKEY message. This member is ignored if fMask is not set to SEE_MASK_HOTKEY.
hIcon
Handle to the icon for the file class. This member is ignored if fMask is not set to SEE_MASK_ICON.
hProcess
Handle to the newly started application. This member is set on return and is always NULL if fMask is not set to SEE_MASK_NOCLOSEPROCESS.
|
|
|
|
|
ShellExecute(this->m_hWnd,"open","calc.exe","","", SW_SHOW );
ShellExecute(this->m_hWnd,"open","notepad.exe",
"c:\\MyLog.log","",SW_SHOW );
Best Wishes,
ez_way
|
|
|
|
|
Those work perfectly, but I'm not sure how that helps me to display the file properties.
Thanks
modified 12-Jul-20 21:01pm.
|
|
|
|
|
Is it possible to save a dialog box like a regular document?
|
|
|
|
|
Well since the CDialog is derived from the CObject then it is well posible to serialize the object.
I believe you need to follow the guidlines how to make an implement serialization.
This space is empty.
|
|
|
|
|
I need to remove the first ~1 MB or so from some files that tend to be 20 Gig or more.
Is there a way to do this without creating a complete copy of the file? My code currently seeks for the appropriate data in the front of the file, then coppies everything after that point to a new file.
If I could just "delete" the first part, I'd be set.
Any hints?
|
|
|
|
|
Can't see how this is possible. I think that the fastest way to copy a large file would be to use memory mapped files.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Neville Franks wrote:
I think that the fastest way to copy a large file would be to use memory mapped files.
Still it is going to consume 20gb of extra resource.
This space is empty.
|
|
|
|
|
Mr.Prakash wrote:
Still it is going to consume 20gb of extra resource.
Nope. You can simply move the remaining 19.9G in the orginal file. There is no need to copy the file in this particular case. A simple memmove() should do the trick.;)
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Neville Franks wrote:
Nope. You can simply move the remaining 19.9G in the orginal file. There is no need to copy the file in this particular case. A simple memmove() should do the trick.
Well in this case you need either 20gb of physical memory or 20gb of harddiskspace for the swapfile.
This space is empty.
|
|
|
|
|
|
not true... there is an option to force the kernel(nt or later) to change it to 3gb user and 1gb kernel.
Don't try it, just do it!
|
|
|
|
|
With MMF you can spec the start offset and memory block size so you should be able to iterate through the file in say 20 x 1G segments. Certianly worth a try.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
I have a form with some edit boxes that do validation when they lose focus. I have an error variable (int) that keeps track of whether there was an error when the control lost focus. If there is an error it increases the ref count, and if there is no error it decreases the count. I'm having some trouble wrapping my head around how to work this logically. The system encounters several errors in keeping track. For example if I tab off the first edit and there is an error the count is increased to 1. If on the next box I enter a valid value and tab off the error count is decreased since there was no error. This has the effect of taking the ref count to 0 even though the first box still has an error. The only thing I've come up with so far is to have a boolean flag that is set when the ref is increased inside the function and if it wasn't then I shouldn't decrement it when it loses focus, but I don't really like that idea. Any ideas, links, or pushes in the right directions would be very appreciated. Here is some sample code of the KillFocus
if (VerifyCircuit ()) {
if (0 != m_nFieldError) { DelErrRef (); }
if (0 == m_nFieldError)
GetDlgItem (IDC_ERROR)->ShowWindow (SW_HIDE);
ErrorString (IDC_CIRCUIT_ERROR, FALSE);
}
else {
AddErrRef ();
ErrorString (IDC_CIRCUIT_ERROR);
GetDlgItem (IDC_ERROR)->ShowWindow (SW_SHOW);
} Sorry about the lenghty post.
- monrobot13
|
|
|
|
|
Why not validate the control when it looses focus and if there is an error use PostMessage() to put the focus back on the control and pop up a tooltip or balloon showing the error. Using MessageBox()'s to notify uses is far too in your face and requires user intervention.
Note that to get focus back to a control within KillFocus you can't use SetFocus() to SendMessage(). Hope that helps.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Thanks for the reply, but I don't particularly want to code the program that way (keeping the user on a control until it validates). I'm not popping up message boxes to notify the user I'm simply putting a * beside the box with problems.
- Aaron
|
|
|
|
|
Hi,
I have an SDI app that uses a static splitter. One side of the splitter is a class derived from TreeView and the other side is a class from FormView. When the user clicks on a node in the Tree, I need to send information to be displayed to the other view (CFormView).
I don't know how to pass that information. The document will hold the data, I need to tell my FormView derived View to update its controls (mostly text boxes), but I can't seem to figure it out. I have been through all the Splitter and Doc/View examples on the site but I am stumped.
Thanks,
Mike
|
|
|
|
|
One way is to call:
UpdateAllViews( CView* pSender, LPARAM lHint = 0L, CObject* pHint = NULL );
from the TreeView. Set pSender to the TreeView and get its CView::OnUpdate() handler to ignore calls to itself. You can also put lHint to good use.
This is likely the most MFC way to do it.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hi, i'm working in a Win32 app. It's based on a main file, and a class file. The main file has a window which receives events and must create different instances of the class. There is a global list, where some data is saved. When certain message arrived, the new instance of the class must search for the info previously saved in the global list. The files are:
//**Main.cpp**//
include "Main.h"
SomeFunction(PCHAR Data)
{
RecordList.push_back(Data);
....
}
//**Main.h**//
#include "CX.h"
#include <list>
using namespace std ;
typedef list<PCHAR> List;
static List RecordList;
//**CX.h**//
Class X
{
...
}
//**CX.cpp**//
VOID CX::Function()
{
List::iterator i;
PCHAR Data;
i = RecordList.begin();
Data = *i;
....
}
The compiler print error C2065 in each line where the RecordList or the iterator are used. Even in the main file.
I tried including :
#include <list>
using namespace std ;
in the CX files but this doesn't work either
Any idea?
Tnx
|
|
|
|
|
does it works if you remove the static from
static List RecordList
This space is empty.
|
|
|
|
|
Problem solved
http://www.codeguru.com/forum/showthread.php?s=ed2cedde3719d44ef58b38b453c2874b&threadid=262363&highlight=global+variable+in+classes
|
|
|
|
|
well, i just started working with MFC, i made a button, and 2 edit boxes, i cant really do anything dynamic yet so how could i make when i click the button it writes moves something from onde edit box to the other?
Compiler: VC++ 6 Enterprise
OS: Windows ME
|
|
|
|
|
make member variables of cstring for each edit box. then
when the button is clicked call
UpdateData(false);
m_strEdit1 = m_strEdit2;
UpdateData(ture);
You need to get a good book on windows control and how to use them.
This space is empty.
|
|
|
|
|
for some reason that just clears the contents of both boxes
|
|
|
|