|
I gald it was helpful for you.
|
|
|
|
|
i still have a question
i wanna rewrite a Dialog project and try to use those funtions
when i use CCriticalSection and i include the <afxmt.h>
some functions and variables can't be seen in a Thread function
it shows that
error C2065: 'USES_CONVERSION' : undeclared identifier
error C2065: 'ReadDirectoryChangesW' : undeclared identifier
error C2065: 'm_list' : undeclared identifier
error C2227: left of '->InsertItem' must point to class/struct/union
error C2227: left of '->GetItemCount' must point to class/struct/union
error C2227: left of '->SetItemText' must point to class/struct/union
How can i deal with it ??
And why ??
|
|
|
|
|
Did you include Header files WinBase.h Windows.h ?
|
|
|
|
|
no
but i tried include windows.h and winbase.h
still have two error
error C2065: 'USES_CONVERSION' : undeclared identifier
error C2065: 'ReadDirectoryChangesW' : undeclared identifier
should i include other head file or something??
thank you
|
|
|
|
|
I can use of these files without any header file (Im using of Visual Sudio 2008) but what was your application type and whats your IDE?
|
|
|
|
|
Dialog-Based project
IDE is VC 6.0
if i don't include <afxmt.h>
that part is all right
but there is other error
error : missing ';' before identifier 'm_Sec'
error C2501: 'CCriticalSection' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
so that makes me confused
|
|
|
|
|
last reply
i miss something
it's if i don't include afxmt.h
|
|
|
|
|
search on the header files of VC(ctrl+shift+F) and see is it existing on Winbase.h or windows.h?
|
|
|
|
|
I succeded to convince my boss to give me some time to implement somesort of code in order to facilitate my future job of persisting multiple types of C++ objects into database, as well as the automatic transmittion of objects through the network.
For the time being I have some ideas to start with creating something like CArchive, and play with multiple implementation/overriding of the >> operator.
I already developed somthing that easily trasmits a line of different types of primitive objects.Now I think I need an XML parser to the job of hiearchically representing a complex object into a stream of data that will be sent. The same way I need something that eases the persistance of objects into database and their reconstruction from database records ?
Please help me, and I know you always do.
Thank you in advance.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
That's a pretty open-ended topic
The .NET framework can help a lot, especially if you go the XML route.
Generally, very little work is required to serialize managed objects.
For native C++, this article may help with some ideas:
Roll Your Own Persistence Implementations to Go Beyond the MFC Frontier[^]
Just my 2 cents,
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Thank you, thank you very much for that link indeed.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
Have a look at Boost Serialization[^] library. It does pretty much what you are trying to implement.
|
|
|
|
|
Thank you,too,Nemanja.
Our Philosophy, Mohammed Baqir Al Sadr
|
|
|
|
|
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style=WS_CHILD|WS_MAXIMIZE;
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style|=WS_CHILD|WS_MAXIMIZE;
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
|
|
|
|
|
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWndEx::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
why not like below?
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
return CMDIChildWndEx::PreCreateWindow(cs)
}
|
|
|
|
|
coded in the dark maybe ? ^^
seriously, I see no reasons at first sight...
|
|
|
|
|
The former may have been what was left after some code was removed. For example:
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIChildWndEx::PreCreateWindow(cs) )
{
return FALSE;
}
return TRUE;
}
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
It looks like code the wizard would create, so you can insert your code before
the return TRUE;
If you're just going to call the base class, why override it?
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
David Crow's mostly right, except you will likely add code before the TRUE (or before the PreCreateWindow.)
I was going to add that if you don't add code, the compiler will optimize the construct away. Out of curiosity, I tested this on VS 2005 and VC++ 6 and the result was a horror. For those curious, here's the resulting code with optimizations on:
mov eax, DWORD PTR _cs$[esp-4]
push eax
call ?PreCreateWindow@CView@@MAEHAAUtagCREATESTRUCTA@@@Z
neg eax
sbb eax, eax
neg eax
ret 4
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
NO difference.
-@SuDhIrKuMaR@-
|
|
|
|
|
Hi all,
Please tell me how can find the Feburary is Leap Year or not.
How can Check the number of days of Feburary,it is 28 or 29.
please help me for this.
I m waiting for your Valuable suggestions.
Thanks in Advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Well it is simple:
bool isLeapYear(int year )
{
return year % 400 ? year % 100 ? year % 4 ? false : true : false : true;
}
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
|
|
|
|
|
That's superb!
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
Thank you, pal.
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
|
|
|
|
|
Jijo raj wrote: That's superb!
that's school classics...
I didn't bother posting it, as it's obvious you can find tons of functions doing this with google
|
|
|
|