|
Thank you !!
and another way i found...
file="C:/Documents and Settings/mount top.bmp";
m_hBmpNew = (HBITMAP) LoadImage(
AfxGetInstanceHandle(),
file,
IMAGE_BITMAP,
0,
0,
LR_LOADFROMFILE);
|
|
|
|
|
happy programmin.....;)
cheerz.....
|
|
|
|
|
Hi,
I am trying to display Japenese characters in my Unicode application's tree
view control. The English characters are displayed fine but it's not
displaying Unicode characters perfectly, insted it displays few junk
characters.
I tried changing the application to MBCS and Treeview control displays
Japenses characters fine in MBCS.
Can anyone please help me how can i enable TreeView control to display
Unicode characters. I tried with TreeView_SetUnicodeFormat API but with no
sucess .
Any idea ?
Reagrds
Alpha
|
|
|
|
|
Write a program that can be used as a math tutor for a young student. The program should display two random numbers which can be added, subtracted, multiplied or divided. The program should pause while the student works on the problem. When the student is ready to check the answer, he or she can press a key and the program will display a message of Congratulations if the result is correct. If the answer is incorrect, a message should be printed showing the correct answer.
Initially, the user to be prompted to enter a number to use a random number seed. The program should include a menu allowing the user to select Addition, Subtraction, Multiplication or Division. The final selection should allow the user to Quit the program. After the user has finished the math problem, the program should display the menu again. This process should be repeated until the user chooses to quit the program.
|
|
|
|
|
My Suggestion is start writing your program ,if any problem persisit then write that problem here.
no body going to do homework of yours
-----------------------------
"I Think It Will Help"
-----------------------------
Alok Gupta
visit me at http://www.thisisalok.tk
|
|
|
|
|
Hello everyone,
My question is how to change the font color of slide.
I have Automated PowerPoint Using Visual C++ MFC,such as:
_Application app;
Presentations presentations;
_Presentation presentation;
Slides slides;
_Slide slide;
ShapeRange shaperange;
Shapes shapes;
Shape shape;
TextFrame textframe;
TextRange textrange;
Font font;
FillFormat fillformat;
ColorFormat colorformat;
ShadowFormat shadow;
if(!app.CreateDispatch("Powerpoint.Application", &e))
{
CString str;
str.Format("CreateDispatch() failed w/err 0x%08lx", e.m_sc),
AfxMessageBox(str, MB_SETFOREGROUND);
return;
}
app.SetVisible(TRUE); Presentations presSet(app.GetPresentations());
_Presentation pres(presSet.Add(TRUE));
Slides slideSet(pres.GetSlides());
_Slide slide1(slideSet.Add(1, 2));
// Add text to slide, by navigating the slide as follows:
// slide1.shapes(#).TextFrame.TextRange.Text
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)1)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("My first slide");
}
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)2)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("Automating PowerPoint is easy\r\n"
"Using Visual C++ is powerful!");
font = textrange.GetFont();
font.SetName("Comic Sans MS"); //Set the font name.
font.SetSize((float)48);
}
Now the question is how to change the font color????
Help me,please!!
Thanks a lot!!;P
|
|
|
|
|
Hello everyone,
My question is how to change the font color of slide.
I have Automated PowerPoint Using Visual C++ MFC,such as:
_Application app;
Presentations presentations;
_Presentation presentation;
Slides slides;
_Slide slide;
ShapeRange shaperange;
Shapes shapes;
Shape shape;
TextFrame textframe;
TextRange textrange;
Font font;
FillFormat fillformat;
ColorFormat colorformat;
ShadowFormat shadow;
if(!app.CreateDispatch("Powerpoint.Application", &e))
{
CString str;
str.Format("CreateDispatch() failed w/err 0x%08lx", e.m_sc),
AfxMessageBox(str, MB_SETFOREGROUND);
return;
}
app.SetVisible(TRUE); Presentations presSet(app.GetPresentations());
_Presentation pres(presSet.Add(TRUE));
Slides slideSet(pres.GetSlides());
_Slide slide1(slideSet.Add(1, 2));
// Add text to slide, by navigating the slide as follows:
// slide1.shapes(#).TextFrame.TextRange.Text
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)1)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("My first slide");
}
{
Shapes shapes(slide1.GetShapes());
Shape shape(shapes.Item(COleVariant((long)2)));
TextFrame textFrame(shape.GetTextFrame());
TextRange textRange(textFrame.GetTextRange());
textRange.SetText("Automating PowerPoint is easy\r\n"
"Using Visual C++ is powerful!");
font = textrange.GetFont();
font.SetName("Comic Sans MS"); //Set the font name.
font.SetSize((float)48);
}
Now the question is how to change the font color????
Help me,please!!
Thanks a lot!!
cengyikun
|
|
|
|
|
Is there a way to add html code to a property sheet. I've done it with my About dialog by subclassing from CDHtmlDialog. But I've tried doing the same thing with a property sheet and cannot get it to work. It compiles OK, but I can't see how to display the page. For my About dialog, I just called DoModal. But when I ty that with the property sheet, it fails with Ambigous Call, probably because I also did an AddPage call to get the sheet added in the first place. Does anyone have any suggestions as to how to do this?
Jack
|
|
|
|
|
i'm trying to design a program that prompts the user for an integer adn then prints out all prime numbers up to that integer. i'm a beginner and i'm kind of stumped can anyone help
j pena
|
|
|
|
|
#include <iostream>
bool IsPrime (unsigned int);
int main(int argc, char* argv[])
{
unsigned int max;
cout << "Give an integer number: "; cout.flush;
cin >> max;
cout << endl;
for (unsigned int n = 1; n <= max; n++)
if (IsPrime(n))
{
cout << n << ", ";
cout.flush;
}
cout << endl;
return 0;
}
|
|
|
|
|
DaFrawg wrote:
I don't know how you are going to check that, there are several ways to do that
then why did u posted this ?
redindian
|
|
|
|
|
I'm not making his homework. I just give him a sample skeleton, not the solution. Sure I know a way to find out if it is a prime or not, I've done that before. But if you can't think of one by yourself, you just have to take math classes.
|
|
|
|
|
herez one way of doing it.....;)
#include<iostream.h>
#include<conio.h>
void main(void)
{
int number;
BOOL flag=0;
clrscr();
cout<<"Enter the number : ";
cin>>number;
cout<<"The numbers are :"\n";
for(int j=1;j<=number;j++)
{
flag=0;//reset the flag.....
for(int i=1;i<j/2 && flag==0;i++)
{
if(j%i==0)//if no remainder.....then set the flag
flag=1;
}//end of for(int i=1;i<j/2 && flag==0;i++)
if(flag==0)
cout<<j<<"\n";
}//end of for(int j=0;j<=number;j++)
}//end of void main(void)
hope that helpz.....
cheerz.....
|
|
|
|
|
Looks like homework to me, so I won't give you answers. I don't like the ones others have given, though they will work. (I even have a book someplace that tells how to check if a number is prime, but it fails on Newton primes - I can't recall exactly what they are called)
What I would do, and what I suspect your professor wants: create a linked list of all known primes, up to the current number. This list starts empty. You start by checking the lowest unknown number against the list. If anything in the list divides your number it is not prime. If the number is prime place it in the list. Either way move to the next highest number.
If this isn't enough, google will reveal several C programs that do the same thing. Don't bother handing them in though. Professors are fairly good at spotting those programs even after students hide the origions. Besides, I might get a job with you latter, and I'll want you to have done the work then.
|
|
|
|
|
I have not been working on a native C++ program of mine for a while and today I tried to compile it (using Visual C++ .NET 2003) and I got the error:
Command line error D2022 : cannot open 'o:\...\Debug\RSP00000F.rsp'
Does anyone have any idea what is going on?
Happy Programming and may God bless!
"Your coding practices might be buggy, but your code is always right."
Internet::WWW::CodeProject::bneacetp
N-Tech Productions
http://www.n-tp.com/
|
|
|
|
|
I am trying to find some code that pulls off the RIFF, LIST and INFO chunks from a WAV file. I found several articles on the RIFF but I have found few that detail the 'LIST' or 'INFO' chunks of a WAV file. If I could find an article and some code snippet that describes how to extract this information, that would be awesome. As I stated, I found various articles/links that detail what these chunks are composed of but nothing really describes the "how to" of extracing this information. I would like to pull of information such as IART, ICOP, INAM, etc. Does anyone have any good articles/links that describe such a process?
|
|
|
|
|
I need to ensure that the jumps in the inline assembly code I'm writing will always be relative, since the code will be self modyfying, so the same code may be excecuted from muliple memory locations. According to the manual I found, it should be something like this:
jmp SHORT (signed jump bytes)
However, this just gives me a bunch of syntax errors, so does anyone know the correct way?
|
|
|
|
|
Can you tell me please how to pass strings as parameters of a function so we can use them for different purposes?Please help me !!!!
|
|
|
|
|
void foo1( LPCTSTR lpszName )
{
}
or
void foo2( CString &strName )
{
}
...
foo1("My name is...");
CString str("Bob");
foo2(str);
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
you forgot:
<code>include <string>
using std::string
void foo3( string s)
{
}</code>
not to mention char *. Is LPCTSTR a macro that converts to narrow and wide strings ? Then there's BSTR and bstr_t......
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
I guess it's better to replace
using std::string;
by
using namespace std;
or else the class 'string' will not be available (it's 'std::string', not 'std::string::string').
LPCTSTR is not really a macro:
#define LPCTSTR const char*
(or something like that, I probably forgot the As and Ws for ANSI and Unicode)
|
|
|
|
|
DaFrawg wrote:
I guess it's better to replace
using std::string;
by
using namespace std;
Nope, that's rubbish. That scopes all of namespace std unnecessarily, if std::string is all that is wanted.
DaFrawg wrote:
or else the class 'string' will not be available (it's 'std::string', not 'std::string::string').
You're completely wrong here. I don't even know how you ended up with this theory.
DaFrawg wrote:
LPCTSTR is not really a macro:
#define LPCTSTR const char*
(or something like that, I probably forgot the As and Ws for ANSI and Unicode)
That is, by definition, a macro, just a parameterless one.
Thanks for playing tho.
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
Nope, that's rubbish. That scopes all of namespace std unnecessarily, if std::string is all that is wanted.
Sorry, I didn't know that there was something like "using Declaration".
MSDN: "The using declaration introduces a name into the declarative region in which the using declaration appears."
Christian Graus wrote:
That is, by definition, a macro, just a parameterless one.
Tell that the people who claim they are called "symbolic identifiers".
|
|
|
|
|
DaFrawg wrote:
Sorry, I didn't know that there was something like "using Declaration".
NP. Glad to help you learn somethng new. The using declaration is better because you control what gets pulled into global scope. Otherwise, you have no real idea.
DaFrawg wrote:
Tell that the people who claim they are called "symbolic identifiers".
They just say that because macros are evil, but a rose by any other name....
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Christian Graus wrote:
you forgot:
Technically speaking, yes. Since STL and Unicode are not part of my normal development paradigm, I don't often think of them.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|