|
hi,
My programming background is c,c++ and C#. Now i am little bit crazy abt VC++ and MFC. i don't know which book is too very good for beggners like me.
**************************
S r e e j i t h N a i r
**************************
|
|
|
|
|
I believe that for beginner VC++ 6 by sams publisher is best. later on shift to MSDN. (I know nothing about .NETness)
|
|
|
|
|
Hello Friends,
I am here again with a new query.
I am doing a project where I have to display 2 bitmap images in a single row and the number of rows depends on the number of bitmap images present in the directory from where we display the bitmap images. the images should be displayed only on 120 x 120 like a thumbnail view in the windows explorer.
Bye bye
thank you
|
|
|
|
|
Hello
Get the number of bitmaps to show. Create those many butons with size 120 X 120 at runtime. Arrange them on screen by calculating client area. Load the bitmaps on buttons.
Regards,
Prashant
|
|
|
|
|
Hi Prashant,
Can u please explain with code and what are the type of buttons to be used.
Bye bye
Thank you
|
|
|
|
|
Hi all,
I need a listbox, containing all clients attached to my domain. When using WNetOpenEnum, I only get the clients which are running right now. a switched off client does not show up.
I also need a list of users in my domain.
I need my program running un my DomainController, so it should be quite easy to have access to all data.
When using WNetOpenEnum, I can pass an argument GLOBALNET, but the results are somehow confusing. Documentation is quite poor on this subject.
The projects I found here, only show running clients.
Can anybody help?
e-DJ
|
|
|
|
|
You need to use NetUserEnum() .
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
Thanks,
looks like this is what I was searching for. I will try as soon as time permits
e-DJ
|
|
|
|
|
HI,
My module is to send and receive messages through the com port.
For that i've to set the com port using vcpp.
I've to use 2 dialog box , 1 for com port settings and another is to send and receive characters thro' 2 multi line edit boxes using 2 control buttons.
For port settings,i've to use combo box.
PLs help me.
mithila
|
|
|
|
|
Hi
My Client application is supposed to read files stored on server. My requirement is not to share server drives. So I created a hiden user on server and shared drives for it. When I launch my application on client machine I use CreateProcessWithLogonW and swith to the hidden user so that I can access the file on server. This works fine.
But I have given automation support for my application. When a third party application call createdispatch of my client application dispatch gets created but my application doesnt get desktop. Also the calling application cant get dispatch handle back.
If I stoppped locading profile through CreateProcessWithLogonW then everything works fine on XP but it gives problem on 2k.
What can be a solution for this problem.
Regards,
Prashant
|
|
|
|
|
What things are important to understand before driving a class form any object(CButton , CWnd etc) can some one provide me a detailed link ;P
|
|
|
|
|
How do I create a new class that derives directly from CObject using Class Wizard? When I use Class Wizard to create a new class, CObject is not one of the available options in the Base Class list.
-Ian
|
|
|
|
|
Change class type to "Generic Class" and type CObject in base class list. The wizard will ask you to include appropriate header, because it will not find a header for CObject. So, include afx.h in your header file.
Arsalan Malik
|
|
|
|
|
Thanks! I was trying to add the class by opening class wizard, then selecting Add Class... \ New.... This does not give me the option of adding a generic class. However, if I use Insert \ New Class, I am given this option.
Thanks again! (that was driving me nuts)
-Ian
|
|
|
|
|
HI,
My module is to send and receive messages through the com port.
For that i've to set the com port using vcpp.
I've to use 2 dialog box , 1 for com port settings and another is to send and receive characters thro' 2 multi line edit boxes using 2 control buttons.
PLs help me.
mithila
|
|
|
|
|
Where are some good sites for a C ++ beginner to get code help at?
|
|
|
|
|
I heard about CodeProject... It seems to be a good one
Seriously, there is also CodeGuru (www.codeguru.com). For the others, I don't know, codeproject is enough for what I need
|
|
|
|
|
Hi, my name is jason
I am currently at a university takeing a c++ course and I AM SOOO LOST! =( I really could use some good adice from you guys!
Before I state my question, If anybody has AOL instant messenger my screen name is "imyoernme" and I would love to talk to u on it about my programs!!!!!! I would even consider using pay-pal to anybody who helps me succed in this class! You truely don' t understand HOW MUCH VALUE I CAN GET FROM YOU GUYS!
Ok...well here it goes.
This program that I am working on consists of the game "Connect four" It consits of three classes.
My first question is about our first class we are working on, its a MENU CLASS! This class is supposed to be a generic class and it should consist of nothing of the game. That is I can use this MENU class for other programs!
So far I have the menu.h and the menu.pp that I am working on!
Please can somebody help me!!! here are the directions for the menu class i got from my teacher.
___________________________________________________
[B]Menu class[/B]
Many programs use a menu to determine user choices. Your menu class should be generic, making it reusable in other programs you write.
Data Members:
an integer representing the number of choices on the menu
an array that can hold up to eight strings. Each string is one menu choice.
Methods (use the names given in bold and do not add any other methods):
a default constructor
a special constructor. The special constructor will take an int, indicating the number of choices in the menu, and eight strings. Each string will represent one menu choice. The last six strings will have default values of an empty string. This will allow the menu to handle from 2 to 8 menu choices.
run method to facilitate the menu processing and return the validated choice.
a helper method printMenu, and
a helper method validateChoice to read and validate the menu choice and return it.
Data Validation Requirements: Your menu should bring data in as characters, check that it is actually an integer within the expect range, convert it to an integer, and return an integer. See Technical Help for Program 2 for validation techniques
Here is my menu.cpp code...I don't know what to put for my validate choice desription!!! can anyone help? and the other empty ones!
#include <iostream>
#include <string>
#include "Menu.h"//includes Menu header file
//default constructor will initialize zero to the data private members (variables)
Menu::Menu()
{
numchoices = 0;
}
Menu::Menu(int c_numchoices, string str1, string str2, string str3, string str4,
string str5, string str6, string str7, string str8)
{
numchoices = c_numchoices;
MenuArr[0] = str1;
MenuArr[1] = str2;
MenuArr[2] = str3;
MenuArr[3] = str4;
MenuArr[4] = str5;
MenuArr[5] = str6;
MenuArr[6] = str7;
MenuArr[7] = str8;
}
int Menu::run()
{
printMenu();
validateChoice();
return choice;
}
void Menu::printMenu()
{
for(int i=0; i < numchoices; i++)//for loop
{
cout << i+1 << MenuArr[i] << endl;
}
}
int Menu::validateChoice()
{
char entry[1];
int choice;
do
{
}
PS...MY E-MAILL ADDRESS IS jdhooke@ilstu.edu Please e-mail for more help..that way I can connect with somebody and get through my class ....
|
|
|
|
|
Hi there.
First of all, no real world code would ever work like this. You would never have a fixed length array, for starters. If you must have a fixed length array, your paramaterless constructor should be private, otherwise you can build a menu that does nothing. Of what value is a menu with 0 choices ?
The int numChoices is not defined in this class. I assume it is private, so that it cannot be changed except by the constructor.
I don't see anywhere that you're actually accepting input from the user ?
Once you have a char, you can use atoi to turn it into an integer. You should initialise choice to -1 in validateChoice. I believe there is a function called IsAlpha, and one called IsAlphaNum in the C libraries, so if the character entered IsAlphaNum, and NOT IsAlpha, it must be a number.
You also have not defined the default values for the strings for menu choices 3-8.
ISUstudent wrote:
See Technical Help for Program 2 for validation techniques
Given that this is your core question, I must ask if you bothered to read this first ?
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
CHRISTIAN...THANK YOU SO MUCH TO REPLYING....
my e-mail address is jdhooke@ilstu.edu
If I can have your e-mail address I can sent to you the document my teacher gave me! she is really confusing the hell out of me!
Yes I am suppose to use atoi method, also, that was just the menu.cpp code. I have the header and I made everthing public so i can test it in a driver method..I need to use this class only and test it in the driver method!
PLEASE STAY IN TOUCH WITH ME AND HELP ME THROUGH THIS PROGRAM, I may even pay you some $$ for your help! I AM SERIOUS!!!!!
THANK YOU!
Please e-mail me!!!
~Jason
|
|
|
|
|
ISUstudent wrote:
...she is really confusing...
Which is usually a good indicator that you should either ask questions in class, or stop by her office after class for some specifics.
ISUstudent wrote:
PLEASE STAY IN TOUCH WITH ME AND HELP ME THROUGH THIS PROGRAM, I may even pay you some $$ for your help! I AM SERIOUS!!!!!
Begging is not very becoming. Ask your question(s). Be mature. Move on.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
DavidCrow wrote:
Begging is not very becoming. Ask your question(s). Be mature. Move on.
ROTFL!!!!
|
|
|
|
|
hello jason,
try this one.
//======================================================
// menu.h
#include<iostream>
#include<string>
using namespace std;
class CMenu
{
private:
int m_numChoices;
string m_menuItem[8];
public:
// Default constructor
CMenu();
// Special constructor
CMenu(int itemcount,
string item1,
string item2,
string item3 = "",
string item4 = "",
string item5 = "",
string item6 = "",
string item7 = "",
string item8 = "");
void run(char item);
int validateChoice(char item);
void printMenu(int item);
};
//======================================================
//======================================================
// menu.cpp
#include "menu.h"
// Default contructor
CMenu::CMenu()
{
// Initialize the number of menu items
m_numChoices = 0;
}
CMenu::CMenu(int itemcount, string item1, string item2, string item3, string item4, string item5, string item6, string item7, string item8)
{
m_numChoices = 0;
// Process only if the number of requested items is correct
if((itemcount >= 2)&&(itemcount <= 8))
{
m_numChoices = itemcount;
m_menuItem[0] = item1;
m_menuItem[1] = item2;
m_menuItem[2] = item3;
m_menuItem[3] = item4;
m_menuItem[4] = item5;
m_menuItem[5] = item6;
m_menuItem[6] = item7;
m_menuItem[7] = item8;
}// if((itemcount >= 2)&&(itemcount <= 8))
}
void CMenu::run(char item)
{
printMenu(validateChoice(item));
}
int CMenu::validateChoice(char item)
{
int return_value = 0;
char *ptr_tmp = new char;
*ptr_tmp = item;
*(ptr_tmp+1) = 0;
int itmp = atoi(ptr_tmp);
//cout << endl << itmp << endl;
if((itmp >= 1) && (itmp <= m_numChoices))
{
// We need to subtract 1 because the m_menuItem array is zero-based
return_value = itmp - 1;
}
return return_value;
}
// Developer Note
// I am assuming that this method will print only
// the menu item corresponding to the
// integer location
void CMenu::printMenu(int item)
{
cout << m_menuItem[item];
}
//======================================================
// main.cpp
#include "menu.h"
void main()
{
CMenu oMenu(3, "item1", "item2", "item3");
oMenu.run('3');
}
//======================================================
Some notes, i assume this is only for your studies. becuase there are some major flaw in the design.
when you try:
CMenu menu();
this is actually useless.
anyway, hope this helps.
|
|
|
|
|
i missed something
the printMenu method should be:
void CMenu::printMenu(int item)
{
if(item > 0)
cout << m_menuItem[item];
}
cheers
|
|
|
|
|
It should be
<br />
void CMenu::printMenu(int item)<br />
{<br />
if(item > 0 && item<=m_numChoices)<br />
cout << m_menuItem[item-1];<br />
<br />
}<br />
and you need to initialise m_numchoices in the constructor.
Mike
|
|
|
|