|
See the Extras section of this article. It's MFC, but you should be able to accomplish the same thing with Win32.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Look up DeferWindowPos , BeginDeferWindowPos , and EndDeferWindowPos functions in MSDN.
Independent ACN Business Owner- Check out the possibilities for your future!
- Financial independance
- Full time or Part time
- In more than 20 countries through North America, Europe, Asia and the Pacific
- Featuring the ACN IRIS 5000 video phone. See the person you are talking to.
Within you lies the power for good - Use it!
modified 17-Jan-12 17:36pm.
|
|
|
|
|
wow i like this forum.
because i have an exam i dont have the time to check yours suggestion. i decide to limit the resize the window so i dont need to move anything.with this
case WM_GETMINMAXINFO:
{
LPMINMAXINFO pinfo =(LPMINMAXINFO)lParam;
if (pinfo!=NULL)
{
pinfo->ptMinTrackSize.x=750;
pinfo->ptMinTrackSize.y=550;
}
return 0 ;
}
thanks again
|
|
|
|
|
a1_shay wrote: wow i like this forum.
Glad you like it... now use it wisely...
|
|
|
|
|
Hi,
The following code compiles no probs...
typedef struct SLLNode_t
{
void* m_pData;
struct SLLNode_t* m_pNext;
};
void foo()
{
struct SLLNode_t* pNewNode = (struct SLLNode_t*)malloc(sizeof(struct SLLNode_t));
}
The following, with a call to assert, generates a an error C2143: syntax error : missing ';' before 'type'.
typedef struct SLLNode_t
{
void* m_pData;
struct SLLNode_t* m_pNext;
};
void foo()
{
assert(0 == 0);
struct SLLNode_t* pNewNode = (struct SLLNode_t*)malloc(sizeof(struct SLLNode_t));
}
assert is defined as follows...
#define assert(_Expression) (void)( (!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression), _CRT_WIDE(__FILE__), __LINE__), 0) )
What is wrong? How do I fix it?
Thanks - John.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
__John_ wrote: What is wrong? In C programming language variable declarations must be at the beginning of the block.
__John_ wrote: How do I fix it? This way
void foo()
{
struct SLLNode_t* pNewNode = (struct SLLNode_t*)malloc(sizeof(struct SLLNode_t));
assert(0 == 0);
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
You could do this -
void foo()
{
struct SLLNode_t* pNewNode = NULL;
assert(0 == 0);
pNewNode = (struct SLLNode_t*)malloc(sizeof(struct SLLNode_t));
}
|
|
|
|
|
Of course. However, it won't change program behaviour.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Normally assert is done before any processing is done.
That's what I meant to indicate.
|
|
|
|
|
Yes, I got that. I was just kidding a bit on 'assert(0==0) '.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Doh!
I've been doing C++ for too long and forgot that one.
Thanks guys, +5 all round.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
You are welcome. And thank you too.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
May I ask, what is the purpose of:
assert(0 == 0);
??
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
Considering his function name is foo() , he's probably just omitting what he's asserting.
|
|
|
|
|
To proudly state his math convinctions?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
My first guess would be just a proof of concept.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
assert(0 == 0);
Will never assert, it is just to illustrate the problem.
“If I had asked people what they wanted, they would have said faster horses.”
― Henry Ford
|
|
|
|
|
Hi,
I'm working with a C++ project and have created a new .h file that contains typedef of new types. How do I use the new types in another class?
#ifndef COMMONSETTINGS_H_
#define COMMONSETTINGS_H_
typedef enum
{
XX = 0,
YY,
ZZ
} ProductType;
#endif /* COMMONSETTINGS_H_ */
And the class that uses the type ProductType
class TestClass
{
public:
TestClass();
virtual ~TestClass();
private:
ProductType product;
};
How do I do to use ProductTyp in TestClass? Now I get compile erro since TestClass can not find ProductType.
What is the best way to solve this? I want to declare new types in a file and use the types in several other classes.
/Olof
|
|
|
|
|
Stupid question, but did you #include the header file in your compilation unit?
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
|
Enumerations did not need the typedef keyword. Use
enum ProductType
{
XX,
YY,
ZZ
};
You should also think about moving your common settings into those classes they are belonging to (e.g. the class that acts according to the ProductType enumeration). This is better C++ style and makes your code modules better portable to other projects.
To use such class specific enumerations from other classes, prefix them with the class name (e.g. MyClass::ProductType ).
Joe
|
|
|
|
|
I use this solution, then it's working.
|
|
|
|
|
please include that headerfile..
|
|
|
|
|
I already include that header file
|
|
|
|
|
I read the UAC article on CodeProject. So I want to see what others are using to elevate when using CreateProcess on Windows Vista, maybe Windows 7, when I get to testing on it.
I'm using CreateProcess to run PkgMgr.exe, but it wants elevated privileges 740.
Plus I want to spawn 2 threads, one to run the progress bar, and one to run the CreateProcess.
Tried _beginThread, but I was only able to get 1 working at a time.
|
|
|
|