|
7.25 GB (7,792,175,104 bytes) is what windows says. -797759488 bytes is what findfile .GetLength() says what do i need to do to make it show as 7.25 gb?
|
|
|
|
|
|
no matter what i try i cant get it to work right files under 2 gb is right but anything bigger is wrong
|
|
|
|
|
Hi,
another option is to divide by 1024 as long as you don't have the format you want.
7,792,175,104 / 1024.0 = 7609546
7609546 / 1024.0 = 7431,197265625
7431,197265625 / 1024.0 = 7,2570285797119140625
and make a Round () or a Trunc ()
Ehmm, I suppose you have a type missing in your post of findfile.GetLength ()
797,759,488 --> 7977594880 / 1024.0 = 7790620
7790620 / 1024.0 = 7608,02734375
7608,02734375 / 1024.0 = 7,429714202880859375
Don't ask me about why the results are different :P
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
anything under 2 gb is right but if the file is bigger than that its wrong it shows a 12 gig file as 2.something gb
|
|
|
|
|
Mmmm, it maybe is because of the large... dunno
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
I have a program working fine when active configuration is set to debug-I build it, then execute.
When I change the configuration to release, it compiles OK, but when I execute it the background of the dialog turns black, and buttons that displayed integers display nothing.
The buttons are set with
GetDlgItem(IDC_BUTTON14)->SetWindowText(newText)
Ideas? Thanks.
|
|
|
|
|
Compare your debug vs. release settings for both the compiler and linker.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I'm not experienced enough to totally understand what you mean, but I gave it a try.
I looked at PROJECT SETTINGS, and toggled between "Settings for Debug" and Settings for Release."
Under tab LINK, GENERATE DEBUG and LINK INCREMENTALLY are checked.
Under tab RELEASE, neither is checked.
I didn't know where to look to check the settings for COMPILER.
I did manage to solve the background color problem by setting the background in InitDalog, but the disappearing integers in the button text still have me stumped.
thanks.
|
|
|
|
|
Do you check that the variables have been initialized properly. A variable may have a different value in the release and in the debug build, causing the differing behaviour. And if you go back and see where the value of that variable is set, you will most probably find out that it isn't: You simply forgot to initialize that variable. The reason why the debug build seemed to work is that the debug version of the runtime library initializes dynamic memory and stack variables to known values (in order to track down memory allocation and overwrite errors), while the release version of the runtime library doesn't.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hello
_AnShUmAn_ wrote: A variable may have a different value in the release and in the debug build, causing the differing behaviour
Well , to add to it I say you most probably have a code optimization problem in the section of code which looks suspecious to you . You may find the values of variables in release by classical AfxMessageBox(value) displays . I have come across a situation where in release mode a string = "systarg" was represented in stack as "g|a|sys|t" which resulted in change of code flow . I did the following to solve it
Try this
add the following pramas around the section of code which looks problamatic
#ifndef _DEBUG
#pragma optimize("", off)
#endif
..... your code which works fine in debug
#ifndef _DEBUG
#pragma optimize("", on) // désactivation de toutes les optimisations
#endif
redindian
|
|
|
|
|
Ok, first of all hello folks, I'm new here and I'm in a new challenge now that I hope someone will be able to help me.
I'm working on making a Keyboard Device Driver, but I'm completely new at this issue, but not so new about C language.
My goal is to make a device driver to automate an application. In this application I have to press 2 on the keyboard every, lets say, 3 seconds.
Why do a device driver for it? Because SendKeys stuff did not worked, and I liked the challenge.
But it's becoming more then a challenge since I could not find information about Keyboard Device Drivers, the best info so far came from Toby Opferman's Driver Development Part 1: Introduction to Drivers (http://www.codeproject.com/system/driverdev.asp).
So, does anyone have a link, or some piece of code that may help me?
Any info will be appreciated.
|
|
|
|
|
Hi there,
I am a very beginner so please be pacient .
I've tried to add an own Property to the Property Page of my ActiveX Control in VC++ 6.0. But I've got a Problem there with serializing it.
I added the Bold line in my Control's Ctrl Class.
void CButtonCtrl::DoPropExchange(CPropExchange* pPX)<br />
{<br />
ExchangeVersion(pPX, MAKELONG(_wVerMinor, _wVerMajor));<br />
COleControl::DoPropExchange(pPX);<br />
<br />
<br />
<br />
PX_Long( pPX, _T("DBID"), m_CTRL_DBID ); <br />
<br />
}
And the Class Wizard added the following bold lines in the PropPage Class:
void CButtonPropPage::DoDataExchange(CDataExchange* pDX)<br />
{<br />
DDP_Text(pDX, IDC_CAPTION_EDIT, m_PPG_Caption, _T("Caption") );<br />
DDX_Text(pDX, IDC_CAPTION_EDIT, m_PPG_Caption);<br />
DDP_Text(pDX, IDC_DBID_EDIT, m_PPG_DBID, _T("DBID") );<br />
DDX_Text(pDX, IDC_DBID_EDIT, m_PPG_DBID); <br />
<br />
DDP_PostProcessing(pDX);<br />
}
But every time I open the Property Page in the Test Container for ActiveX Controls, change the value of my Property, click on "Apply" and "OK" and open the Properties Page again, the Value I put in isn't there anymore.
Can you tell me, what I've done wrong or what I maybe forgot?
Do I have to do something in the Get/Set Methods?
Greetings TheInfernalCrow
-- modified at 19:08 Tuesday 15th May, 2007
|
|
|
|
|
I'm having difficulty playing .wav files in Vista. I'm currently using PlaySound(), which works in XP, but Vista does not. I've seen at least one other person with this problem elsewhere, but I can't seem to find a solution. I'm running VS C++ 2005. Thanks.
-- modified at 2:20 Wednesday 16th May, 2007
Perhaps a little clarification. When executing the PlaySound() function in XP (as part of a larger program) the sound gets played correctly. However, when this program is run in Vista, the sound does not get played.
|
|
|
|
|
I just used Vista to test an app that has an about box with sound effect via PlaySound() . It worked fine. Have you tried to play the wav file in WMP on Vista? Do you hear any sounds at all?
|
|
|
|
|
I've tried playing the sound in WMP and it worked properly. I'm getting the path from the registry and the path seems correct. PlaySound() actually returns 0 (error) when I try to don't pass in SND_ASYNC, but returns 1 (the sound was put into the sound queue) when SND_ASYNC is passed in. In each case, the sound does not play properly.
|
|
|
|
|
I am interested in blocking Joystick devices in some game client software I am extending. The software doesn't have any use for joysticks, so disabling them entirely would be even better.
To be specific, I want to block dangerous "joysticks" like Nostromo[^] and Logitech G15[^] which can do macros, simple programs, etc. These are really deadly since players can use them to cheat and create home-made bots.
Belkin's FAQ page says that Nostromo installs as a standard Joystick device if you don't install their software. Anyone know how I can block these devices in my game client only? Perhaps there is a way to "block" joystick input and allow normal keyboard input. If that's not possible, can I disable them system-wide while the game is running?
Thanks for any answers.
|
|
|
|
|
Hello in one of my projects i want to make a Select Folder Dialog
(i only know about CFileDialog :/ )
and while you have select the folder it gonna get you
the full path of each file this folder contains.(so i can next edit this files)
msdn has problems on C++ library so i cant find it from there :/
anyone could tell me a code that i have to put in (OnSelectFolderButton fuction) it will appear a Folder selection Dialog and when you select a Folder it will add in an array the fullNamePaths of each File this Folder contains ?
thanks John
|
|
|
|
|
|
|
i find how to create a folder dialog.
Now as I am able to take the path
how i get the pathNames of all the files that contains this folder?
|
|
|
|
|
Search MSDN for the FindFirstFile() and FindNextFile() functions.
|
|
|
|
|
thank \o/
|
|
|
|
|
I've created a menu and want to launch other projects from the menu project.
Assume I want to launch MyApp.exe from the menu project.
I'm having trouble figuring out the code statement to accomplish this.
Can you help me out with the code?
Thanking you in advance for your help and time.
|
|
|
|
|
Check out ShellExecute() and CreateProcess() .
Anything I will say you will bring it down to whatever you want.
|
|
|
|