|
You could just copy the wine implimentation:
http://source.winehq.org/source/dlls/kernel32/time.c[^]
...cmk
The idea that I can be presented with a problem, set out to logically solve it with the tools at hand, and wind up with a program that could not be legally used because someone else followed the same logical steps some years ago and filed for a patent on it is horrifying.
- John Carmack
|
|
|
|
|
Hi all,
I am using VS 2008 for the first time.I was working with VC++6.0.
And i am trying to compile the project which was done with VC++6.0.
When i am building the project i am getting the error like this
CVTRES : fatal error CVT1100: duplicate resource. type:MANIFEST, name:1, language:0x0409
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
I have googled out and found that if Generate manifest option in Project+properties+Linker is set to off this linker error will not come.
But i am not able to run the exe which is generated.
Please help me.
Regards
Deepu.
|
|
|
|
|
you need a manifest in VS2008 by design!!!
Throw out the manifest of the rc File. You can include it in the manifest tool -> additional manifest.
Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
|
Have you done a Rebuild All with VS2008?
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
No.I am searching for how to remove the manifest information from rc file.
|
|
|
|
|
You can turn off the manifest generation step in the linker tool so long as you always distribute the application with the manifest contained in a separate file in the same directory as the executable.
As this page[^] says, Application manifests are copied into the same folder as the application executable file or included as a resource in the application's executable file..
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
Hi Stuart
Thanks for helping me.I didnt understand much about manifest files.
But when i deleted Manifest option in rc file it worked.
Regards
Deepu.
|
|
|
|
|
Hi,
Please suggest me any link for MFC samples in vs2003/vs 2005...
|
|
|
|
|
|
i didn"t find any samples in vs 2003/2005...
|
|
|
|
|
you will get the necessary sample codes in codeproject also.
and when you installed MSDN dint you get samples?
|
|
|
|
|
please suggest me any MFC samples in vs2003/2005 with explanation...
|
|
|
|
|
|
Why you didnt sue of examples on the MSDN?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
I would like to conditionally prevent the computer from going into sleep.
I know that I will receive the WM_POWERBROADCAST message with the value PBT_APMQUERYSUSPEND, which means "is it OK to suspend.
If I reply BROADCAST_QUERY_DENY, then it's not going to happen.
I would like to differentiate between 2 events.
1. The user puts the computer into sleep.
2. The computer enters sleep because of a configured timeout.
I "could" check if the computer is IDLE at this moment... that might do it.
Just wondering if there's a better answer?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
Peter Weyzen wrote: I "could" check if the computer is IDLE at this moment... that might do it.
Are you looking for GetLastInputInfo() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"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
|
|
|
|
|
Yes -- "idle" detection is not the issue
Is the overall plan good?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<a href="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</a>
|
|
|
|
|
I am trying to create a tool bar using the class CToolBar. Maybe, I should be using the class
CToolbarCtrl. However, I want to understand both so I can make an informed decision what is best for
my application. I wrote the following code:
BOOL status1 = toolBar.Create( this );<br />
BOOL status2 = toolBar.LoadToolBar( IDR_TOOLBAR );<br />
toolBar.SetButtonStyle( 0, TBBS_CHECKBOX );<br />
toolBar.SetButtonStyle( 1, TBBS_CHECKBOX );<br />
toolBar.SetButtonStyle( 2, TBBS_CHECKBOX );<br />
toolBar.SetButtonStyle( 3, TBBS_CHECKBOX );<br />
toolBar.SetButtonStyle( 4, TBBS_CHECKBOX );<br />
toolBar.SetButtonStyle( 5, TBBS_CHECKBOX );<br />
<br />
const UINT idArray[] = {<br />
IDM_LINES, IDM_RECTANGLES, IDM_ELLIPSES,<br />
IDM_ENLARGE, IDM_ORG, IDM_RESET<br />
};<br />
<br />
BOOL status3 = toolBar.SetButtons( idArray, 6 );<br />
toolBar.UpdateWindow();<br />
BOOL status4 = toolBar.ShowWindow( SW_SHOW );<br />
toolBar.Invalidate();<br />
this->Invalidate();
This code runs as part of the function that creates (OnCreate) the main window of the application.
The return values as stored in status1, status2, status3 and status4 are 1, 1, 1, and 4. However
no tool bar is being displayed. Please tell me what I am missing or how I should go about trying to debug this problem?
Thanks
Bob
|
|
|
|
|
Where is the variable toolBar declared? Just an off the cuff guess, did you declare toolBar locally in the OnCreate method? If so, it would get destroyed when OnCreate returns.
|
|
|
|
|
Thanks for the response. The tool bar is declared/defined in the class of the main window of the
application. Here is how it is defined:
CToolBar toolBar;
I am wondering if the OnPaint routine of the main window needs to do something special to get
the tool bar drawn.
Bob
|
|
|
|
|
You should not have to do anything special in the OnPaint.
Give this a try:
if(!toolBar.Create(
NULL,
this,
IDR_TOOLBAR,
WS_CHILD | WS_VISIBLE | CBRS_TOP | CBRS_FLYBY | CBRS_SIZE_DYNAMIC
| CBRS_TOOLTIPS
| CBRS_HIDE_INPLACE | CBRS_GRIPPER
) ||
!toolBar.LoadToolBar( IDR_TOOLBAR )
)
{
TRACE0("Failed to create toolbar\n");
return -1;
}
toolBar.SetButtonStyle( 0, TBBS_CHECKBOX );
toolBar.SetButtonStyle( 1, TBBS_CHECKBOX );
toolBar.SetButtonStyle( 2, TBBS_CHECKBOX );
toolBar.SetButtonStyle( 3, TBBS_CHECKBOX );
toolBar.SetButtonStyle( 4, TBBS_CHECKBOX );
toolBar.SetButtonStyle( 5, TBBS_CHECKBOX );
const UINT idArray[] = {
IDM_LINES, IDM_RECTANGLES, IDM_ELLIPSES,
IDM_ENLARGE, IDM_ORG, IDM_RESET
};
BOOL status3 = toolBar.SetButtons( idArray, 6 );
toolBar.UpdateWindow();
BOOL status4 = toolBar.ShowWindow( SW_SHOW );
toolBar.Invalidate();
this->Invalidate();
|
|
|
|
|
Thank you for the response. I tried your code and I found that it did not compile due
to the fact that it calls Create with four arguments and Create takes at more three. I
do not understand what the purpose of the first argument (NULL) is. Therefore, I took
the NULL argument to Create. I left the other three (this, IDR_TOOLBAR and the flags)
in. After doing so, the code compiled but when run, it did not produce a tool bar.
I am thinking that problem might be related to my resource file. Below is the relevant part
of my resource file:
IDR_TOOLBAR BITMAP "TOOLBAR.BMP"
IDR_TOOLBAR TOOLBAR 16, 15
BEGIN
BUTTON IDM_LINES
BUTTON IDM_RECTANGLES
BUTTON IDM_ELLIPSES
SEPARATOR
BUTTON IDM_SHOWTB
BUTTON IDM_EXIT
END
Observe that the name of the bit map and the name of the tool bar is the same. I believe
it is suppose to be that way, right?
Any other ideas?
Bob
modified on Monday, June 22, 2009 5:30 PM
|
|
|
|
|
I am attempting to create a template that has a constructor that takes an array of items of type T, declared as follows:
template <typename T>
class foo {
public:
foo(T* items) {
}
}; Unfortunately, this code will not compile if T is a reference type, because you cannot have pointers to references. Therefore, I would like to create a template specialization that only declares this method if the template parameter T is NOT a reference variable. If it is a reference variable, I want the same method signature but I would like it to be an array of non-reference types to the class. As an example, if I knew that the template parameter base type was 'int', I could create the following specializations:
template <int>
class foo {
public:
foo(int* items);
};
template <int&>
class foo {
public:
foo(int* items);
};
template <int*>
class foo {
public:
foo(int** items);
};
template <(int& )*>
class foo {
public:
foo(int** items);
}; However, I don't know what base type the template parameter is, so I would like to do the above specialization for any base type (for example, I used int, but I could have used string, unsigned, char, or any other class). Is there any way to do this? Thanks,
Sounds like somebody's got a case of the Mondays
-Jeff
|
|
|
|
|
Does this meet your needs? It compiles (and runs OK) with gcc 4.0.1, should compile with Visual C++ 7.1 and above, I believe. The Boost type traits[^] do the template specialisations for you, in the derivation of the constructor parameter type.
#include <boost/type_traits.hpp>
#include <iostream>
template <typename T>
class foo {
public:
foo(typename boost::add_pointer<typename boost::remove_reference<T>::type >::type items)
{
}
};
int main()
{
int aa;
foo<int> a(&aa);
foo<int&> b(&aa);
}
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|