|
They are 16x16 bitmaps. Windows does not provide a standard set that you can use from memory so you need to supply your own. On XP you may be able to use the Theme functions to get it to draw them for you.
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Hi,
I am trying some code similar to what I have posted below, but it is not being compiled on the VC++ 7.0 and on VC++ 6.0 it gives a INTERNAL_COMPILER_ERROR :
#include <list>
...
template <class clDataType>
class CMyData
{
clDataType myObj;
unsigned long myObjSize;
public:
...
};
template <class clDataType>
class CMyManager
{
unsigned int nIndex;
clDataType myData;
list<CMyData<clDataType>> myList;
public:
...
};
What I am trying is to have a STL list of CMyData<clDataType>!
Is it possible or am I doing some mistake?!
Thanks,
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Your problem is this line:
list<CMyData<clDataType>> myList;
due to the lexical analysis of C++ it has to be written as this:
list<CMyData<clDataType> > myList;
as such the space is crucial. The >> is parsed as right-shift, even though it makes little sense in that context (also is why it causes an error).
Hope that helps.
--
Henrik Stuart (http://www.unprompted.com/hstuart/)
|
|
|
|
|
Hello Henrik,
It worked!... Thanks a ton! ... Well pointed out!
So much about Micro$oft Compiler!
Thanks,
Rgds,
Nirav
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Hey,
You're welcome. It isn't, however, limited to Microsoft's compiler, it's mandated in ISO/IEC 14882:1998 and as such part of C++ as a language. You would get the same behaviour in any other C++ compiler.
--
Henrik Stuart (http://www.unprompted.com/hstuart/)
|
|
|
|
|
Oh, is it?!
My apologies to Bill Gate$ & Micro$oft!
* Don't wish it was easier, wish you were better! *
|
|
|
|
|
Don't apologize. The VC should report this as a parse error, not internal compiler error!
Robert-Antonio
Love, truth and electric traction must gain victory over hate, lie
and diesel traction.
|
|
|
|
|
Hello everybody, well i've got a question Visual C++ concerning creating a windows application instead of console application, and sorry if it's a silly question since i'm used to work on console applications only. So please can u show me the steps and the required syntax for creating this windows application ?
Thanks for your help .
|
|
|
|
|
with visual studio, create a new project "MFC AppWizard exe" and continue from there, you have 3 choices, SDI, MDI or dialog based; this will generate the basic skeleton for an application.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I highly recommend these books on windows programming using C++. Make sure you read them in this exact order.
MFC:
Introduction to MFC Programming with Visual C++ by Richard M. Jones
Programming Windows With MFC by Jeff Prosise
Win32 API:
Programming Windows by Charles Petzold
Kuphryn
|
|
|
|
|
Am trying to get Jeffrey's LastMesaageBox example hooking software working on XP using Microsoft Development Studio .NET. I keep getting an error that the stack is overflowing just when the message box is being displayed. Anyone have any ideas?
|
|
|
|
|
Debug it. Where is the error linked to?
Kuphryn
|
|
|
|
|
It says "Unhandled exception at 0x10011669 in 22 LastMsgBoxInfo.exe: 0xC00000FD: Stack overflow." It then says "There is no source code available for the current location." so I look at the Disassembled version and can't figure out what's going on. Any way of looking at assembler code to debug?Hope you can help.
|
|
|
|
|
Most likely you are doing infinite recursion which is very easy to do with hooks...
John
|
|
|
|
|
Thought so, the stack was full of repeated function calls. Can't see why this is happening though, how come it is easy to do with hooks? Any way of preventing this? Thanks.
|
|
|
|
|
if you do the wrong thing you can end up calling yourself by passing the hook on to the next hook in the list. Try commenting out the CallNextHookEx part and see if it crashes again...
John
|
|
|
|
|
how to hide the nasty dash rectangular boder when you drag window especially you have a special region as your window shape.
|
|
|
|
|
This only occurs when the user has unchecked "show window contents while dragging" in the display applet in control panel.
You could use SystemParametersInfo() with the action of SPI_GETDRAGFULLWINDOWS to query the current value and set it to true just prior to dragging your window. Once the drag is complete, you can call SystemParametersInfo() again to restore SPI_GETDRAGFULLWINDOWS to the original value.
Seems like a lot of work and code purely for asthetics... I'd verify the requirement, twice.
onwards and upwards...
|
|
|
|
|
Thanks, a helpful idea. I get another way, when the window consists of only client (maybe dialog based), we can deal with WM_LBUTTONDOWN,WM_LBUTTONUP,WM_MOUSEMOVE,to drag the window show its content and hide the border(because it has no border indeed)
SystemParametersInfo() is a system level function? I'm so afraid of changing system settings in my code ;P
|
|
|
|
|
Here is the scenario:
<br />
UINT WorkerThread(LPVOID pParam)<br />
{<br />
while(1==1)<br />
{<br />
} <br />
return 0;<br />
}<br />
<br />
Main::MainFunction()<br />
{<br />
AfxBeginThread(WorkerThread, (LPVOID)this, THREAD_PRIORITY_NORMAL);<br />
}<br />
<br />
Main::FunctionImTryingToCall()<br />
{<br />
}<br />
From the worker thread, I am trying to call the main::FunctionImTryingToCall() function. Anything I have tried so far has been unsucessful. Anyone know how to do this? Any help is appreciated as always.
-Dev578
|
|
|
|
|
UINT WorkerThread(LPVOID pParam)
{
Main* pMain = static_cast<Main*>(pParam);
while (true)
{
pMain->FunctionYourTryingTocall();
}
return 0;
}
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
Damn that tag preprocessor!
Main *pMain = static_cast<Main*>(pParam);
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I can't believe you beat me to the answer.
Do you live on CP, 24/7?
I Dream of Absolute Zero
|
|
|
|
|
It was my 1st visit in 24 hours. So I was just lucky.
Roger Allen - Sonork 100.10016
Roger Wright: Remember to buckle up, please, and encourage your friends to do the same. It's not just about saving your life, but saving the quality of life for those you may leave behind...
|
|
|
|
|
I'm sure simply doing something like this would do:
<code>
UINT WorkerThread(LPVOID pParam)
{
while(TRUE)
{
Main* pMain = static_cast<Main*>(pParam);
if(pParam != NULL)
pMain->FunctionImTryingToCall();
}
return 0;
}
</code>
I Dream of Absolute Zero
|
|
|
|