|
Then I need to draw this bitmap from clipboard. How can I select it for device context, to draw it on the screen?
This code isn't working:
CDC dcTmp;<br />
dcTmp.CreateCompatibleDC( pDC );<br />
<br />
HBITMAP handle = (HBITMAP)GetClipboardData(CF_BITMAP);<br />
CBitmap * bm = CBitmap::FromHandle(handle);<br />
dcTmp.SelectObject( bm );<br />
<br />
pDC->BitBlt( 0,0,uWidth,uHeight, &dcTmp, 0,0,SRCCOPY );
~~~~
|
|
|
|
|
Please somebody help me
~~~~
|
|
|
|
|
Code:
#include <iostream>
#include ".\PrimeGen.h"
using namespace std;
void main ()
{
CPrimeGen PrimeRange1(1,1000);
int iCountPrimes = 0;
for (int iCount = 1; iCount = 1000; iCount++)
{ if (PrimeRange1.PrimeNumber[iCount] == true)
{iCountPrimes ++;}
}
cout << iCountPrimes;
}
class CPrimeGen
{
public:
CPrimeGen(int iUpperBound);
CPrimeGen(int iUpperBound, int iInterval);
CPrimeGen(int iLowerBound, int iUpperBound, int iInterval);
virtual ~CPrimeGen();
bool isPrime (int iNumber);
bool *PrimeNumber; // array of PrimeNumbers
};
Jon
|
|
|
|
|
which symbol is unresolved ?
Do the chickens have large talons?
|
|
|
|
|
Test1 error LNK2019: unresolved external symbol __endthreadex referenced in function "void __stdcall AfxEndThread(unsigned int,int)" (?AfxEndThread@@YGXIH@Z)
Test1 error LNK2019: unresolved external symbol __beginthreadex referenced in function "public: int __thiscall CWinThread::CreateThread(unsigned long,unsigned int,struct _SECURITY_ATTRIBUTES *)" (?CreateThread@CWinThread@@QAEHKIPAU_SECURITY_ATTRIBUTES@@@Z)
Any ideas?
Jon
|
|
|
|
|
You are providing too little information. However, I would guess that you are missing a multithreading library. Make sure you are linking with multithread libraries.
Mutithreaded libraries are "LIBCMT.LIB" (release) and "LIBCMTD.LIB" (debug). However, I find it strange that the MFC is the one requesting the presence of "_beginthreadex" or "_endthreadex". This probably means you are not linking against MFC base libraries.
Anyway, try to link with the multothreaded libraries and see what you get. If it doesn't work then try to provide more information on the project settings (kind of project, compiler settings, linker settings, ...).
I hope this helps,
Rilhas
|
|
|
|
|
Hello,
I'm trying to program a few exception classes for use in some software I'm working on. I'm more familliar with Java style of exception programming, and am having trouble finding some good API documentation on C++ exception classes. My plan was to inherit from exception, or runtime_error, however I can't find figure out what methods I'm inheriting without a good API. Does anone know of a good API page on the exeption classes?
Thanks.
Patrick
|
|
|
|
|
|
Thanks for the link, that puts me on the right trak; however, considering the following example:
<br />
#include <iostream><br />
#include <exception><br />
using namespace std;<br />
<br />
class myexception: public exception<br />
{<br />
virtual const char* what() const<br />
{<br />
return "My exception happened";<br />
}<br />
} myex;<br />
<br />
int main () {<br />
try<br />
{<br />
throw myex;<br />
}<br />
catch (exception& e)<br />
{<br />
cout << e.what() << endl;<br />
}<br />
return 0;<br />
}<br />
This example does part of what I'm looking for, however I'd like to have more options when using the exception class. I'd like to give the programmer the option of passing in their own error message to the exception class, or to just use the default. Anyone know where I can look fir this?
Thanks.
Patrick
-- modified at 16:47 Thursday 13th July, 2006
|
|
|
|
|
pgav wrote: Anyone know where I can look fir this?
What Joe Woodbury said is correct. The C++ base exception class only defines what() so unless you want to use that you can just create your own base exception class to your own design requirements.
"Just about every question you've asked over the last 3-4 days has been "urgent". Perhaps a little planning would be helpful?" Colin Angus Mackay in the C# forum
led mike
|
|
|
|
|
With C++ exceptions, you can throw any object, even an int if you feel like it. There is no base exception class. (STL has an exception class, but it's very limited.)
I STRONGLY suggest writing your own exception class and write it to fit your requirements.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
hi,.....hhow can v load any movie clip in opengl?....`i have seen the tutorial in nehe..but it is not going wid the program i have developed..not showing the animation of the movie instead showing conflicts with already made tecxtures GL_TEXTURES_2D..how can v resolve dis?
Regards
NooR
|
|
|
|
|
In the OnAccept() handler you need to accept the incoming socket.
|
|
|
|
|
Hi any1 can help me how do i can make the curve mountain area in my game terrain...
Thx Regards
NooR
|
|
|
|
|
|
yup using OpenGl...n in tool visual C++..how can i do dis..make the curve shape of mountains making its textures>.....
NooR
|
|
|
|
|
|
Get the Redbook. What you ask is not a trivial question.
earl
|
|
|
|
|
Please do not get offended...
There are free spell checkers you can use on your posts even in the browser, I also don't have English as my natural language, if you can't make your thoughts understandable, the ratio of replies will be smaller...
/// HACK: Don't PANIC ...
http://en.wikibooks.org/wiki/User:Panic2k4
|
|
|
|
|
Does anyone know of a class that parses C/C++ code (like the classview tree in VS)?
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Parse how? You mean a lexer?
|
|
|
|
|
earl wrote: Parse how? You mean a lexer?
I'm not sure what it's called else I would have googled it.... I want to extract structs, typedefs, classes, externs, globals, etc. the same way the class-view tree does in Visual Studio. I don't know what the act of doing such is called, other than "parsing".
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Man, that's not a trivial thing to do.
To start you'll need a lexer -- takes text and determines if it's valid C++. This alone takes some doing, cause C++ isn't the most syntactically pretty language around. Don't try and do it yourself or you'll die of old age; instead, write a grammer and lean on a lexer.
Then you'll need a parser; it takes the output from a lexer and typically gives you a structure tree.
Grab the dragon book and read about compiler construction; you're building the first two or three stages of one.
For available tools, try lex, yacc, and bison.
earl
|
|
|
|
|
Parsing C++ is insanely difficult.
You could try hacking the gcc parser (hard) or maybe take a look at this[^]. It's a long time since I looked at PCCTS but IIRC, it seemed to work
I use CCCC[^] for metrics sometimes and that has a parser as well.
0 bottles of beer on the wall, 0 bottles of beer, you take 1 down, pass it around, 4294967295 bottles of beer on the wall.
Awasu 2.2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
Hello,
I have a list control item with a given amount of columns and respective headers. I would now like to add some sorting functionality, where, upon clicking the header of the respective column, it sorts alphabetically. Are there any functions to accomplish this?
|
|
|
|