|
eat dll pickles.
Watched code never compiles.
|
|
|
|
|
sahilamrutkar wrote: add dailog box in dll
Sorry, we're out of dailogs. Would you like fruitcake instead?
|
|
|
|
|
Hi All,
How to sort the items inserted in the tree ctrl?
I have added items in the tree control now i want to sort the items
in alphabetical order.
How to do this?
|
|
|
|
|
use the sorting callback function of the CTreeCtrl ( CTreeCtrl::SortChildrenCB )
for example :
static int CALLBACK MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM )
{
return 0;
}
TVSORTCB tvs;
tvs.lpfnCompare = MyCompareProc; tvs.hParent = TVI_ROOT;
SortChildrenCB(&tvs);
Watched code never compiles.
|
|
|
|
|
|
I have located fast libraries for unions of 2 polygons.Now, how does one merge a group of simple polygons.
|
|
|
|
|
Two by two?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
oh dear,
what i meant was I want a program which takes a group of
input simple polygons and merges them with the 2nd group
of simple polygons.
I have located 2 libraries (both use vatti's) algorithm
for clipping.
My polygons are without hoes,not self intersecting and only graze at edges(if at all).
I want to merge them to get the outer contour of the final merged polygon.
I presume that would be easier to do then the clip in the 2 heavy libraries.
|
|
|
|
|
YOu said you located 2 libraries that can "merge" 2 polygons, as i understood, i thought your problem was how you would merge more then two polygons. So actually what you want has nothing to do with the libraries because you don't want to use them but instead you want to do the task without the help of these, right? Well, if you are doing this under windows you could try creating regions from your polygons and merge them (windows can do this for you), how you get the points back from the resultiong region i don't know yet.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
yes, i want to merge the regions and just get the outer contour.
As simple as that and I have to use clipper?.(it is in borland delphi/c++)
|
|
|
|
|
I doubt Clipper is the only language you could implement this in.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
no it is in delphi/c++ and gpc is in c++.I dont a demo program to use
the libraries under vs2010..that is the problem.both use a algorithm
called vattis algorithm in computational Geometry.
in vs2010 /c++(unmanaged) i dont know how to do graphics .
|
|
|
|
|
So let me get this straight:
1. one of the libraries you could use is written in C++
2. the second one you could use is written in pure, standard C++
3. you have sources, so not lib files
4. you want to work in VC++ with VS2010, use one of these libraries in it and display graphical representations of your polygons but you don't know how to:
-use any of the libraries in VC++
-do graphics in VC++
If i am correct then i believe you should first learn some basic VC++/Windows programming before getting to the actual implementation of this polygon thing. If one of your libraries is written in standard C++, you probably whould be able to build it with VC++ too.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> "It doesn't work, fix it" does not qualify as a bug report. <
> Amazing what new features none of the programmers working on the project ever heard of you can learn about when reading what the marketing guys wrote about it. <
|
|
|
|
|
yes,you got it right.I also know how to do some vc++(the old c++ not the new
one with lambda,..).I know vb.net ok and also c++.
I have asked a friend to help me in command line and probably when i show him my face next we will have a c++ program which
readpolygons,readpoygons,
perform union,
write result polygons
no graphics....so sad...
ps:i have got 1 more library, in c of the previous decades.
|
|
|
|
|
Hi All
I am facing very fracturing problem.My application some control move from original position and some control hide.i use Static,Edit Box,List Box,List Control,Picture control and Spin Control.
I use OnEraseBkgnd and OnCtlColor function for background color and control color.Code is here
HBRUSH CTestDlg::OnCtlColor(CDC* pDC, CWnd* pWnd, UINT nCtlColor)
{
HBRUSH hbr = CDialog::OnCtlColor(pDC, pWnd, nCtlColor);
if((pWnd->GetDlgCtrlID() == IDC_CHECK_REAL) || (pWnd->GetDlgCtrlID() == IDC_STATIC_REAL))
{
hbr = CreateSolidBrush(RGB(250, 252 , 254));
pDC->SetBkColor(RGB(250,252,254));
pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkMode(OPAQUE);
}
if((pWnd->GetDlgCtrlID() == IDC_EDIT_MAXPATH))
{
hbr = CreateSolidBrush(RGB(255, 255 ,255));
pDC->SetBkColor(RGB(255, 255 , 255));
pDC->SetTextColor(RGB(0,0,0));
pDC->SetBkMode(OPAQUE);
}
}
BOOL CtESTDlg::OnEraseBkgnd(CDC* pDC)
{
CRect rect;
GetClientRect(&rect);
pDC->FillSolidRect(rect,RGB(250,252,254));
return TRUE;
}
|
|
|
|
|
Hi sir.
When i type any character in the CombBox.I am sorting and displaying the results in dropdown.
But the first string which comes in DropDown is being set in ComboBox.
For Ex: If i have some strings in CComboBox : 1)"Pas",2)"Pad"
When i type P in Combo the same "P" character must be set to the ComboBox not "Pas".
Any idea will be thankful
Thanks
Raj
|
|
|
|
|
you can not directly enter values in comboBox.
You can use like this
CComboBox* test;
for (int i=0;i< test->GetCount();i++)
{
test->SetItemData(i, i);
}
|
|
|
|
|
Hello All,
General Idea:- I am developing application win32 cleint server type (It is like desktop monitoring ).
On server side I am takeing screen shot. & sending it to client side.
On server side I have function code like
--------------------------------------------
|
|
|
<pre><pre>hdc1 = GetDC(NULL);
hdc2 = CreateCompatibleDC(hdc1);
GetWindowRect(GetDesktopWindow(), &rc);
w = rc.right-rc.left;
h = rc.bottom-rc.top;
bmih.biSize = sizeof(BITMAPINFOHEADER);
bmih.biWidth = w;
bmih.biHeight = h;
bmih.biPlanes = 1;
bmih.biBitCount = 24;
bmih.biCompression = BI_RGB;
bmih.biSizeImage = ((((bmih.biWidth * bmih.biBitCount) + 31) & ~31) >> 3) * bmih.biHeight;
bi.bmiHeader = bmih;
aBmp = CreateDIBSection(hdc1, &bi ,DIB_RGB_COLORS, (void**)&dibvalues, NULL, NULL);
OldObj = SelectObject(hdc2, aBmp);
BitBlt(hdc2, 0, 0, w, h, hdc1, 0, 0, SRCCOPY);</pre>
//////////////////////////////////////////////////////////////</pre>
I have class like
<pre>class DesktopScreen{
public:
BITMAPINFOHEADER bmih ;
BITMAPINFO bi; unsigned char dibvalues[lenght]; };</pre>------------------------------------------------------------------
using above code I am filling Object of this class & sending it to other side
in binary formate (byte).
On Client side deserializing is also OK (I check all value at time of debuging )
<pre>Now at time WM_Paint:
hDC = BeginPaint(hWnd, &Ps);
i= StretchDIBits(hDC, // destination rectangle 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), // source rectangle 0, 0,desktopObj.bmih.biWidth , desktopObj.bmih.biHeight, desktopObj.dibvalues, &desktopObj.bi, DIB_RGB_COLORS, SRCCOPY);
//////////////////////////////////////////////////////////////////////////</pre>
StretchDIBits is returning 0 .
Application run properlly but image is not displying.
also if i call StretchDIBits on server side passing same info to that function.I mages is displaying.
Can you please tell me what should be the problem.
( sorry for posting code ,but I think it is necessary to get my Question to you )
Thanks ,
Ashish.
|
|
|
|
|
Hi I want to create ownerdraw combobox. But whenever I m calling the create function its giving assertion error. Can anybody tell me why its happeing.
here is code :
void CTxComboBoxCtrl::CreateCustomComboBox(CRect rect, CWnd* pWnd, UINT nID)
{
this->Create(WS_CHILD|WS_VISIBLE|WS_BORDER|WS_HSCROLL|WS_VSCROLL|CBS_HASSTRINGS |CBS_DROPDOWNLIST |CBS_OWNERDRAWVARIABLE ,rect,pWnd,nID);
}
CTxComboBoxCtrl id derived from CComboBox class
Thanks..
|
|
|
|
|
|
ys I m overriding the ownerdraw function. but its giving arrestion error on the beginging its self when I m calling create function from oninitdialog funuction of the dailog.
|
|
|
|
|
Please show us the ASSERT code.
|
|
|
|
|
In this line its giving assertion :
void CComboBox::MeasureItem(LPMEASUREITEMSTRUCT)
{ ASSERT(FALSE); }
|
|
|
|
|
This tells you exactly what's wrong - you haven't overidden MeasureItem in your derived class so MFC's telling you to go and do it rather than letting your code crash in a novel and interesting way later.
Cheers,
Ash
|
|
|
|
|
Since you've given CBS_OWNERDRAWVARIABLE as combo style, you need override MeasureItem.
|
|
|
|
|