|
|
Is it possible to ignore users?
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?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Nelek wrote: Is it possible to ignore users?
unfortunately, not that i know about.
|
|
|
|
|
This[^] is not the exact answer, but will help in your logic.
Regards,
The only programmers that are better that C programmers are those who code in 1's and 0's
Programm3r
My Blog: ^_^
|
|
|
|
|
I'm still not sure with the example that was given..please explain to me
|
|
|
|
|
Why?
You are not reading what we tell you. And no one is going to make your homework. If you don't ask concrete things, you are not going to have answers (at least from me) anymore
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?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
i have a tip for you.
go back to school, and listen at the teacher when it explains
|
|
|
|
|
I have the following code:
RECT rect;
HWND h=GetDlgItem(IDC_PIC);
HDC tDC = ::GetDC(h); //Get the DC for the Picture Box
::GetClientRect(h,&rect);//Get dimensions of it
Here IDC_PIC is the id of the Picture Box control.
First Line of the code returning a valid pointer.
but ::GetDC(h) is initializing tdc with NULL value b'coz of which i am not able to do what i want.
One thing also rect is also giving garbage values.
I am using MFC.
Can any one tell me why?
Dhiraj
|
|
|
|
|
What do you want to do, exactly?
|
|
|
|
|
Dhiraj kumar Saini wrote: I am using MFC
Could have fooled me - I only see one call to an MFC class method,
and it shouldn't even compile.
What if you do this:
CWnd *pPictureCtlWnd = GetDlgItem(IDC_PIC);
if (pPictureCtlWnd)
{
CClientDC PictureCtlDC(pPictureCtlWnd);
CRect rect;
pPictureCtlWnd->GetClientRect(&rect);
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Dhiraj kumar Saini wrote: HWND h=GetDlgItem(IDC_PIC);
Are you using MFC or SDK.
In if it's MFC, then it should be like -
CWnd *pWnd = GetDlgItem (IDC_PICT);
CDC *pDC = pWnd->GetDC ();
pDC->TextOut (1,1,"hi",2);
else
If it's SDK, then the GetDlgItem also need the handle to parent.
HWND h=GetDlgItem(Handle to the dialog box that contains the control,IDC_PIC);
|
|
|
|
|
Is it possible to change scrollbars appearance on CListCtrl with OnCustomdrawList ( NMHDR* pNMHDR, LRESULT* pResult ) ?
Code sample?
Thanks in advance!
|
|
|
|
|
Search articles in the website. There is one CXListCtrl (I'm not sure about the name, but you can search with custom list control or surf through the menu to reach the section related). That ListCtrl has a lot of extra functionality... take a look, if it doesn't have what you need, it can give you a lot of ideas.
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?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Hi All,
Please explain me why CArray::GetSize() returns an INT_PTR.
When I see the documentation regarding the function, it says returns the number of elements in the array.
Number of elements are int/long. I could not understand why is this INT_PTR.
In VS2k3, the compiler throws a warning. In VC6.0 there is no warning.
Regards,
Pratap
|
|
|
|
|
Raj Prathap wrote: Number of elements are int/long.
What do you mean by that? As far as I can see, all functions that deal with the number of elements or indices are INT_PTR. The reason for that is 64-bit compatibility.
|
|
|
|
|
int is defined to be 32bit (not in the standard, but by common use)
CArray can theoretically hold more than 4Gig Items, at least in 64 bit Windows. That would need a 64 bit integer.
Here the INT_PTR kicks in: It defines a signed (there's also UINT_PTR) integer datatype that has at least the size to hold a pointer in the specific architecture.
So, in 64 bit Windows, it would be a 64 bit integer.
Raj Prathap wrote: Number of elements are int/long.
Actually, I would expect the count of elements in a collection to be a unsigned value. I can't imagine a use for a negative count.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: Actually, I would expect the count of elements in a collection to be a unsigned value. I can't imagine a use for a negative count.
Error return, at least in a poorly designed implementation... For example, you call a function called PopulateCollection(...) , passing in the collection object and it returns an int value:
n > 0 -- collection now contains n elements
n == 0 -- collection now contains no elements
n < 0 -- error manipulating collection Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Very poor implementation. It would be mixing two concepts into one return value.
When manipulations are incorect, these manipulation-functions have to report faliure. In your example, the number of elements returned is only an additional gimmick, not the purpose of the function.
Asking for the number of elements can only return a number. There is no possible error case.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
As I said, a poor implementaiton1
jhwurmbach wrote: Asking for the number of elements can only return a number. There is no possible error case.
That actually depends on how the collection is being accessed. For example, suppose you have an object that warps a simple array. The object could be in a state where it is not yet associated with, or has been detached from, an array. Asking the object for the number of elements should return... What?
Returning zero means that the collection has a size of zero, not that there is no collection. Again, a poor implementation, but just because you cannot think of a good reason for doing something does not mean that others cannot think of many bad reasons for doing it!
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
James R. Twine wrote: The object could be in a state where it is not yet associated with, or has been detached from, an array. Asking the object for the number of elements should return... What?
0. No elements would be retrievable.
James R. Twine wrote: Returning zero means that the collection has a size of zero, not that there is no collection.
Why sould the "GetSize"-function answer a question other than that "How many elements are in the collection?". There are no elements to be retrieved, so the answer is null.
If your collection happens to have a state of being "invalid", there sould be another function to test that.
Note that I would have the actual access-routines return a proper error code.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: 0. No elements would be retrievable.
Why sould the "GetSize"-function answer a question other than that "How many elements are in the collection?". There are no elements to be retrieved, so the answer is [zero].
The number of elements that are in a collection is not the same as the number of elements that are retrievable/available. GetSize() vs. GetAvailable(). The lot at the Aston Martin dealership contain 87 cars, but zero of them are available to me!
This is becoming a pointless argument - you will recall in my OP that I mention the words "poor design". And I have seen lots of poor designs and heard many ways of defending/rationalizing them.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
INT_PTR is NOT a pointer, it is an integer !
the _PTR at the end just means that this type is as large as a pointer type (32 bits on a 32 bits machine, 64 on a x64...)
|
|
|
|
|
how to read data from hard disk using int86() function??i have used the 0x13 interrupt and then passed
0x42 to a.h.ah.but m not too sure of wat m reading
prashant jain malviya national institute of technology
|
|
|
|
|
You probably should put your copy of Peter Nortons "Inside the IBM PC" (dated 1983) back into the shelf. MS-DOS 2.11 has recently been superseeded.
No kidding: You *are* using plain DOS here? Windows ( later than WinME even in the dos box) will not allow you to access the hardware direcly.
Though I speak with the tongues of men and of angels, and have not money, I am become as a sounding brass, or a tinkling cymbal. George Orwell, "Keep the Aspidistra Flying", Opening words
|
|
|
|
|
jhwurmbach wrote: Peter Nortons "Inside the IBM PC" (dated 1983)
The book that started it all for me. There's a blast from the past
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|