|
mrby123 wrote: I mean in the heap?
mrby123 wrote: double data[10000];
Memory for data has not been allocated on the heap. The only way to free it up is to close the application.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: The only way to free it up is to close the application.
Depends.
If array data is global then yes.
|
|
|
|
|
mkuhac wrote: If array data is global...
As opposed to what?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Hi, I use this way to capture the screen:
CRect lpRect;
CImage image;
CString strPath;
char chPath[256];
CWnd *pWnd;
int nBB;
//Get the window desktop
pWnd=GetDesktopWindow();
//Create a CWindowDC to hold the desktop info
CWindowDC winDC(pWnd);
//Get the size of desktop
pWnd->GetWindowRect(lpRect);
//Retrieve number of bits per inch
nBB=winDC.GetDeviceCaps(BITSPIXEL)*winDC.GetDeviceCaps(PLANES);
if (nBB<24)
nBB=24;
////////////////////////End///////////////////////////////////
Is there any way to send picture bits or make an array of pixels (A fast way)?
and I have know that there is another way to capture the screen using GDI+,
Can you possibly tell me how to do this?(Is it faster of above code?)
Thanks.
Every new thing you learn,Gives you a new personality.
|
|
|
|
|
CImage::GetBits is just what you need.
<font=sans-serif>|-|3llo Wo|2ld
|
|
|
|
|
hi all
let us say I have MFC application (dialog based) and have a string which contains some file path
strPath = "c:\\hello_guys.txt"
what is a handy way to retrieve size of this file, programatically ?
thank you.
|
|
|
|
|
GetLength()[^]
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
Hockey, i'm truly sorry... i intended to give you a '5', but my mouse moved wrongly
|
|
|
|
|
How about GetFileSize() ?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
hi David
as I see GetFileSize() needs HANDLE to a file as a parameter , that means as i know I need to open the file for reading at least.
I need to retrieve sizes of files in loop. I did it by opening them and calling GetLength method, but it seemd ugly
<br />
for(...)<br />
{<br />
CFile file<br />
file.Open(path,CFile::modeRead)<br />
Length[i] = file.GetLength()<br />
file.Close()<br />
}<br />
Is not there any API like this for example?
ULONGLONG GetFileSize(LPCTSTR sPath);
or any more convenient way?
thank you
|
|
|
|
|
big_denny_200 wrote: I did it by opening them and calling GetLength method, but it seemd ugly
But does it work, and is it easy to understand both now and in the future?
big_denny_200 wrote:
Is not there any API like this for example?
There's also _stat() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Call ::FindFirstFile() will the path. Do remember to close the handle and all that if it succeeds.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hello.
I'm trying to make a pointer to a method of instance of some class, like this:
<br />
<br />
class Foo<br />
{<br />
public:<br />
void DoSomething(int a)<br />
{<br />
......<br />
}<br />
};<br />
<br />
int main()<br />
{<br />
typedef void MethodCallback(int a);<br />
<br />
Foo *x = new Foo;<br />
MethodCallback *MC = (MethodCallback *)x->DoSomething;
}<br />
<br />
Works only if I change to static method.....
Any idia how to do this correctly ?
Thanks,
David
|
|
|
|
|
Virtek wrote: // Throws an error!
which error
|
|
|
|
|
I believe you can't use what you have shown because of the objects 'this' pointer, thats why it works when you make it a static method.
Check these out:
Pointers to methods[^]
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
|
Thanks people.
I needed to pass a function pointer to an API function, and because i did a class-wrapping, i needed to pass the class member-function, but it's not possible (thanks for clearing my eyes about the "this" pointer issue...)
|
|
|
|
|
Edit2 Sounds like nmake doesn't ship with just the compiler and linker tools - sounds like I have to download the SDK as well???
Edit I should note that vcvars32.bat has been run...
I've downloaded the free Visual C++ toolkit from MS web site: http://msdn.microsoft.com/visualc/vctoolkit2003/[^]
I have an application which uses NMAKE.EXE but it doesn't seem to exists with just the toolkit???
Do I have to download and install the Visual C++ IDE Express version???
Thanks
It's frustrating being a genius and living the life of a moron!!!
-- modified at 12:08 Thursday 13th April, 2006
|
|
|
|
|
I try to run my application on one XP PC without visual studio 2005 installed, but failed, the error is like "cannot initialize properly" or "the application is not installed correctly".
So I try to run an application that is built from MFC wizards, without any change of the codes, the same problem happens to me, even i intall the framework 2.0.
One way to make it work is to compile it in MT mode, the other is install vs2005 on that PC, but I don't think these are the final solution, could anyone help me?
-- modified at 10:04 Thursday 13th April, 2006
The application is developed by vs2005 in windows 2000
|
|
|
|
|
the error might tell you that a DLL is missing.
provide these dll with your exe.
|
|
|
|
|
hi, thanks for your help.
I have tried copy all the dlls that i see from the dll dependency, but it can't work, as i know, in vs2002/vs2003, we only need to copy mfc70.dll and msvcr70.dll (maybe this name), but it looks not the same to vs2005. I even install the framework 2.0 actually.
|
|
|
|
|
|
Not only. With VS2005, they included a mechanism with manifest files. I cannot explain how it works but the only thing I can say is that it is much more complicated to deploy your applications.
|
|
|
|
|
WTF did they do that for ?!
|
|
|
|
|
It is kind of complicated. In fact it is done (if I'm not wrong) to avoid dll hell problems (problems with versioning of dll's). I don't know exactly who it works but this mechanism was already available for 2003 but it was optional. Now it is no more otherwise nobody would use it.
|
|
|
|