|
Now I am confused. Are you using .NET or the Win32 API?
If you are using the Win32 API, yes, you can. I don't know about .NET to be able to answer your question.
What you might want to do is to call
MSG TheMsg;<br />
PeekMessage(&TheMsg, INVALID_HANDLE_VALUE, 0, 0, PM_NOREMOVE);
right away after creating a thread that will have use of messages (like a window or a thread that should respond to messages sent to it via PostThreadMessage) because the message queue for a thread does not exist until one of the message retrieval functions is called (GetMessage, PeekMessage, etc.)
Windows does not create a message queue for a thread unless the thread 'needs' it. This could be your problem.
|
|
|
|
|
I have the rather strange desire to draw a rectangle on top of a CHtmlview window in an MDI program. I naively thought that I could to this in OnPaint, but this would not seem to be the case.
Is it possible to draw on top of this view type, and if so , how does one go about it?
|
|
|
|
|
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"
|
|
|
|