|
Please , help me~~~~
i must finish it in the next week.
|
|
|
|
|
Dude - everyone's problem is an 'emergency'. Why do you need to finish it next week ? There's not really anything useful on there as it stands - is it homework ? Are you required to make it stay on top and autohide at the same time ? Can you get a notification of when the window is shown if it is autohiding ? I'm wondering if you can call SetWindowPos just when the window is visible and when it hides again.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
thx for your reply and i am sorry to use 'emergency'. But .........lots of reasons.
As this is a Shell Programming, and i've not had any experience about it, so i couldn't handle this problem.
It is my work, so i have to finish it as a part of project. By the way, it is not my homework and i am not a student.
Just because it is a Shell Object, the parent Wnd of the dialog is not the Desktop. its parent is a AppBar Object.
At the moment , i don't know where the problem would be. The project is based on the ShellApi SHAppBarMessage().
So i come here for help. i hope someone can help me to find and resolve the problem.
|
|
|
|
|
Can I use these methods Receive and Send of CSocket to send char or Unicode string like TCHAR ?
Thank you.
|
|
|
|
|
microsoftcertificate wrote:
Can I use these methods Receive and Send of CSocket to send char or Unicode string like TCHAR ?
Yes!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I created a CString StringData; on the Document Side
and also initialize it on the constructor as StringData = "";
Then i used the WM_CHAR, and typed this codes.
void CCaretsView::OnChar(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CCaretsDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
pDoc->StringData += nChar;//Error from here "It pop out an error saying that its error C2593: 'operator +=' is ambiguous
Invalidate();
CView::OnChar(nChar, nRepCnt, nFlags);
}
What Happen?
|
|
|
|
|
nChar is a UINT. conversing from int to char is implicit ( it happens all by itself ), but UINT is a completely different type. Try pDoc->StringData += (char)nChar;, that should do it ( or something similar to that, in any case ).
If you pass FALSE to your Invalidate, it won't call WM_ERASEBKGND, which will eliminate flicker. You realise that this code will not allow for the user to edit the string, but just to make it longer ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
hello body, I want to use IShellView to refresh my desktop.So I write follow codes,but it does not work. Please help me .Thanks in advance.
//--------------------------
CoInitialize(NULL);
IShellFolder *ppshf=NULL;
IShellView *iShelview=NULL;
SHGetDesktopFolder(&ppshf);
hr=ppshf->CreateViewObject(::GetDesktopWindow(),IID_IShellView,(LPVOID*&iShelview);
iShelview->Refresh();
iShelview->Release();
ppshf->Release();
|
|
|
|
|
Hello geek's
want to ask you..
what a method you are suggesting for me in this my project:
I want to grab frames or whole video from two USB WebCam's simultaneously..
So, what I must to use to do it ?
I mean what technology:
VFW
DirectShow
WDM
or smf..
I working with MSVS C++
thanks a lot
oh, links, source codes are welcome..
|
|
|
|
|
I remember that in DotNet it is not allowed to create windows registered in one thread but to be created with a different thread.
When I do this with Win32Api, it works but with problems.
My sample used a second thread to create a button whose parent's the main window. It didn't display at all except that I added a MessageBox( modeless ) statement right after the window creation. The button works normal until I response to the messagebox.
I guess the messagebox could have involved a message loop in it such that the button could display normal if the messagebox existed.
Does anybody know the reason of this?
Is it possible to create windows with different threads?
Your help is appreciated.
|
|
|
|
|
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.
|
|
|
|