|
Hi, I'm looking for a way to do a completely owner-drawn Listbox in C++ with just the Windows API and without MFC. The LBS_OWNERDRAWFIXED allows me to draw the items in the list, but is there a way for me to owner-draw the entire listbox (along with the scroll bars, etc)? Or do I have to subclass the listbox and draw it when it receives WM_PAINT?
Thanks!
KR
|
|
|
|
|
Well owner draw does what it does. You can't make it do something it doesn't do. Does that answer your question?
led mike
|
|
|
|
|
I was hoping there was a listbox ownerdraw style that would have the same behavior as BS_OWNERDRAW does for buttons. I guess you're saying there isn't one?
KR
|
|
|
|
|
KellyR wrote: I guess you're saying there isn't one?
Yes. As far as I know there is only one owner draw mechanism for each control that supports owner draw.
led mike
|
|
|
|
|
|
|
Hi.
I have created a simple database table using class / structure in C++. For ex.
<pre>
class StudentTable{
int m_nRollNo;
CString m_strFirstName;
unsigned int m_uAge;
unsigned short m_uPercentageOfMarks;
};
</pre>
The records are stored in stl vector.
Now I want the execute query like expressions on the data for ex.
"m_uPercentageOfMarks >= 80 and m_strFirstName like 'A%'" - First name starting with A for matching is ok
How do I execute these query expressions with the stored data? Parsing the expression is ok but how to relate these fields + operator (and/or/not) and actually execute these expressions in one go..
Please suggest how this can be achieved.
Thanks in advance.
Thanks & Regards,
Nilesh Prakash Bhatkhalkar
|
|
|
|
|
NileshBhatkhalkar wrote: Please suggest how this can be achieved.
As far as I know nothing standard exists as one library that will do that for you, you would have to develop it yourself. That's why most people use databases or something else that meets their requirements.
led mike
|
|
|
|
|
Hi to all,
How to do Globalization/Localization in VC++?
Regards,
Aniket A. Salunkhe
modified on Tuesday, July 29, 2008 11:44 AM
|
|
|
|
|
what do you mean by "Globalization" ?
have variables global ?
make "global" libraries ?
|
|
|
|
|
me think he's talking about localization.
|
|
|
|
|
Maximilien wrote: localization.
yes
|
|
|
|
|
so what part of localization do you want to know about ?
making the application multilingual for instance ?
or much complex ones ?
modified on Tuesday, July 29, 2008 1:35 PM
|
|
|
|
|
toxcct wrote: making the application multilingual for instance
first i would like to know this.
toxcct wrote: or much complex ones ?
what does it include?
Thanks for the reply.
Best Regards,
Aniket A. Salunkhe
|
|
|
|
|
hi...
how to change the button color?
pls can any one guide me?
thanks...
regards
paulraj
|
|
|
|
|
See WM_CTLCOLOR. You would need to return a different color of the brush in case the control is the button
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
hi...
thanks for your reply....
can you pls tell me somethink briefly?
thanks...
regards,
paulraj
|
|
|
|
|
Hi..
Im New to VC++ language, but i have a requirement to transform xml file to Html using XSLT. I have basic knowledge on XML and XSLT.
Can anyone help to start with this project. I need to now how to use XSLT in VC++..?
thanks and regards
vinay
|
|
|
|
|
An option maybe MSXML [^].
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]
|
|
|
|
|
hi.
whats the difference between XML and MSXML; can i get any sample code to use XSLT in VC++ 6.0
|
|
|
|
|
vinaykskvs wrote: whats the difference between XML and MSXML
XML [^] is (I suppose you know) a language, while MSXML [^] is a library designed (by Microsoft , hence the name) to handle XML documents.
vinaykskvs wrote: can i get any sample code to use XSLT in VC++ 6.0
I gave you the link in my previous post.
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]
|
|
|
|
|
i got it, But im not able to find any inc and lib file in this path where do i get these files..
C:\Program Files\MSXML 6.0\inc & C:\Program Files\MSXML 6.0\lib.
plz let me know if there is any other way to do this.
thanks & regards
Vinay
|
|
|
|
|
You may use the compiler #import directive, you don't need header (.h ) files neither .lib ones. See, for instance [^].
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]
|
|
|
|
|
Sorry if this is in the wrong forum, but I didnt think it would fit in the others! I have been attempting to convert a small bit of C to VB from this site: http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html[^]
It determines if a given point is either inside, outside, or on the edge, of a polygon shape. I want to use this in a GPS mapping application I am working on, but its not working, I think I have some of the syntax slightly wrong.
The code to convert:
int pnpoly(int nvert, float *vertx, float *verty, float testx, float testy)
{
int i, j, c = 0;
for (i = 0, j = nvert-1; i < nvert; j = i++) {
if ( ((verty[i]>testy) != (verty[j]>testy)) &&
(testx < (vertx[j]-vertx[i]) * (testy-verty[i]) / (verty[j]-verty[i]) + vertx[i]) )
c = !c;
}
return c;
}
Here is what I have converted it to:
Function pnpoly(ByVal nvert As Int16, ByVal vertx() As Decimal, ByVal verty() As Decimal, ByVal testx As Decimal, ByVal testy As Decimal) As Int16
' RETURNS:
' -1 IF THE POINT IS OUTSIDE OF THE POLYGON,
' 0 IF THE POINT IS ON AN EDGE OR AT A VERTEX,
' 1 IF THE POINT IS INSIDE OF THE POLYGON
Dim i As Int16 = 0
Dim j As Int16 = 0
Dim c As Int16 = 0
i = 0
j = nvert - 1
Do
If Not ((verty(i) > testy) = (verty(j) > testy)) Then
If testx < (vertx(j) - vertx(i)) * (testy - verty(i)) / (verty(j) - verty(i)) + vertx(i) Then
c = Not c
End If
End If
j = i
i = i + 1
Loop Until Not i < nvert
pnpoly = c
End Function
I have converted it based on notes in the source article, specifically:
in the C language, when executing the code a&&b, if a is false, then b must not be evaluated. If your compiler doesn't do this, then it's not implementing C, and you will get a divide-by-zero
and
Explanation of "for (i = 0, j = nvert-1; i < nvert; j = i++):"
The intention is to execute the loop for each i from 0 to nvert-1. For each iteration, j is i-1. However that wraps, so if i=0 then j=nvert-1. Therefore the current edge runs between verts j and i, and the loop is done once per edge. In detail:
1.Start by setting i and j:
i = 0
j = nvert-1
2. If i<nvert is false then exit the loop.
3. Do the loop body.
4. Set j=i and then
add 1 to i and then
5. Go back to step 2.
Have I done something obviously wrong? It just dosent return the results I am expecting! Here are the values I am passing to the function:
Dim xcoor(7) As Decimal
Dim ycoor(7) As Decimal
xcoor(0) = 2
ycoor(0) = 2
xcoor(1) = 5
ycoor(1) = 1
xcoor(2) = 8
ycoor(2) = 2
xcoor(3) = 7
ycoor(3) = 4
xcoor(4) = 8
ycoor(4) = 6
xcoor(5) = 1
ycoor(5) = 7
x = pnpoly(6, xcoor, ycoor, 3, 3)
Which should be drawing up a fairly basic polygon, and the point 3,3 is inside the polygon. No matter what coordinates I pass in to test, the function never returns 1 (inside).
Help!
|
|
|
|
|