Visual C++ :: Process Wider Date Range Than COleDateTime
Apr 24, 2013
I have a ULONGLONG variable uDate which express the number of dates starting from 0001-01-01, up to 9999-12-31. Now I want to convert it into a string like this
"yyyy-mm-dd"
However, the COleDateTime can only express the date from 100 to 9999, smaller than what I need. So are there any third-party classes or libraries that can express this. Or make the conversion from uDate to CString?
i'm making a program that, given a person's birthdate or any other date, will display the day of the week of the person was born.
There is this part where it says "use a switch statement to make this calculation, If desired month is 12, add the number of days for November, if desired month is 11 add the number of days for october....
So it's suppose to start with "case 12 :...
I can't figure out what to write for the statement....
So there is suppose to be a constant that shows the total number of values to be shown in this range. The user enters two values, lets say userMin is -2 and userMax is 2, it's suppose to add 0.2 to -2 and so on until it reaches 2. It starts doing that up until it reaches -1.0, then it goes to -0.9, -0.7.... etc, It also goes beyond 2.
Code: #include <iostream> #include <iomanip> using namespace std; int main() { cout << fixed << setprecision(1); float userMin; float userMax;
Write a well-commented C++ program that reformats and outputs the date. Prompt the user to input the date in the format dd/mm/yyyy and outputs it in this format month, dd, yyyy. For example, 07/06/2012 is displayed as June 07, 2012. You are provided with the file months.txt containing the months and their corresponding numbers, for example 01January 02February etc. Use getline(monthsFile,monthString) to read in a string from the file, and use the monthString.find() function to search for the number and extract the corresponding month.
-confused by the way she told me to use getline(monthsFile,monthString) => if I just do it like this I only get the first line from the txt file (01January) -if I try putting all the months on one line in the txt file (which i'm not even sure i'm allowed to do), I'm not sure what to do for the length of my substring output. if I make it long enough to fit longer months like September, someone entering may gets both may and june in the output -if I input all the months into separate variables, I'm not sure how to make it only output the month entered by the user
I'm having problems with progress bar when using a big number in set range. For numbers below 50000 it works very well but for big numbers like 100.000 it doesn't work, it makes 2-3 rounds of animation
Code: int number= 50000; // 50k works well but if i put 100k it won't work (it will animate 2-3 rounds instead of complete one) progressbar1.SetRange(0, number); progressbar1.SetStep(1); for (int i = 0; i < number; ++i) { listcontrol1.InsertItem(i, _T("whatever")); progressbar1.StepIt(); }
I had created a global hook by SetWindowsHookEx with WH_CALLWNDPROC. It is used to create a new toolbar button in specific window in the specific (3rd party) program (named HOOKEE.exe for example), and it works perfectly fine most of the time. Normally HOOKEE.exe is launched by double clicking the shortcut icon on desktop. But this program could be also launched in another way (provided by the provider of HOOKEE.exe), with this new way, HOOKEE.exe is by conhost.exe (on Windows 7), and then I could see (via ProcessMonitor) my hook is loaded by conhost.exe, but not the process HOOKEE.exe. In my understanding global hook would be loaded by whatever process, I have no idea on the exception, and what conhost.exe does to the HOOKEE.exe.
I have a problem with creating a process and waiting until the main window of the new process was shown. I thought I can wait for it with
WaitForInputIdle(pi.hp,INFINITE);
But when the function returns, the handle of the main window of the new process is not available. If I include also a ::Sleep(), the new window is available. Sleep is a bad solution. How can I do it?
Using Excel Automation in Visual Studio 2010 C++, how do I define a name? As a user of Excel, you can enter a name that then can be used in formulas to refer to a range of cells. The range changes as the user inserts columns or rows. My program has worked with various versions of Excel dating back to the early 2000's.
I have a bunch of classes derived from COleDispatchDriver: CXLApplication, CXLRange, CXLWorkbook, CXLWorkbooks, and CXLWorksheet that have many functions, but I have no documentation... How to define a named range using functions of these classes (probably CXLRange)?
I have an assignment where i have to prompt the user to enter the name of a file then open that file and read names of students and what level they are at university
eg : John Wilkins, sophomore Dan Robertson, junior etc..
i did the code and it compiles perfectly, but when i input the name of the file it gives me error: string subscript out of range.
here's the code:
Code: #include <iostream> #include <cstring> #include <string> #include<ctime> #include <fstream> using namespace std; int * read_file(string filename)
Write a function named generateLotteryNumbers. The function is passed an int array of size 5. The function should generate 5 different lottery numbers in the range 1 to 50 inclusive and place the numbers in the array. The declaration is as follows:
Note that no data is passed in to the function. The array is used to return the function results. Thus the parameter is an OUT parameter. Do not display the result. Return the result.
Do not seed the random number generator inside the function. If you seed the random number generator inside the function and the function is called many times in the same second, your function will return the same results each time it is called.
I know how to generate the numbers in the specified range but I do not know how to test for duplicates. Here is the code I have so far:
Code: //This program will test the "generateLotteryNumbers" function #include <iostream> #include <cstdlib> #include <ctime> using namespace std; void generateLotteryNumbers (int lotteryNumbers[]);
[Code] ....
When I try to compile this, my compiler tells me that lines 41 and 46 require an array or pointer type.
And then the Calculator is shown in domainuser1 desktop, but the process is running in domainuser2 account.
When running Spy++ (either wither domainuser1 or domainuser2) to view the calculator window, the Windoe Proc field is shown 'Unavailable' I also try to call GetWindowLong against this window, it will always returns NULL.
I am just wondering if it is possible to retrieve the Window Proc of the window running in a process of another account, is is possible?
I want to define a range of exit codes in my application. These codes will be used as a return value of ExitInstance function. I want to know the exit codes availables (values not used for example by windows to inform about an other error). When I force to crash my application, I get some different error codes: 8148, 10176.
I am making an application that processes multiple files (typically > 500) through a command prompt call. The way I start the command prompt app is by looping using a call to CreateProcess for each file that is to be processed. It works fine, except that I somehow loose 'connection' to my app so that
1: Windows says that the app. is 'Not Responding' 2: The Cprogress bar in my app is not updated before all files have been processed, even though there is a CreateProcess call and a Cprogress.StepIt() from the app for each file that needs processing.
I somehow suspect that the CPU gets swamped... I do not want that Windows starts to say that my app is 'not responding' and I want my Cprogress dialog bar to update according to the number of files that are progressed through.
I wonder if multithreading is the OK way to go instead of just kicking of series of CreateProcess calls? Maybe my CreateProcess is not ending correctly? It seems as if my app is 'not regaining control' before very late. The app never crashes though.
My CreateProcess code is listed below, maybe there can be a problem with it, or maybe I should do things in a different way? My app basicaly works as it never crashes, but with above mentioned problems it is NOT a pro solution...
void CMultiFilerDlg::ProcessFile(CString pdfFile) { int i=0; DWORD ProcID; // Open file in text mode: STARTUPINFO si; PROCESS_INFORMATION pi; char cmdArgs[2052];
I have two date/time structures which I'm populating, but when I populate the second one it sets the same values in the first. This is what I've got so far
I have app that has while true on input listening to changes and then in some condition needs to open simple gtk app, and afterwards continue listening.
I thought that i could fork gtk part, and kill it when it is not needed.
But am not finding much examples on internet. 2 processes dont share data. Can child process start a gui app? And is this a good approach.
I am looking for a way to run a process form memory, without having any executable. The application will be kept inside a resource and will be extracted during run time. It should be then started as a new process. I couldn't find a solution that works also on x64
I need my Unix program to generate a directory with a format like this: "hinesro.<pid>". I have some code that mostly works, except for the directory ends up with a question mark on the end, like this: "hinesro.12345?". I need it to just display the directory without this question mark. Here is my code:
Code:
// Using headers sys/types.h, sys/stat.h, unistd.h, and stdio.h int pid = getpid(); char prefix[] = "hinesro."; char fileName[0]; sprintf(fileName, "%s%d ", prefix, pid);
i have read that inheritance slows down the process.because a_class -> b_class -> c_class it goes thorough many classes to find a function or a value. people advices not to do it more than a few times. what if instead of inheritance we are using headers, would it slow down the process also??i mean which one is faster? and arent both the same when we use headers or used inheritance.
I am looking into how to create zombie process. They are created when parent process don't call wait() and hence they are not removed from the process table. How do I create zombie process in C++? What part of the code when missed, make a process/thread zombie? Is it the pthread_join()?
Am developing windows forms application where in my form am fetching data into list from some object which takes around 2 minutes to complete processing so meantime i want to show progress bar before starting process till it ends with percentage. I have return a code to do multitasking but it is throwing error as "Cross-thread operation not valid: Control 'listOrg' accessed from a thread other than the thread it was created on".
private void btnOrg_Click(object sender, EventArgs e) { try { // To report progress from the background worker we need to set this property backgroundWorker1.WorkerReportsProgress = true;
I would like to ask about editing proccess memory.For example,I would like to create some program for a multiplayer game which I play.How do I work with memory adresses and what are commands for it.