Thanks for your help!! :-D
ionzarate
Posts
-
Numeric Textbox -
MFC app to service appI don´t know how it goes in .NET, but in VC++6.0 you can make a Windows service with the Appwizard New Project -> ATL-COM Appwizard -> Server type=Service The should be something similar in .NET. When starting the service, your service.exe should launch your mfc_app.exe calling
CreateProcess()
. And when the service is stoped, it should post WM_QUIT to your mfc_app.exe. Hope it helps Bye. :wtf: -
Numeric TextboxHi all! I´m newbie using Vbasic. I need to make a macro for Excel, which shows a form asking for a numeric value in a Textbox. I convert the Textbox content to long with CLng() function.
Dim longval As Long longval=CLng(TheTextBox.Text)
But this function crashes if the content of the textbox is alphanumeric. How can I check that the value entered is only numeric? Is there any function like "IsDigit" or something? or Is there any Textbox property to force only numeric content? Thanks a lot. :wtf: -
It crashes !It´s because you are overflowing the stack!! The stack is the part of memory used for keeping function arguments and return adresses when calling a function, but it is also where the LOCAL VARIABLES are kept. By default the size of the stack is 1 MB, and you need at least 4 MB of stack for your "int i[1000000]" array. (4 bytes each int, 1000000 times). You need to make your stack greater. In VisualC++ 6.0: Proyect->Settings->Link->Output->Stack allocations In the "Reserve" text box, try greater values. Bye! :wtf:
-
Precompiled HeadersVery helpful links! Thanks! :)
-
Thanks Blake Miller: CreateProcess and process groups (2)Hello everybody! First of all, thanks for your answer Blake Miller!!! I didn´t explain the situation correctly. I mixed up with the example!! :sigh: I´ll try to explain it correctly... I´m using CreateProcess to create a new process, with the CREATE_NEW_PROCESS_GROUP flag set in the argument "dwCreationFlags", to create a new process group. Let´s suppose that PROCESS_A creates a new process, with CREATE_NEW_PROCESS_GROUP flag set. This new created process (PROCESS_B) is the 1º process of the process group. It´s true that both the 1º process of a process group and the process group itself have the same ID. So the ID of the process group and the PID of PROCESS_B are the same. If the PROCESS_B creates a new process (PROCESS_C) with CREATE_NEW_PROCESS_GROUP flag cleared, both PROCESS_B and PROCESS_C will belong to the same group. PROCESS_B knows the ID of its process group, as it´s its own PID. But... -How can PROCESS_C get the process group ID? (without using IPC or passing it through command line arguments) -Is there any function which returns the process group ID of the calling process? Summing up... I only what to know how to get the ID of the process group, to which a process belongs. Thanks and bye. :)
-
CreateProcess and process groupsHello everybody! I´m using CreateProcess to create a new process, with the CREATE_NEW_PROCESS_GROUP flag set in the argument "dwCreationFlags", to create a new process group. Let´s call PROCESS_A the one which calls CreateProcess, and PROCESS_B the one which is created. MSDN says in "CreateProcess" function: ------------------------------------------------------ CREATE_NEW_PROCESS_GROUP: The new process is the root process of a new process group. The process group includes all processes that are descendants of this root process. The process identifier of the new process group is the same as the process identifier, which is returned in the lpProcessInformation parameter. Process groups are used by the GenerateConsoleCtrlEvent function to enable sending a ctrl+c or ctrl+break signal to a group of console processes. ------------------------------------------------------ I know that from PROCESS_A, I can get the PID of the PROCESS_B through "lpProcessInformation", which is also the identifier of the new process group. I also know that "GetCurrentProcessID" returns the PID of the current process. But I need that PROCESS_B knows the ID of its own process group, without having to pass it in the command line arguments, when CreateProcess is called. -Is it possible to get the ID of a process group? -How can PROCESS_B know the identifier of its own process group? (without passing it in the command line when CreateProcess is called) -Is there any function which returns process group ID of the calling process, like "getpgid(0)" in Linux does? Thanks all!. :)