|
One way would be to grab the screen shot of the view window in a CDC and CBitmap in ChildFrame/MainFrame. Then Hide the view in ChildFrame/MainFrame. Then display the grabbed screenshot in the client area of ChildFrame/MainFrame. Then you can display any graphic on top of it. Then on another event, you can show the view again. This is the dirty way.
Another would be to create a floating modeless dialog box. Then using GDI, make it turn into a frame only with hollow center, like a rectangle. Then you can move the frame anywhere.
There must be better ways to do it. Maybe someone else can help.
this is this.
|
|
|
|
|
http://www.codeproject.com/cpp/rpnexpressionevaluator.asp
Above is top-rated but perhaps because it was written in 2003 the expr_eval.cpp needs a modern tweaking. As I wanted to learn the use of namespace in this code I'm unable to tweak it to compile cleanly. Using Dev-C++ v 4.9.9.2 and getting linker error. Can someone explain how to fix? Thanks!
>>Compiler: Default compiler
Compiler: Default compiler
Executing g++.exe...
g++.exe "D:\test\expr_eval.cpp" -o "D:\test\expr_eval.exe" -I"d:\Dev-Cpp\lib\gcc\mingw32\3.4.2\include" -I"d:\Dev-Cpp\include\c++\3.4.2\backward" -I"d:\Dev-Cpp\include\c++\3.4.2\mingw32" -I"d:\Dev-Cpp\include\c++\3.4.2" -I"d:\Dev-Cpp\include" -L"d:\Dev-Cpp\lib"
C:\DOCUME~1\Billy\LOCALS~1\Temp/ccMTbaaa.o(.text+0x1c4):expr_eval.cpp: undefined reference to `ExpressionEvaluator::calculateLong(std::string, long&)'
C:\DOCUME~1\Billy\LOCALS~1\Temp/ccMTbaaa.o(.text+0x2f9):expr_eval.cpp: undefined reference to `ExpressionEvaluator::calculateDouble(std::string, double&)'
C:\DOCUME~1\Billy\LOCALS~1\Temp/ccMTbaaa.o(.text+0x42c):expr_eval.cpp: undefined reference to `ExpressionEvaluator::calculateLong(std::string, long&)'
collect2: ld returned 1 exit status
Execution terminated <<
Here's the code:
#pragma warning (disable:4786)
#include <iostream>
#include <string>
namespace ExpressionEvaluator
{
enum
{
eval_ok = 0,
eval_unbalanced,
eval_invalidoperator,
eval_invalidoperand,
eval_evalerr
};
int calculateLong(std::string expr, long &r);
int calculateDouble(std::string expr, double &r);
}
using std::string;
using std::cout;
using std::endl;;
int main()
{
long result;
double resultdbl;
int err;
string s;
s = "1+2*(1-2-3-4)";
err = ExpressionEvaluator::calculateLong(s, result);
if (err != ExpressionEvaluator::eval_ok)
cout << "Error while evaluating!" << endl;
else
cout << "Evaluation of (int):" << s.c_str() << " yielded: " << result << endl;
s = "1.1/5.5+99-(4.1*(2+1)-5)";
err = ExpressionEvaluator::calculateDouble(s, resultdbl);
if (err != ExpressionEvaluator::eval_ok)
cout << "Error while evaluating!" << endl;
else
cout << "Evaluation of (double):" << s.c_str() << " yielded: " << resultdbl << endl;
ExpressionEvaluator::calculateLong("(1<2)*5+(99==99)", result);
//resultdbl = 3.14/4*5-66;
return 0;
}
|
|
|
|
|
That can't be all the code, it declares the existence of some functions, but does not define them. Hence the errors.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hmm .. those 2 functions are not in the zip. I wrote to the author of the article. Thanks.
|
|
|
|
|
I have been thinking of were I should go to college, hopefully I can go to Full Sail http://www.fullsail.com/[^] in Florida, nice weather, anyone here know if its a good school, im planning on studying Game Developement, anyone else consider a school for me?
IM PROUD TO BE A GMAIL;
|
|
|
|
|
I want to inherit a class which is a template. typename
<br />
template<class E><br />
class Base<br />
{<br />
xyzfunc(E&);
...<br />
};<br />
<br />
<br />
class Deriv : public Base<Base<E>*>
{<br />
}<br />
the purpose of class Deriv needs to do basically the same as its baseclass("Base") but only always with different instances of Base<e>
exp:
use:
<br />
Base<int*> a;<br />
int ai=104374;<br />
a.xyzfunc(&ai);<br />
Base<double*> b;<br />
Base<unsigend char*> c;<br />
<br />
Deriv de;<br />
de.xyzfunc(&a);<br />
de.xyzfunc(&b);<br />
de.xyzfunc(&c);
<br />
<br />
I hope anyvody understood what i meant, thx if anybody could help me
beat up urself pls
|
|
|
|
|
This compiles.
template <class E>
class Base
{
void xyzfunc(E&) { } //example
};
//now the derived class should be something like this
class Deriv : public Base<class E>//there is the problem
{
};
<hr><b>Maxwell Chen</b>
|
|
|
|
|
ok that's fine but:
if i create an instance of Base like this:
<br />
Base<int*> baseint;
then an instance if its derived class like this:
<br />
Deriv abc;<br />
abc.xyzfunc(baseint)<br />
the derived clas i chnaged to
<br />
class Deriv: public Base<Base<class EF>*><br />
{<br />
};<br />
the error is: cannot convert Base<int*>* to Base<class ef="">*
...
im still confused
...
I figured a way around with void*(instead of BAse<..>* a void*) but its not that excellent i think,..
so im still tryin to do the template way
cann anybody help me again?
|
|
|
|
|
Hi everybody, can any body explain me, how i can insert in my win32 API aplication, the xp style, and permit me, redefine de window procedure of a child window.
|
|
|
|
|
Google for XP AND manifest.
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
I search in google, but wathever i do, my aplication does not work when i redefine the window procedure of a child window,and adding the manifest file to the aplication resources.
|
|
|
|
|
Have you check the Manifest file is of resource type RT_MANIFEST and resource id =1.
if you like, I can fwd you a Demo XP enabled Application!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Yes i do all that things, and it doesnt work, but if i do not redefine any window procedure it works ok. If you can send for my any example, I will be grateful.
|
|
|
|
|
Hello Mr Neliocc,
I have forwarded the sample source code to your voldem........@yahoo.com email address.
[OT] By the Way, you seems to be a big fan of Harry Potter
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
http://www.codeproject.com/dotnet/ManifestInjection.asp
http://www.codeproject.com/w2k/makexp.asp
http://www.codeproject.com/useritems/ManifestMacro.asp
http://www.codeproject.com/cpp/xpstylemfc.asp
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
can anybody help me about this?thanks
detail:i get CImageList using SHGetFileInfo(),and how i get the icon index from the CImageList just by a file's extension(not full file name)
thanks
|
|
|
|
|
Does this search help?
"Ideas are a dime a dozen. People who put them into action are priceless." - Unknown
|
|
|
|
|
hehe ,let me see tomorow,tonight is too late (in asia)
|
|
|
|
|
|
I tried replacing the toolbar in my application with a 24 bit color toolbar bitmap. Since I edited the original toolbar bitmap image the buttons are all in the right place, however, saving the image as a 24 bit bitmap makes it look (in the application) hideous.
Is there any way to simply increase the resolution of the toolbar bitmap as it is rendered in the application ? (from 4 bit to 8 bit color ?)
"One of the Georges," said Psmith, "I forget which, once said that a
certain number of hours' sleep a day--I cannot recall for the moment how
many--made a man something, which for the time being has slipped my
memory."
|
|
|
|
|
|
Hi people ,
I´m working on an application that must draw some graphics using OpenGL. The aproach I´m using is to
initialize the window ,to set graphics mode and to set render context for OpenGL at the mainthread < InitInstance() > and then call a thread that must keep rendering frames until the end of the program.
well... I noticed that everithing works fine at the main thread ( including GL´s drawing calls)but when I make the same calls inside the thread , they have no efect on the window.
I can´t understand , because all the variables I use inside the thread are global.
Can you help me ?
Ps: 1) I created the thread using CreateThread.
2) My project is a simple win32 application => WinMain , InitInstance , Createwindow , winProc , etc...
|
|
|
|
|
You can only update the window from the thread that created it, so you'll have to create the window inside the thread that's going to be doing the OpenGL rendering.
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"
|
|
|
|
|
I do this in one of my OpenGL window classes as well.
First you must/should do the following when:
registering the window class:
- add CS_OWNDC | CS_HREDRAW | CS_VREDRAW styles
- set hbrBackground to NULL
creating the window:
- add WS_CLIPCHILDREN | WS_CLIPSIBLINGS styles.
using the window:
- handle WM_ERASEBKGND and return true
- handle WM_WINDOWPOSCHANGED when !(flags & SWP_NOSIZE) to update the viewport
There can be any number of things wrong.
A couple of the more common are:
- the DC and RC must stay current to the rendering thread while rendering (i.e. the app thread can't use the DC/RC without some syncing with the render thread). generally you get the DC right after the window is created, get an RC for the DC, and keep hold of both until the window is destroyed.
- because the window is created by the app thread it gets the WM_PAINT msg. at some point before you return (true) you should call ::ValidateRect() to clear the WM_PAINT msg. if you don't call this, and return false, the default paint handler will paint with the background brush.
...cmk
Save the whales - collect the whole set
|
|
|
|
|
The Problem was that I needed to make a current rendering context inside the thread:->.
I created a window for the aplication , Initialized OpenGL on the aplication , and created a rendering context inside the thread.
It works fine now , and I´m geting 150 frames /second !!!!
|
|
|
|