|
AFAIK that works well for local variables, but not for class level variables or methods.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
I still don't understand why people write unused code!!
Watched code never compiles.
|
|
|
|
|
Don't blame the programmers. Blame the users, they tend to avoid those pieces of an app that contain most of the bugs.
Luc Pattyn [Forum Guidelines] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
|
|
|
|
|
can't you compile with warning Level 4 in Project->Properties->C/C++->General->Warning Level -> Level 4 (/W4) ?
|
|
|
|
|
Thanks for the reply.
Yea, I have used warning level 4 to identify any unused local variables but I was thinking of something on a bigger scale i.e. something that would identify class members and methods which are not referenced in the project.
Of couse I could right click every method in the class view and show where it is called but that could drive a man insane!
Thanks again for the reply.
|
|
|
|
|
Check Doxygen. It has been very long since I used it, but it may help dig out something. I know there is something with unused function, but not sure for unused variables.
I could be way off the mark, it has been very long since I used it.
|
|
|
|
|
One biggest problem of the most article from here , is that is not tested on static and dynamic mode : here [^] I use this control , of type CCheckComboBox , on CFormView form .... but when I try to use it into an dialog bar , I broke down ... how can I do that ? How can I put into dialog bar the member variable type of CCheckComboBox ?
|
|
|
|
|
I'm pretty sure the article's author would consider precious your comments, just post them in the article's own thread.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
People are not only thankless but also so unforgiving of the mistakes committed even by a baby.
|
|
|
|
|
I'm sorry , I was bad ... my apologize .. I will comment that in the article's page .
I was need right now to use this control , but I will use something else ...
modified on Tuesday, January 11, 2011 8:54 AM
|
|
|
|
|
I know that all people that write articles here have do an good and altruistic thing ... bleedingfingers show me how small I am ... mea culpa !
|
|
|
|
|
Hello Friends
I saved a Image with some transparency state by using Colormatrix And ImageAttribues In GDIplus.And that image is saving with actual value of transparency.But when I load that image and add it to devicecontext then its transparency is not coming there(Means If i set transparency 0 then black image is coming And If I set 1 then also white is coming but If I set any other value Between 0 And 1 then that transparency level is not coming ,It is showing completely white for >0)
Any Ideas?
Thanks & Regards
Yogesh
|
|
|
|
|
In which format you saved image ? 32 bpp bitmap or PNG ? in that case it is fine.
which function you use to draw the image ? if you use DrawImage function in gdiplus with a 32bit bmp ,it will work for sure.
If u can Dream... U can do it
|
|
|
|
|
I save the image in 32bitFormat as Tiff and am using DrawImage to draw the Image.
Thanks
Yogesh
|
|
|
|
|
Hi all,
I am working on VS10 Porting project.
Here they are using _fstat(infile.rd(), &instat).
This function is used to obtain information of the opened file associated with the
File descriptor.The first parameter in this function is File descriptor.
But,File descriptor is not available in VS10.
So,How can we use this function without File descriptor?
Please help me to solve this issue.
Thanks.
|
|
|
|
|
|
Sorry, I found your earlier question in which you said it was an ifstream that you were using.
From what I can see there is no way of getting anything useful toward a file handle out of the ifstream, short of making a hack for it.
I would recommend using functions like CreateFile and GetFileSize using handles or just opening the file a second time with _open(name, _O_RDONLY, _SH_DENYNO) depending on what information you are wanting.
If you really really want to stick with ifstream, then this is a hack that will get the file descriptor out for the version I have. It may be different than your version due to hotfixes.
ifstream::_Myfb *pFileBuffer = infile.rdbuf();
char *pFileBufferMemory = (char *)(void *)pFileBuffer;
FILE **pFilePtrPtr = (FILE **)(pFileBufferMemory + sizeof(ifstream::_Myfb) - sizeof(FILE *));
FILE *pFilePtr = *pFilePtrPtr;
int nFileDescriptor = _fileno(pFilePtr);
int nFileDescriptor2 = _fileno(*(FILE **)(((char *)(void *)infile.rdbuf()) + sizeof(ifstream::_Myfb) - sizeof(FILE *)));
|
|
|
|
|
Hi all,
I am trying to get Logical drives of a hard disk(\\.\PhysicalDrive0).
I have tried using DeviceIoControl function for it but i am getting GetLastError() = 122 i.e. ERROR_INSUFFICIENT_BUFFER error.
My code is as follows:-
HANDLE hDevice;
hDevice = CreateFile("\\.\PhysicalDrive0"
0,
FILE_SHARE_READ |
FILE_SHARE_WRITE,
NULL,
OPEN_EXISTING,
0,
NULL);
PARTITION_INFORMATION_EX obj;
DWORD cb;
BOOL iu = DeviceIoControl(hDevice,
IOCTL_DISK_GET_PARTITION_INFO_EX,
NULL,
0,
&obj,
sizeof(obj),
&cb,
NULL
);
if(iu == 0)
{
DWORD err = GetLastError();
CString str;
str.Format("%d",err);
AfxMessageBox(str);
}
CloseHandle(hDevice);
I am not getting where exactly is the problem...
How can i do this..
Thanks in advance
|
|
|
|
|
Not sure if it is just the way u copied it to code project, but you need to escape each of the back slashes in the drive name like "\\\\.\\PhysicalDrive0"
also add a comma in after that string. Once I applied those changes your code worked for me.
|
|
|
|
|
I created a CWnd control with widow styles WS_CHILD|WS_VISIBLE (parent is a CWnd also), then set a new CFont to the control by SetFont(...) function.
But, when called
CFont*pFt=GetFont();
inside the CWnd control, return value of pFt is null.
Should I add more window styles?
How do you set a font to CWnd to ensure that GetFont() is valid?
BTW: I tested to create a CStatic, GetFont() is still null;
modified on Monday, January 10, 2011 11:39 PM
|
|
|
|
|
See comments here[^] about the return value from the WM_GETFONT message.
I must get a clever new signature for 2011.
|
|
|
|
|
Additionally, it will return 0 too when called on a control/window that doesn't exist (yet/anymore/at all).
modified 13-Sep-18 21:01pm.
|
|
|
|
|
At which point do you call GetFont? Does the window already/still exist at that point?
Calling it from within OnCreate() should be safe to ensure the font has been set.
modified 13-Sep-18 21:01pm.
|
|
|
|
|
Just call GetFont immediately after SetFont, so that we can test whether the problem is with invalid window handle. For a valid window handle it must work.
If u can Dream... U can do it
|
|
|
|
|
Hi there:
I am trying to get a clob data via store procedure in oracle db by using ADO . But I don't know how many bytes should I allocated for the buffer to hold the clob out value. Is there a convenient way to get the clob out value properly ?
I googled and found some guys say that ADO.Stream can be used on this problem but I failed to find how to use ADO.stream in
Thanks a lot.
----------
Don't look at me in that way!
|
|
|
|