49,761 Topics
| |
how can i do the control autosize? i think in these way: 1 - get the text rect: RECT textrect; int a=DrawText (test->hDC,inst->strCaption.c_str(),-1,&textrect,DT_CALCRECT); (the a isn't zero) 2 - testing the rectangle with image size: if(textrect.bottom<inst->imgtest.height()) inst->intHeight=inst->imgtest.height(); if(textrect.right<inst->imgtest.width()) inst->intWidth=inst->imgtest.width(); 3 - change the control size: SetWindowPos(inst->hwnd, 0, 0, 0, inst->intWidth, … | |
This is an project title for a c++ project given by my collage, Plz can anyone guide me with some good reference books/journals for data visualization and word image identification using image processing so i can begin my project with some kind of background study. Any help is appreciated | |
An ATM allows a customer to withdraw a maximum of $2000 per day. If a customer withdraws more than $700, the service charge is 4% of the amount over $700. If the customer does not have sufficient money in the account, the ATM informs the customer about the insufficient fund … | |
Algorithm 1 Distributed Algorithm (at each node Si, i E N) Input: the neighbor set N(Si), the neighboring schedules, the critical location set Pi that Si covers, the importance factor of each location Pi, i E Pi, network lifetime L, battery life Bi, Si is initially unlabeled Output: the state … | |
So here is another assignment I am working on. I can't get to my schools computer lab due to family, job, etc. Here is the assignment: Structs file name: lab2.cpp 1. (3 points) Define a struct, named FullName, that contains the following fields: lastname - a string firstname - a … | |
I'm trying to write the function: int sum(int x, int y) For this function, I need to return sum of m and n using only increment, decrement and unary -. m and n can be any integers e.g. if m is 4 and n is -5, the return value would … | |
i need ideas for my mcs 1st semester project in c coding | |
how we calculate this x%=y*3 where x= 10 , y = 5 after calculation x= ? (we know that x%=y equals to x= x%y and the prcedence will be from left to right ) | |
i'm owner draw some controls. here what i use for a button: case WM_DRAWITEM: { DRAWITEMSTRUCT *test=(DRAWITEMSTRUCT*) lParam; HIMAGELIST imlIcon=ImageList_Create(inst->imgtest.width(),inst->imgtest.height(),ILC_COLOR,1,1); ImageList_Add(imlIcon,inst->imgtest,NULL); HTHEME hTheme = OpenThemeData(inst->hwnd, L"BUTTON"); //fill the background with button face color FillRect(test->hDC, &test->rcItem,(HBRUSH) GetSysColor(COLOR_BTNFACE)); if ( test->itemState & ODS_SELECTED) // If it is pressed { DrawEdge(test->hDC,&test->rcItem,EDGE_SUNKEN,BF_RECT); // Draw … | |
I am trying to create a recursive function: double fifthRoot(double x, double maxError) In this function, I have to return y such that y^5 will be within maxError of x. Assume x > 0. Also assume maxError is big enough to prevent problems due to rounding. In order to make … | |
i have 1 class Timer. the class works fine, but when the windows loses the focus, the timer stops... why these happens? | |
what if I wanted the user to enter his birth month and I don't know whether the user input is integer or string for example july or 7 what should I do ??? | |
So here is my assignment: File name: project1.cpp You work for the Jet Propulsion Laboratory. They want you to write a program that will take a two-dimensional array containing the digitized representation of a picture of the night sky and locate the stars on it. The array elements are integers … | |
#include<conio.h> #include<iostream> #include<stdlib.h> using namespace std; class SStack { private: int *arr=NULL; int top=0; public: SStack(int size) { arr=new int[size]; } SStack() { arr=new int[5]; } void push(int x) { if(top>5) { cout<<"stack is full"; return; } arr[top++]=x; cout<<"successfully inserted:"<<x; } void pop() { if(top<0) { cout<<"stack is empty"; return; … | |
As a begginner in C++ i'm having problems to use microsoft visual studio 2010. How do i go about it? | |
Guys I need some help... This is my program... #include<iostream> using namespace std; int main() #include<iostream> using namespace std; int main() { int a=1; int b=5; cout<<"*"; cin>>a; while <a=>5>; { cout<<"*"; ++a } return 0; } { And this will be the output of my program. * ** *** … | |
I'm writing a piece of code for a class, and part of it is to take an operation on integers and store it in a double (without any truncation). I'm trying to use the static_cast <double> (EXPRESSION GOES HERE); form, but it isn't working. When I output the new value, … | |
#include <iostream> #include <string> using namespace std; { int counter=0; string Username; string Password; string InvalidUser; int opt; system("cls"); cout <<"\n\n"; cout << " ====== MEDICARE HOSPITAL LOGIN ======="; cout<<"\n"<<endl; cout<<"\n"<<endl; cout<<"\n"<<endl; cout<<" *** ****** ******* ************* **** *** "<<endl; cout<<" *** ******** ********* ************* ***** *** "<<endl; cout<<" *** … | |
Can someone check if I am doing these right please, thanks ? int a=3, b=5, x; x= a/b + b/a +a%b + b%a; cout << x; // x=0+1+0+1= 2 y=float(b/a)+ float(b)/a; cout << y; // y=1.6+1=2.6 z=a*b/2; cout << z; // z= 4 w=pow(b, a)+sqrt(a+b); cout << w; // w=125+2sqrt(2) … | |
i can show an icon on notify area: NOTIFYICONDATA NID; //on main NID.cbSize = NOTIFYICONDATA_V2_SIZE; //if i use the NOTIFYICONDATA_V3_SIZE //the compiler enters on conflits NID.hIcon = test2; NID.uCallbackMessage = WM_USER + 1; NID.hWnd = a; NID.uID = 01; NID.uVersion=4; NID.uTimeout=500; NID.dwInfoFlags = NIIF_INFO; strcpy(NID.szInfoTitle, "Test Title"); //NID.hBalloonIcon=(HICON)test2;//no member strcpy(NID.szTip, … | |
So I have this so far, not sure how to make dollars * e^(rate*time) #include <iostream> #include <cmath> #include <iomanip> using namespace std; int main() { //declare identifiers double rate = 1; double time = 2; float dollars; float total=0.0; //initialize identifiers total= pow(exp(1.0), rate*time); cout << fixed << showpoint … | |
| I want to read text from a file and display it in the win32 Edit(ReadOnly). I am having problems converting from std::string to w_char*/LPWCSTR. The program reads the text from the textfile into a vector<std::string> object. I want to display each item in the vector on a new line inside … |
Hi All, I'm trying to use bools to sync between two threads. I cant' use C++11 and I thought mutexes would be slightly heavy for this. So, I do something like this: // ================================== // Thread A .. do some stuff .. // wait for signal. while (!signalFromThreadB) { pthread_yield(); … | |
hello guys.. i hope you can help me for this codes.. im trying to make a program that will accept username and password in c++. im using turbo c++ ide 3.0 "not dev c++". here is my code.. but the problem is.., i want to use * to appear as … | |
I'm trying to write 2 dimensional array of int type to a binary type file. int array[3][3]={Some data}; ofstream f; f.open("nameoffile.dat",ios::binary||ios::out); for(i=0;i<=3;i++) { for(j=0;j<=3;j++) { f.write((char *)&array[i][j],sizeof(array)); } } f.close(); Above code is not complete. I only wrote a part of the code where I need help. Is this code … | |
my image class can read animated gif's. using a timer i can change the menu item image. but when the menu item is showed, how can i refresh it? (i have tryied the DrawMenuBar() and SetMenu() without sucess. the image is, only, updated when i move the mouse from 1 … | |
Hello , I wanted to ask why this works? int *p = new int[ 1 ]; for ( int i = 0; i < 5; i++ ) { p[i] = i; } for ( int i = 0; i < 5; i++ ) { p[ i ] = 2 * … | |
Hi, I'm looking for a library which provides edge detecion on color image. For example i have an 200x200 color image and i need to a table form it: bool is_edge [200][200]; Where is_edge[x][y] == true when there is edge in pixel [x,y] Sorry form my english, waiting for some … |
The End.