|
Hi All
There is any API which will give folder size like _stat function .I am try to get size without open folder.Plz help me
|
|
|
|
|
I guess no such function.
When we use file-manager to detect size of a folder, if the folder is in huge size, we can see file-manager detects size of files one by one and add them togather.
So, you may do same thing programmatically to find total size of files under the folder.
|
|
|
|
|
there is no direct api for retrieving folder size, but you can do that programmatically by using CFileFind and CFile::GetStatus
"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
|
|
|
|
|
I want to do a topic on the management staff! Include add, delete employee, the employee by the employee by day with the number of each person, all information is entered in the file!
programming language C + + or C #? please help me! many thanks
|
|
|
|
|
hoale2008 wrote: topic on the management
you may want to pick up a book on how to manage your time reading and learning first.
Yusuf
Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
|
|
|
|
|
what do you need code or any software programmer that do it for you.. there are lot freelancer here who can do your work at £20/HR
"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
|
|
|
|
|
hoale2008 wrote: I want to do a topic on the management staff
About their post-office-time relations?
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
hi !! can some one help me too Write a program like patchwork that takes two characters c and d, and a positive integer n and displays the following object made of the characters c and d over n
lines and n columns, as shown below.
(in for loop if that posible)
Sample 1:
Enter two characters and an integer: $ * 3
$*$
*$*
$*$
Sample 2:
Enter two characters and an integer: / \ 6
/\/\/\
\/\/\/
/\/\/\
\/\/\/
/\/\/\
\/\/\/
|
|
|
|
|
have you tried something!
"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
|
|
|
|
|
hi !!i have tried something like this
#include <iostream>
using namespace std;
int main() {
int n;
char c1, c2;
cout << "Enter two characters and an integer: " << flush;
cin >> c1 >> c2 >> n;
for (int i = 2; i < n; i++)
{
cout >> c1 >> c2;
}
return 0;
}
and
#include <iostream>
using namespace std;
int main() {
int n;
char c1, c2;
cout << "Enter two characters and an integer: " << flush;
cin >> c1 >> c2 >> n;
for (int i = 2; i < n; i++)
{
cout << c1 << c2 << endl;
for (int j = 2; j <= n-1 ; j++)
cout << c2 << c1 ;
cout << endl;
}
return 0;
}
but it turn ot to be different to what i want and i dont know what to do next .
modified on Wednesday, March 25, 2009 6:56 AM
|
|
|
|
|
BOOL b
A. if(!b){ ... }
B. if(b == FALSE){ ... }
There is my senior who says that B is better though said by another senior that a is better, too.
Both could not exactly explain the resion.
Also, sample by MSDN like PtInRect's, is test by if(b). And I checked the assembly of A and B, they are the same.
Which is better in your opinion, A or B?
Is it really different only in oppearance?
|
|
|
|
|
Sorry I did not read through the end of your description earlier.
The if evaluates true /false .
Case A:
bool b;
if(!b) { }
Case B:
BOOL bb;
if(FALSE == bb) { }
That's what I prefer...
Maxwell Chen
|
|
|
|
|
fitatc wrote: Which is better in your opinion, A or B?
I think it's a matter of style. I like A.
|
|
|
|
|
As Max has pointed out, when it's a true/false case, it's recommended that you use bool and not BOOL . Worse is to use a BOOL and store integer values in it. Just like the MS people do.
Also to reply your OQ,
It's not a preference, you should always use
if(cond)
{
}
Rather than
if(cond==true)
{
}
Because with the later, there are chances you end up with the legendary "=" operator. like if(cond=true).
He never answers anyone who replies to him. I've taken to calling him a retard, which is not fair to retards everywhere.-Christian Graus
|
|
|
|
|
Always try to use the first form.
Checking for equality with FALSE is theoretically ok, but you can end up in trouble if you compare it with TRUE. FALSE is always zero, but any other value is 'true'.
BOOL b = 3;
if (b) {}
if (b == TRUE) {}
shows the problem. (The first if fires, but not the second one)
My advice is to use the first form, which is more elegant, and always safe.
Also think about how you name your variables, and it will be easier to read the code.
|
|
|
|
|
Hallo!
I have Problems using DrawDibDraw (from msvfw32.dll) with Compression set to BI_BITFIELDS.
When I set biCompression to BI_RGB, it works, but when I set biCompression to BI_BITFIELDS, DrawDibDraw returns false and draws nothing.
Does anyone have any Ideas?
Here is my code:
#include <windows.h>
#include <stdio.h>
#include <math.h>
#include <vfw.h>
#define WIDTH 5000
#define HEIGHT 3000
short bits[HEIGHT][WIDTH];
BITMAPINFOHEADER * bmih;
int iCnt;
HDRAWDIB hdd;
int w,h;
RECT r;
int CDECL Xpress(TCHAR * msg,...)
{
TCHAR buf[1024];
va_list args;
va_start (args,msg);
_vsnwprintf_s(buf,sizeof(buf)/sizeof(TCHAR),msg,args);
va_end(args);
return MessageBox(NULL,buf,NULL,NULL);
}
LRESULT CALLBACK WinProc(HWND hwnd,UINT msg,WPARAM wParam,LPARAM lParam)
{
switch (msg)
{
case WM_PAINT:
PAINTSTRUCT ps;
HDC hdc;
hdc = BeginPaint(hwnd,&ps);
DrawDibDraw(hdd,hdc,0,0,w,h,bmih,bits,0,abs(500-iCnt%1000),w,h,DDF_JUSTDRAWIT);
EndPaint(hwnd,&ps);
return 0;
case WM_SIZE:
GetClientRect(hwnd,&r);
w=r.right-r.left;
h=r.bottom-r.top;
break;
case WM_DESTROY:
PostQuitMessage(0);
return 0;
}
return DefWindowProc(hwnd,msg,wParam,lParam);
}
int WINAPI WinMain(HINSTANCE hInst,HINSTANCE hPrev,LPSTR lpCmd,int nShow)
{
int iRet=-1;
for (int i=0;i<HEIGHT;i++)
{
for (int j=0;j<WIDTH;j++)
{
bits[i][j]=((i&0x1f)<<10)|((j&0x1f)<<5);
}
}
WNDCLASS cls;
cls.lpszClassName=L"WINDCLS";
cls.lpfnWndProc=WinProc;
cls.cbClsExtra=0;
cls.cbWndExtra=0;
cls.hbrBackground=NULL;
cls.hCursor=LoadCursor(NULL,IDC_ARROW);
cls.hIcon=NULL;
cls.lpszMenuName=NULL;
cls.hInstance=hInst;
cls.style=0;
r.top=0;
r.left=0;
r.right=GetSystemMetrics(SM_CXSCREEN);
r.bottom=GetSystemMetrics(SM_CYSCREEN);
if (RegisterClass(&cls))
{
HWND desk = CreateWindowW(L"WINDCLS",L"Main",WS_SYSMENU,0,0,GetSystemMetrics(SM_CXSCREEN),GetSystemMetrics(SM_CYSCREEN),NULL,NULL,hInst,NULL);
ShowWindow(desk,nShow);
UpdateWindow(desk);
bmih=(BITMAPINFOHEADER*)malloc(sizeof(BITMAPINFOHEADER)+3*sizeof(DWORD));
bmih->biSize=sizeof(BITMAPINFOHEADER)+3*sizeof(int);
bmih->biWidth=WIDTH;
bmih->biHeight=HEIGHT;
bmih->biPlanes=1;
bmih->biBitCount=16;
bmih->biCompression=BI_RGB;
bmih->biSizeImage=WIDTH*HEIGHT*2;
bmih->biXPelsPerMeter=0;
bmih->biYPelsPerMeter=0;
bmih->biClrUsed=0;
bmih->biClrImportant=0;
DWORD * col = (DWORD *)&bmih[1];
col[0]=0xFC00;
col[1]=0x03E0;
col[2]=0x001F;
MSG msg;
hdd = DrawDibOpen();
if (hdd==NULL)
{
Xpress(L"Cant get DIB");
}
else
{
long start = GetCurrentTime();
for (iCnt=0;iCnt<10000&&GetMessage(&msg,NULL,0,0);iCnt++)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
bits[1500+iCnt/500][iCnt%500]=0x1f;
InvalidateRect(desk,&r,FALSE);
}
DrawDibClose(hdd);
Xpress(TEXT("%i fps"),1000*iCnt/(GetCurrentTime()-start));
iRet=(int)msg.wParam;
}
}
return iRet;
}
Many thanks...
Uwe
|
|
|
|
|
I am trying to access a c++ created DLL from within Excel, with semi-success only:
I've followed the following tutorial EXACTLY: http://newtonexcelbach.wordpress.com...ng-excel-to-c/
Now, when I try and use the dll-functions that I've declared in the VB code, the function GetPrice(), which takes no arguments and simply returns a number, works fine.
However, as soon as I create a dll-function which takes input arguments, I get a #VALUE error in the cell in Excel ("A value used in formula is of the wrong data type" ).
I've downloaded the complete sample from the URL above and get the same error when running it (after recalculating the formulas).
I've created a test 'proxy' function (in which the code can be stepped through, which calls the dll function) to ensure that values sent to the dll function are indeed of type double and that seems to be the case ...
This guy seems to have had the same problem, however no solution was posted:
http://www.ozgrid.com/forum/showthread.php?t=54245[^]
Any help / tips would be greatly appreciated!
g
excell dll newbie
|
|
|
|
|
I can tell you one thing as a tip ... DON'T CROSS POST IN FORUMS !!!!! Find the best forum, post the message ONCE !!!!
'g'
|
|
|
|
|
Sorry but I don't know which forum is best for this one ( ? )
|
|
|
|
|
this one c/c++/MFC ..
'g'
|
|
|
|
|
so, did you see the discussion following the article where people were talking about 'deployment' and the VS2008 redistributables, the location of the dll etc ?? - any differences ?
'g'
|
|
|
|
|
No I didn't see that ?
This is such a weird problem. Don't get why it would work for everyone else but not for me ...
|
|
|
|
|
gvanto wrote: Don't get why it would work for everyone else but not for me ...
ahh, but it didnt work for everyone - go back the page, read down past the initial steps - others did have issues and (may have) fixed them
'g'
|
|
|
|
|
Hmmm that was a bit schoolboy of me not to spot that error, thanks Garth!
I've actually just built the same functionality in a C# dll, works like a bomb!
Now I have a little design problem: I'd like the function I call in the dll to KEEP a cell dynamically updated (it fetches a security's price
from a local db).
Two options:
1) Loop within excel and keep calling the dll function (which queries the db and returns the result)
2) Loop within the dll and *somehow* keep the value of the cell WHICH CALLED IT, up to date. (this is how bloomberg's API functions to keep excel cells dynamically updated, very nifty !
I'm thinking that efficiency-wise, 2) would be better (something tells me that having 200 cells repetitively calling a function will cause Excel to hang ... is my hunch correct?)
Best,
G
|
|
|
|
|
PS: I dont have admin rights on this machine else I'd give the VS2008 redistro stuff a go, sure sounds like it could work ...
|
|
|
|
|