I have multiple bitmap buttons of non-square shape. Because of their odd shape I can overlap them and they will still look good on screen, which is what I want - that certain layout.
The problem is that because underlying button in reality is square (which I am subclassing), the bitmap of one button may overlay with the non-bitmap area of the other button (in the underlying square). This means that 2nd bitmap button will not receive notification because the press is registered with top level window only.
Is there a way that both windows can receive the notification and check if they are in the hot spot, they will respond? I know this is against windows design.
I am trying to read this xml file. This readFile function does not give me right values. Only to use cstring..no pointers or other libs such as xml libs
I am writing a program which compresses files into .zip files.
Here's my problem: Whenever I want to compress an executable file, my readFile function does not read the entire file. When I extract the .exe I get a very tiny and incomplete file.
Here's the function I use to read files:
std::string miniz_wrapper::readFile(FILE* f, int MAX_FILEBUFFER) //MAX_FILEBUFFER has a default value of 65536 { char* tmp; std::string tmp_s; int count = 0;
[Code] .....
Prior to reading, every file is opened using fopen with the mode "rb".
I load an image(768*256) using a file path(OpenImageFilePath).
After load an image, I start to read the loaded Image data using GetBits method and plot the same image data(768*256).
I'm using the memcpy method, for that i'm getting the below error. memmove function also giving the same error message.
File Name : memcopy.asm rep movsd ;N - move all of our dwords
Code for your reference
Code: void CDlg :: FileOpen() { CFileException CFileEx; CStdioFile ReadFile; // szFilters is a text string that includes two file name filters: TCHAR szFilters[]= _T("Image Files (*.bmp)");
The following code it taken from msdn library but it is failing to compile.
the following code has a header where all the variables used here are stored in header App.h.
The following lines are giving trouble:
Code: DialogBox(pApp->getInstance(), MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, pApp->About); error: 'App::About': function call missing argument list; use '&App::About' to create a pointer to member
Code: wcex.lpfnWndProc= &App::WndProc; error: '=' : cannot convert from 'LRESULT (__stdcall App::* )(HWND,UINT,WPARAM,LPARAM)' to 'WNDPROC'
There is no context in which this conversion is possible
I haven't had to modify them much for VS2010 so far. Right now, (I think) I have created the dialog box, and the menu as a class and a resource, respectively. However, when I call
I get an error 'DoModal' : is not a member of 'NewDialog'
I suppose somehow I need to link the menu to the dialog box?
I believe I've added the references, included the libraries and essentially followed the instructions. Apparently I'm not very clear on how to make resources interact with new classes.
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)
error C1083: cannot open: '[!output PROJECT_NAME].h': No such file or directoryd:program files (x86)autodesk3ds max 2012maxsdkhowto3dsmaxpluginwizard emplates1033atmospheric_type_atmospheric.cpp1513dsmaxPluginWizard
By using visual studio 2010, I have problem calling up on screen keyboard using line below for Windows 7 64 bit.
WinExec("OSK.EXE", SW_SHOW);
However, it is working fine on windows XP 32 bit. How to call up on screen keyboard for 64 bit windows?
Code:
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; HMODULE hModule = ::GetModuleHandle(NULL); if (hModule != NULL) { // initialize MFC and print and error on failure
I have not completed this program yet, but I have already run into a snag. For the Input Validation part, every time you enter a number regardless if it is positive it will still display the cout statement: "Please enter positive values". The program runs correctly where I currently am at, but it just keeps reading that statement even if a user enters a positive value. I have run the debugger, but it really is not showing me anything other than I notice it jumping to that statement after every value that is entered.
Here is my code, once again I have not finished this yet, but I would really like to get this fixed first before I continue. I will keep debugging in the meantime...
Code: // A local zoo wants to keep track of how many pounds of food each of its three monkeys eats each day during a typical week. Write a program that stores this information in a two-dimensional 3 X 7 array, where each row represents a different monkey and each column represents a different day of the week. The program should first have the user input the data for each monkey. Then it should create a report that includes the following information:
// Average amount of food eaten per day by the whole family of monkeys. // The least amount of food eaten during the week by any one monkey. // The greatest amount of food eaten during the week by any one monkey.
// Input validation: Do not accept negative numbers for pounds of food eaten.
#include <iostream> #include <iomanip> using namespace std;
int main() { double totalAverage = 0; // variable to store the total average, initalized to zero
Say I have a dll that performs some mathematical parsing and calculations. The calling function is only a single C -linkage wrapper function in the dll. I can anticipate likely errors and program the dll methods to do several things when an anticipated error is encountered. (For now, let's not worry about unanticipated errors).
1 - send an error message to the user application using WM_COPYDATA 2 - throw an exception (assuming the calling app has used the try catch scenario) 3 - try to gracefully recover from the error within the dll and keep on going (jump to some safe place - but how ??) 4 - don't throw an exception from within the dll but halt the program (not very nice - the user won't know what happened)
Previous discussions on the matter have predominantly expressed the opinion that it is bad to throw exceptions from within a dll.
Long ago there was in use setjmp.h and something like
Code: if(setjmp(e_buf)) return -1;
But I believe this was only for old C applications - I'm not really sure. But at least someone back then recognized the need for getting back to a safe place in a process.
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:-
what i do with this is to stack fragments of data of type char* coming from a socket in buffer to a vector that acts as buffer, I do this since I transfer big chunks of data and the data gets fragmented by the nature of the sockets, I stack the data once its complete I retrieve the final result from the vector.
this code worked flawlessly for long time but now Im trying to port and compiler throws this error, whats the new way to assign a char array pointer to a iterator so i can stack it in the vector.
I am getting "driver could not be loaded due to system error 8" error while connecting to SQL Server 2005 from VC++. Its also throwing out of memory error. Basically i am developing and ISAPI dll. I use the following code to connect to DB.