Compilation is success full ,but i am observing that some junk value is there in the path variable. After Reaching If statement cursor went to final return statement ...
I'm making a small MFC module that should generate a report (formatted using HTML) and then display it for a user on schedule at 8:30 AM every day. Pretty straightforward stuff.
I compose my report and then save it as a local HTML file in the CSIDL_APPDATA folder. I then use the following calls to display it using the default web browser (Internet Explorer in this case):
Code: //Error checks are omitted for brevity CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE); ShellExecute(NULL, NULL, strSaveFileTo, NULL, NULL, SW_SHOWNORMAL);
This module is run on schedule from the Task Scheduler. (The task is set up to run when a user is logged on, which is all the time for that PC. It is never turned off, put to sleep, etc. That computer has only one user that is never logged off either.)
This works perfectly fine when I test it by setting the task a minute or so in the future. But when the actual task is supposed to run at 8:30 AM, when the user wakes the screen all they see is a blank Internet Explorer page. (Note that if someone refreshes that page by hitting F5, only then my report is shown on the screen.)
So I started looking into it:
1) I checked that the file is properly saved (before calling ShellExecute) by reading it back and by comparing it with the original HTML markup that I saved earlier. It's all correct there.
2) I then checked the power saving options. That computer is set up to show screensaver after 5 minutes and to turn off screen after 25 minutes.
3) The web browser that causes this issue is IE version 11, with the latest updates installed. The operating system is Windows 7 Professional.
And why is IE showing a blank page only when computer is running unattended?
Basically, I'm moving a VC project from my Windows 7 build machine to a new build machine that's running Windows 8.1. One of the pre-build steps (for a particular project) runs a script which needs to call the M4 macro processor (which is installed on my C: drive). I've been pretty careful to set everything up the same on both machines (including my PATH) but when I try to build the project on my Windows 8 box, MSVC's IDE shows me this error output when running the script:-
I'm working on a project which consists of several ocx loaded by one exe. The platform is WinCE. Now I'm on a process to create a new ocx. I do have a copy of those ocx projects in Win32 platform. These Win32 versions were only used to register ocx in local system and then put those on to application dialog by 'Insert ActiveX'.
Now the problem is those Win32 projects are so outdated, and unable to build. Getting too many linking errors to be solved.
I have build the new ocx and link that with exe manually by editing .rc file and all. But still no luck. New ocx is getting registered in WinCE device but failing to start application.
I've created a new dialog in my MFC dialog based application. the new dialog contains 5 control buttons. The following happens and I don't understand why?
1. click on buttonX. (result ok, OnBnClicked message is sent) 2. click on on any place of the application, but not on the dialog.(removing focus from dialog) 3. click again on buttonX (FAILED, OnBnClicked message is NOT sent). but if instead I click on any other button in the dialog (result ok, OnBnClicked message is sent).
And when I do:
1. ... 2. ... 3. click on the dialog area just to set focus on the dialog again 4. click again on buttonX. (result ok, OnBnClicked message is sent) **I need to do step 3 only if I want to click again on the buttonX! why?? I think it related to SetFocus() but I m not sure how.
I've tried different style like, tool windows, overlapped, popup. it happens in all the cases.
Code: class CToolsDlg : public CBDialog { DECLARE_DYNAMIC(CToolsDlg) public: CToolsDlg(CWnd* pParent = NULL); // standard constructor virtual ~CToolsDlg(); CToolTipCtrl m_ToolsTips;
I intent to use this mechanism for rename the file because the file name consists Unicode characters . I would like to know why the return value of "MoveFileExW" is false for file name consists 'space','hyphen' etc.(sometimes even without a Unicode character).for accepting 'space','hyphen' what type of conversion I would use [I.e.: Does the root cause of failure is due to CP_UTF8 type use].
Code:
//! inputPath & final_inputPath consist source and destination file name and are std::string //! Both are in same directory F: est_files std::wstring unicode_input_original; int unicode_input_length_original = 0
I've simplified things slightly - but the basic point is that both functions are in the same source file and they both have a static std::string called 'x'. Being static, I guess they aren't (strictly) local variables. So how does the compiler know that they're different entities? Does it encode their signatures using the function name or something like that? If I call each function separately I do seem to get the correct string...
Error Message: $ ./dirsearch ~/Documents/College/textfiles/ [..] [yomama.txt] Error : Failed to open entry file - No such file or directory
Here are my current file permissions: textfiles$ ls -l total 8 -rw-rw-rw- 1 jav jav 7 Apr 26 13:14 moretext.txt -rw-rw-rw- 1 jav jav 10 Apr 26 12:38 yomama.txt
Can local variable be passed as the parameter for a new created thread procedure? Here is the example code:
Code: void CDLG::some_function() { CString strFileName="abc.doc"; //local variable, can it be valid for being passed into the following new thread??? //Can strFileName still be accessed from within the stack of thread procedure? ::AfxBeginThread(ProcessContentThread,(LPVOID)&strFileName); }
[Code]...
There is another method using variable on the heap,
I test these code, both methods work as expected, but I doubt whether the first method is a good way. OR if only the second method is the correct way to pass a parameter to a thread.
How to open a file and just print what is in that file on the screen. I though maybe I had the directory wrong but putting G: or G: give me the same result. When I select 1 it just goes to the next line and doesn't print anything.
Code: int getchoice(void) { int num; int choice; FILE* outputfile;
this is my read/write functions based the read from the last post! then went nuts with it! used the %19s%*s on the write to the file, solved all the probs on the read side! but any refining on this would be great. This is another program that i started with the forums, and started going my own direction!
I am getting an error when i try to open FILE which user must enter then program must open that file i an function and copy string from that file in other .
why this is looping in an error message. I am inputting the entire file name when I run the program and it just keeps falling into my "if(!inputfile)" statement. Let me know if there is anything I'm just not seeing.
So I'm trying to see if it fails, but if i change "Input" name would the computer just create a new file name of it for example if i change "Input" to "asdf" the computer is just going to create "asdf" how do i fix it.