|
As far as I understand it they won't be inlined, just like regular constants. I have pretty much the same problem right now, except that I don't need to switch types. In this thread I posted my current idea for a workaround (using operator overloading and inline functions), maybe that could help you. It's a hack, but in theory it should work.
As for your templating idea, if you don't need both float and double versions at the same time, you could just use typedefs like so:
typedef double myFpType;
const myFpType pi;
...
const myFpType pi = myFpType( 3.14159265358979 );
...
or using my workaround idea from the link above:
typedef double myFpType;
INLINE_CONST( myFpType, pi, myFpType( 3.14159265358979 ) );
But maybe someone knows a better solution that could help us both out.
Hope that helps,
Peter
|
|
|
|
|
Hi
i am trying to build my code and in the process of building it, I get the error "Message too long" and the build stops.
However, if I clean the build and then re-build the code this problem does not occur. I had been able to pinpoint the files, which if removed the error will not appear.
I am using the VS 2005 compiler.
I am wondering why this error appears. Please advice.
think because thats what matters
|
|
|
|
|
vikramaditya234 wrote: However, if I clean the build and then re-build the code this problem does not occur.
So what's the problem then? Does the compiler error reappear?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
The same file is opened in 3 threads with FILE_FLAG_OVERLAPPED, then these 3 file handles associated to the same i/o completion port respectively.
In each thread, ReadFile was called in overlapped mode(the lpOverlapped parameter is not NULL).
It is strange that in WinXP, these ReadFile always return TRUE, means they complete synchronously, but in Vista, these ReadFile always return FALSE,and GetLastError returns ERROR_IO_PENDING.
Can I get these ReadFile asynchronously in XP?
Thanks
A Chinese VC++ programmer
|
|
|
|
|
Any Help will appreciate!
|
|
|
|
|
Visual Assist X is a great tool to help with refactoring. You can download a fully functional 30 day trial. For more info:
http://www.wholetomato.com/[^]
|
|
|
|
|
|
My problem for visual assit is that :
when I selected the variable or method name which are needed to change name,
va shows the triangle,while when I want to click the triangle, it disappears so fast.
|
|
|
|
|
At my workplace we have an old pentium machine running dos 6.2, and we have an iomega ATAPI IDE 100mb zip drive. My boss has requested that I install it for him, which I have, however Iomega no longer offer any dos drivers for the Atapi version. We do however have a parallel port driver from an old parallel port zip drive that carked it, however we cannot get the ATAPI drive to work using this driver.
I would like to attempt programming my own driver for it and have heard of the Windows DDK - Is there a DOS equivalent? If not, how would I go about creating this driver?
EDIT: Please move to Hardware / Device Drivers.
|
|
|
|
|
bump? Anyone got any ideas?
There's next to no documentation that I could find with google.
|
|
|
|
|
I've got plenty of experience with C/C++, and C# on the Windows platform. I'd love to get in to doing development on Windows Mobile as well. I know you can do C# with Windows Mobile, but I'd like to learn the C/C++ side of things first so I can get familiar with the API. Does anybody know of any good resources for getting started with C/C++ on the Windows Mobile platform? I have Visual Studio 2005 Professional.
Thanks.
Kyosa Jamie Nordmeyer - Taekwondo Yi (2nd) Dan
Portland, Oregon, USA
|
|
|
|
|
|
Hoping to rid my project of a "wait" thread with "difficult to debug" problems, I am trying to put a progress indcator in the dialog title. Any ideas?
|
|
|
|
|
You could maybe draw a progress bar in a WM_NCPAINT handler.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I want to install the file data.bmp in system32:
hFile = CreateFile((L"c:\\windows\\system32\\data.bmp"), GENERIC_READ|GENERIC_WRITE, FILE_SHARE_READ|FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, 0, NULL);
When I run this hFile is given a value, so I write to the file, and close it. Why doesn't it appear in system 32 ?
I have no trouble writing to other folders, but not to Windows, or even to C:.
The problem seems to be pecular to Vista, and certainly doesn't arise on XP.
Raymond Mercier
|
|
|
|
|
As with most Vista write problems, you are probably not running the process as an Administrator. You must do so to write to any system directories.
Hope this helps,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Thanks, that has cured it. Now I have to see how to run the program in debug mode within VisualStudio, but as administrator.
Raymond
|
|
|
|
|
I think that if you run VS as Administrator then any projects you run in debug mode under it will also run as Administrator.
Regards,
--Perspx
"The Blue Screen of Death, also known as The Blue Screen of Doom, the "Blue Screen of Fun", "Phatul Exception: The WRECKening" and "Windows Vista", is a multi award-winning game first developed in 1995 by Microsoft" - Uncyclopedia
|
|
|
|
|
Thanks again. It does as you say. Great game, this Vista !
Raymond
|
|
|
|
|
in vista ..
there is one compiled MFC source code in this code was developed XP,that code was not running in vista.
But in vista we have 2 generate the source code and developed it then only its possible to achieve ..
|
|
|
|
|
I've been using C# for the last few years but now I have to work with an embedded C++ compiler and am having problems with enum types, since they can't apparently be used in a different class.
<code>
class Message
{
public:
enum Index
{
Length,ID1,ID2,ID3,Type,From,To,SourceX,SourceY,Var,Routing,MaxIndex=255
};
....
....
....
}
...
...
...
bool Sensor::SendMessage(Message msg)
{
char message[Message.MaxIndex];
message[Message.ID1] = 'X';
...
...
}
</code>
This sort of thing works fine in C# but the C++ compiler gives an error when 'Message.MaxIndex' etc is used - it says 'type names cannot be used' (or similar depending on the compiler). Do I really have to make all my enum's global (e.g. 'Message_MaxIndex') or is there a better way?
|
|
|
|
|
Try Message::ID1. In C++ scope resolution operator is ::.
-Saurabh
|
|
|
|
|
Hi all i am new to the concepts of mfc,
in my application i want to create resitry entries i did that well but when i tried to insert value for the default key (default) in the registry the key is duplicated,and i am not able to set the value for the default one.
can anyone suggest me the correct approcah for doing this.
thanks in advance.
|
|
|
|
|
try this code, it working fine for me
CRegKey key;
if( key.Create(HKEY_CURRENT_USER,L"Software\\Alok") == ERROR_SUCCESS)
{
if(key.SetKeyValue(L"",L"Alok") == ERROR_SUCCESS)
{
AfxMessageBox("Successful in setting the Default value of key");
}
}
please include Atlbase.h in your code!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/xml>
|
|
|
|
|
hariakuthota wrote: ...when i tried to insert value for the default key (default) in the registry the key is duplicated,and i am not able to set the value for the default one.
And what does this have to do with MFC?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|