|
I figured it out. You have to add a registry entry to get the com method to work.
|
|
|
|
|
is it possible to dynamically add image and text (using functions such as InsertMenuItem() ) to menu on Win98?
(not owner-draw)
if yes, How?
thx
|
|
|
|
|
I doubt it - that's what owner draw is for.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
SetMenuItemBitmaps() can be used to add a bitmap to the menu. But for anything fancy you have to use owner-draw.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Hi Arends,
thx, i will test the function soon.
|
|
|
|
|
Hello Include!
if you want to do it by using api ways
use SetMenuItemInfo();
if you like i will post sample Menu Code using SetMenuItemInfo()api
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
I need to deliver myself a voice message over TAPI.
I know this can be done on P2K quite easily but I need to do it on a win98 machine, I also am not sure if my Modem is UNIMODEM/V
- HP E-USB UM9100.
Has any one got snippets of code on how to rec=direct a wav file or SAPI voice to a phone call. I've written the TAPI stuff and its OK so is the SAPI stuff but having probelms redirecting to modem instead of sound card. SAPI5 doesnt seem to like win98 but I'm hoping that its surely possible even if with just wav files.
Thanks W1sd0m
|
|
|
|
|
I need to write a proprietary UDP protocol.
How do I access the lower level drivers either in windows(preferable) or Unix.
I do not want to mess around with the IP packets and H/W initialization, but I do want to create my own UDP headers and trafic rules.
Does anyone have a code example?
|
|
|
|
|
Does opening the socket as SOCK_RAW rather than SOCK_DGRAM do what you want?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hello!
I have a dialog-based main window. In this dialog there is a list control. By using the context menu, the user can open another dialog (think of properties of an entry).
Now the problem: when calling dlg.DoModal(), the main window quickly flickers a bit. It's not much, but annoying anyway.
Any chance to remove this flicker?
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
how do you transmit the datas to the child dialog ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
There isn't any. It's called directly from the main menu like this:
CMyMainDialog::OnAbout()
{
CAboutDlg dlg;
dlg.DoModal();
}
I'm doing some things in functions like PreTranslateMessage, OnInitPopupMenu, etc. but nothing of these should do anything... Is there anything you may not do in those functions? I'm just using simple functions, that don't modify the GUI directly, like getting the item count of a list control, etc.
Thanks for your answer and best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
Perhaps you have a heavyweight OnEraseBackground() (in your parent dialog) that's getting called each time the child modal dialog is displayed?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I haven't overridden that function... Should I?
Best regards,
Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
(doesn't work on NT)
|
|
|
|
|
You often do in Non-Dialog apps. It wouldn't hurt to try.
Neville Franks, Author of ED for Windows www.getsoft.com and Surfulater www.surfulater.com "Save what you Surf"
|
|
|
|
|
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
The code above is from a skin change code. I want to rewrite the program into a dll for other language.
How to pass hte HINSTANCE from VB or others?
What is the meaning of nCmdShow and lpCmdLine?
|
|
|
|
|
rushing wrote:
int APIENTRY WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
Buddy that the Entry Point of Any Win32 api Based Project i.e. you can take it as main() function in old c/c++ dos based.
the hInstance,HprevInstance are Provided Windows and there is no WinMain in Dll as Entry point for DLL is DllMain()
"I Think this Will Help"
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello, i want to now how can i export a CDC created, to a bitmap file. The CDC is created in a CEdit window. Please be understanding with my English because i´m a Spanish men. Thanks
Please submit me in juanpast_euitto@yahoo.es
|
|
|
|
|
i have got some cpp and headers files and a Make file
how can i execute the make file to build the workspace ???
|
|
|
|
|
|
I'm using dialog window for data display. The data displayed on Gauge control with colored background, using StaticText control. At the first appearance of the dialog the data is displayed. After moving focus to another window and returning to my dialog the data in StaticText control is not displayed, only the colored Gauge appears. But after few minutes the data becomes visible.
How can I cause controls to be refreshed in the correct way?
|
|
|
|
|
am not sure that i understood your problem correctly
but i want you to try this solution
put the line of code that draw on the dialog or insert data in the Controls
inside the function called "OnPaint" --> "WM_PAINT"
you will find this function and if not found bring it from the Class wizard of the Dialog.
the OnPaint is called every time an Update Occured in your window.
so when you will set the focus to your dialog again the OnPaint will be called which will draw and set inputs again.
|
|
|
|
|
I'm learning C++ and I think I have a good understanding of the basics so far. I wrote this program to take information from the console about a student, and then print it out in a simple tabular format.
The problem I'm running into is that for some particular reason, I have to getline() twice for input of the student's name, or otherwise it will be blank. For the life of me, I can't figure it out, and was wondering if someone else could help figure out why this bug is happening.
The bug occurs in function getstudentdata(), and the line is getline(cin, s.name); ... I have to have it twice, or other wise it will leave the name blank.
The error is present in both the visual c++ compiler, and the g++ linux compiler. Below is the sourcecode (which works). To see the bug in action, comment out the getline(cin, s.name); and compile/run the program. Thanks!
Sincerely,
Robert
/*
*******************************************************************************
* CSCI 202 Assignment 1b by Robert xxxxxx 03/02/2005 *
* Takes student information and displays in tab form + column for GPA *
*******************************************************************************
*/
#include <iostream>
#include <iomanip>
// #include <conio.h> // for getche() // conio.h not found on linux system
using namespace std;
/*
Design a program that takes in student information
(Name, Student-id, Year, Major, Grade in 201, Grade in 202)
and displays a nice tabular form of output with those values
AND another column for the GPA (Grade in 201 + 202 ) /2.
*/
struct studentdata // structure for holding student data
{
string name;
string id;
string major;
char g201;
char g202;
float gpa;
};
inline void clear_screen(void); // function prototype, this clears the screen
void robcenterout(string centertext); // function prototype, this centers text
void getstudentdata(studentdata& s); // getstudent() will allow me to get multiple students with an easy function;
char getgrade(void); // function prototype, this gets and validates gradeletter
float gradetofloat(char grade); // function prototype, this turns char to float
float calcgpa(char grade1, char grade2);// function prototype, this calculates GPA
void drawline(void); // function will draw line;
int main()
{
clear_screen(); // clear screen first
cout << endl << endl << endl; // add a few blank lines before showing title
robcenterout("+-------------------------------------+");
robcenterout("| Welcome to the Student Grade Report |");
robcenterout("| By Robert Eckman for CS202 |");
robcenterout("+-------------------------------------+");
robcenterout("This program will take student info ");
robcenterout("(such as name, id, major) and their ");
robcenterout("grades for CSCI 201 and CSCI 202 and ");
robcenterout("print in tabular format, inluding GPA. ");
drawline(); // draw seperator line
cout << "Please enter the number of students you wish to enter : ";
int numstudents;
cin >> numstudents; // input number of students
studentdata student[numstudents]; //create array of type studentdata
for (int i = 1; i <= numstudents; i++) // get info for students
{
clear_screen();
cout << "Please enter information about student " << i << " of " << numstudents << endl;
drawline();
getstudentdata(student[i-1]);
}
// below, we build the output for the program in tabular format
clear_screen();
drawline();
cout << setw(4) << "##";
cout << setw(25) << "Student name" << setw(9) << "ID";
cout << setw(9) << "Major" << setw(7) << "CS201";
cout << setw(7) << "CS202" << setw(7) << "GPA";
drawline();
// now we add the student data
for (int i = 1; i <= numstudents; i++)
{
cout << setw(4) << i;
cout << setw(25) << student[i-1].name << setw(9) << student[i-1].id;
cout << setw(9) << student[i-1].major << setw(7) << student[i-1].g201;
cout << setw(7) << student[i-1].g202 << setw(7) << student[i-1].gpa << endl;
}
cout << endl << endl;
} // main() is complete
inline void clear_screen(void)
{
// char a = 27u;
// cout << a << "[2J"; //clears the screen using ANSI escape sequence
system("cls"); // for windows
// system("clear"); // for linux
}
void robcenterout(string centertext)
{
int width;
width = ((80 - centertext.length())/2 + centertext.length());
cout << setw(width) << right << centertext << endl;
}
void drawline(void)
{
cout << setfill('-') << setw(78) << "\n";
cout << setfill(' ') << "\n" << left;
}
void getstudentdata(studentdata& s)
{
cout << "Please enter name of student : ";
getline(cin, s.name);
getline(cin, s.name); // for some weird reason, must have this line twice.
cout << "Please enter " << s.name << "'s student ID : ";
getline(cin, s.id);
cout << "Please enter " << s.name << "'s Major : ";
getline(cin, s.major);
cout << "Please enter grade for CSCI 201 : ";
s.g201 = getgrade();
cout << "Please enter grade for CSCI 202 : ";
s.g202 = getgrade();
s.gpa = calcgpa(s.g201,s.g202);
}
char getgrade(void)
{
bool gradeflag = false;
char grade;
while(gradeflag == false)
{
cin >> grade;
grade = toupper(grade);
// the code below will check to see if the grade is valid
if ((grade == 'A') || ( grade == 'B') || (grade == 'C') || (grade == 'D') || (grade == 'F'))
{
gradeflag = true; // if grade is a,b,c,d,f then valid flag = true
}
else
{
cout << "\nsorry, " << grade << " is incorrect, please try again : ";
}
} // end of while
return grade; // returns the char value at function's exit
}
float gradetoint(char grade)
{
switch(grade)
{
case 'A' : return 4.0; break;
case 'B' : return 3.0; break;
case 'C' : return 2.0; break;
case 'D' : return 1.0; break;
case 'F' : return 0.0; break;
}
}
float calcgpa(char grade1, char grade2)
{
float g1, g2;
g1 = gradetoint(grade1);
g2 = gradetoint(grade2);
return (g1 + g2) / 2; // calculate gpa and return float value
}
/// END OF PROGRAM
http://www2.uwsuper.edu/reckman
|
|
|
|
|
maybe try flushing the standard input and outputs for that matter wouldn't hurt
|
|
|
|
|
I just tried your advice... I put in:
cout << flush;
before the getline(cin, s.name); but unfortunately, it didn't seem to solve the problem.
The only other input I took before getline(cin, s.name)was
cin >> numofstudents;
So... I decided to change that line from getline(cin, s.name); to cin >> s.name; and everything worked fined up until the point where I use getline(cin, s.id); Then it skips input again.
How would I go about to flush the input for getline();
Robert
http://www2.uwsuper.edu/reckman
|
|
|
|