|
bilas wrote:
pTreectrl->Create(WS_VISIBLE, rc.rcNormalPosition, pPar, 0x1005);
Yes, but you can bitwise OR these styles together to get a combination of properties. e.g.:
m_TreeCtrl.Create(WS_CHILD | WS_VISIBLE | |TVS_HASLINES | TVS_HASBUTTONS, dwStyle, CRect(0,0,1,1), this, IDC_TREE);
I Dream of Absolute Zero
|
|
|
|
|
Ok, I'll post a small code fragment to help you out. Here, we assume that the name of your dialog class is CMyDialog , and that the .cpp file you mentioned contains the implementation of the class.
BOOL OnInitDialog (void)
{
RECT rectParentCA;
this->GetClientRect(&rectParent);<DIV>
rectParentCA.top += 10;
rectParentCA.left += 10;
rectParentCA.right -= 10;
rectParentCA.bottom -= 10;<DIV>
pTreeCtrl->Create( WS_VISIBLE | WS_CHILD | WS_BORDER, rectParentCA, this, 0x1005);
} This will create a tree control, making it a child of the dialog window.
Remember, that although the tree control object/window is automatically destroyed by the framework, the object reserved with new is not. You MUST call delete at the destructor of your dialog.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Thanks a lot. It really works! Thank you, men.
|
|
|
|
|
Hello Guys
I need some help regarding VC++, during the Application runtime..how can the get the Application Path ..i.e the Folder path from where the App runs
Thanks in Advance
Hariharan.S.N
|
|
|
|
|
Get the application object with AfxGetApp . The CWinApp::m_pszExeName member contains the path and name of the executable without the .EXE extension.
After getting this string, just manipulate it to remove the application's name (Remove characters until last character before NULL is '\').
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Antti Keskinen wrote:
After getting this string, just manipulate it to remove the application's name (Remove characters until last character before NULL is '\').
Or use _splitpath() .
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
One solution is GetModuleFileName().
Kuphryn
|
|
|
|
|
|
Did anyone experience any problems using CListCtrl::SortItems?
I take this code from MSDN for the sorting callback function but it does not work.
static int CALLBACK <br />
MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)<br />
{<br />
CListCtrl* pListCtrl = (CListCtrl*) lParamSort;<br />
CString strItem1 = pListCtrl->GetItemText(lParam1, 0);<br />
CString strItem2 = pListCtrl->GetItemText(lParam2, 0);<br />
<br />
return strcmp(strItem2, strItem1);<br />
}
The result of this code when I apply to my list is that MyCompareProc is called exactly as many times as the item number but this is clearly not sufficient for a complet alphabetical order!!! Thus the order is wrong.
Please help me!!!
Regards,
Andrea
|
|
|
|
|
De Nardis Andrea wrote:
...MyCompareProc is called exactly as many times as the item number but this is clearly not sufficient for a complet alphabetical order
That depends on the sorting algorithm used. While some algorithms look at each item multiple times (e.g., bubble), others look at each item fewer times, or even just once. I suspect that the algorithm employed by SortItems() is based on Hoare's partition-exchange (i.e., quicksort) algorithm.
As you add items to the control, a call to SetItemData() should be made. For example, the item's data could be a pointer to a CMyObject class. Then the comparison routine will look like:
static int CALLBACK
MyCompareProc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort)
{
CMyObject *p1 = (CMyObject *) lParam1;
CMyObject *p2 = (CMyObject *) lParam2;
CString str1 = p1->SomeString;
CString str2 = p2->SomeString;
return strcmp(str1, str2);
}
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
I want to show a popup menu when the right botton is pushed.
I write:
hMenu=LoadMenu(hInstance,MAKEINTRESOURCE(IDR_MENU_DESPLEGABLE));
SetMenu(hWindow,hMenu);
where IDR_MENU_DESPLEGABLE is the menu I want to show.
but this code puts my menu in the place of my window's menu. I would that this menu will be showed where the user pushes the right button, like the most Windows applications.
What code can I use?
sorry my english.
thanks
Christian
|
|
|
|
|
If "botton" means "button" then check this code:
CWnd *pBtn = GetDlgItem (IDC_BTNMNU);<br />
CRect btnrect, wndrect;<br />
<br />
pBtn->GetWindowRect (&btnrect);<br />
GetWindowRect (&wndrect);<br />
CPoint mnupoint (btnrect.left, btnrect.bottom);<br />
BOOL bRet = menu.CreatePopupMenu ();<br />
bRet = menu.TrackPopupMenu (TPM_LEFTALIGN | TPM_LEFTBUTTON, <br />
mnupoint.x, <br />
mnupoint.y, <br />
this);<br />
<br />
<br />
when IDC_BTNMNU is the name of the button.
regards,
Andrea
|
|
|
|
|
Try TrackPopupMenu() function SDK or MFC
for example
void CMyView::OnRButtonDown(UINT nFlags, CPoint point)
{
CMenu menu;
if (menu.LoadMenu(IDR_MYMENU))
{
CMenu* pPopup = menu.GetSubMenu(0);
ASSERT(pPopup != NULL);
pPopup->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON,
point.x, point.y, this);
}
}
and better than OnRButtonDown() OnContextMenu()
viliam
|
|
|
|
|
I have followed your words with my simple C version:
Menu=LoadMenu(hInstance,MAKEINTRESOURCE(IDR_MENU_DESPLEGABLE));
TrackPopupMenuEx(hMenu,TPM_LEFTBUTTON|TPM_LEFTALIGN|TPM_TOPALIGN,LOWORD(lParam),HIWORD(lParam),hWindow,NULL);
but I still have a small problem:
-The popup menu isn't showed complet, only is showed the border but it works fine when calls the WM_COMMAND.
Why the popup menu isn't showed normal??
thanks
Christian
|
|
|
|
|
PLEASE HELP: I'm trying to populate the fields in the 'wave properties dialog'. What I'm I doing wrong?
typedef struct output_tag // any special vars associated with output file
{
short nFile;
long lSize;
DWORD dwDataOffset;
long lSamprate;
WORD wBitsPerSample;
WORD wChannels;
DWORD dwFormat;
BOOL bWroteHeader;
char szTITLE[256]; // Title Displayed
char szARTIST[256]; // Artist
char szNAME[256]; // Name
char szGENRE[256]; // Genre
char szKEYWORDS[256]; // Keywords
char szSOURCE_FORM[256]; // Source Form
char szMEDIUM[256]; // Medium
char szENGINEER[256]; // Engineer
char szTECHNICIAN[256]; // Technician
char szSOURCE[256]; // Source
char szCOPYRIGHT[256]; // Copyright
char szSOFTWARE[256]; // Software
char szCREATION_DATE[256]; // Creation Date
char szSUBJECT[256]; // Subject
char szCOMMENTS[256]; // Comments
char szNumExtraDatas[256];
char extra[256];
} MYOUTPUT;
MYINPUT is the same.
DWORD WINAPI FilterGetNextSpecialData(HANDLE hInput, SPECIALDATA * psp)
{ //return 0; // only has 1 special data! Otherwise we would use psp->hSpecialData
// as either a counter to know which item to retrieve next, or as a
// structure with other state information in it.
DWORD dwCount=(DWORD)psp->hSpecialData;
BOOL bContinue=TRUE;
char * pData=NULL; // Pointer to data
DWORD dwSuccess=1;
int i;
char tmp[48];
MYINPUT *mi;
mi=(MYINPUT *)GlobalLock(hInput);
while (bContinue)
{
bContinue=FALSE;
if (dwCount >= 8)
{
char * pData;
int i = (int)(dwCount - 8);
if ((i >= mi->szNumExtraDatas) || (!mi->extra[i].pData))
{
dwSuccess = 0;
break;
}
psp->dwExtra = (DWORD)-1; // so CEP handles this automatically
psp->dwSize = mi->extra[i].dwLength;
psp->hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, psp->dwSize+8);
pData=(char *)GlobalLock(psp->hData);
CopyMemory(pData, mi->extra[i].pData, mi->extra[i].dwLength);
lstrcpy(psp->szListType, mi->extra[i].szList);
lstrcpy(psp->szType, mi->extra[i].szType);
GlobalUnlock(psp->hData);
}
else switch (dwCount)
{
case 0:
if (!*mi->szTITLE)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"WAVE");
lstrcpy(psp->szType,"DISP");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szTitle)+1+4;
psp->hData=NULL;
pData=psp->szDataIn;
i=1;
CopyMemory(pData,&i,4);
lstrcpy(pData+4,mi->szTitle);
break;
case 1:
if (!*mi->szArtist)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"IART");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szArtist)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szArtist);
break;
case 2:
if (!*mi->szAlbum)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"INAM");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szAlbum)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szAlbum);
break;
case 3:
if (!*mi->szComment)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"ICMT");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szComment)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szComment);
break;
case 4:
if (!*mi->szYear)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"ICRD");
psp->dwExtra=1;
psp->dwSize=lstrlen(mi->szYear)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,mi->szYear);
break;
case 5:
if (!mi->szTrackNumber)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"ISBJ");
psp->dwExtra=1;
wsprintf(tmp,"%d",mi->szTrackNumber);
psp->dwSize=lstrlen(tmp)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,tmp);
break;
case 6:
if (!mi->szGenre)
{
bContinue=TRUE;
dwCount++;
break;
}
lstrcpy(psp->szListType,"INFO");
lstrcpy(psp->szType,"IGNR");
psp->dwExtra=1;
if (mi->szGenre>126)
mi->szGenre=126;
lstrcpy(tmp,Genres[mi->szGenre]);
psp->dwSize=lstrlen(tmp)+1;
psp->hData=NULL;
pData=psp->szDataIn;
lstrcpy(pData,tmp);
break;
case 7:
{
char * pData;
if (!mi->pID3v2)
{
bContinue=TRUE;
dwCount++;
break;
}
psp->dwExtra = 1;
psp->dwSize = mi->dwSizeID3v2;
psp->hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, psp->dwSize+8);
pData=(char *)GlobalLock(psp->hData);
CopyMemory(pData, mi->pID3v2, mi->dwSizeID3v2);
lstrcpy(psp->szListType, "WAVE");
lstrcpy(psp->szType, "ID3x");
GlobalUnlock(psp->hData);
}
break;
default:
// all done!
dwSuccess=0;
break;
}
}
dwCount++;
psp->hSpecialData=(HANDLE)dwCount;
GlobalUnlock(hInput);
return dwSuccess;
}
DWORD WINAPI FilterGetFirstSpecialData(HANDLE hInput, SPECIALDATA * psp)
{
MYINPUT * mi;
DWORD dwSuccess=0;
BOOL bHasTagInfo = TRUE;
if (!hInput)
return 0; // return is boolean
mi=(MYINPUT *)GlobalLock(hInput);
psp->hSpecialData=(HANDLE)0; // start at the case 0: item in FilterGetNextSpecialData
GlobalUnlock(hInput);
if (bHasTagInfo)
return FilterGetNextSpecialData(hInput,psp);
else
return FALSE;
}
Trevor Scott Ph.D., MSc, Eng Hons.
|
|
|
|
|
This is the other part of the code:
DWORD WINAPI FilterWriteSpecialData(HANDLE hOutput, LPCSTR szListType, LPCSTR szType, char * pData,DWORD dwSize)
{
MYOUTPUT * mo;
BOOL bHandled = FALSE;
if (!hOutput)
return 0; // FALSE
mo=(MYOUTPUT *)GlobalLock(hOutput);
if (strcmp(szListType,"INFO")==0)
{
if (strcmp(szType,"IART")==0)
{
CopyMemory(mo->szArtist,pData,min(lstrlen(pData)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"INAM")==0)
{
CopyMemory(mo->szAlbum,pData,min(lstrlen(pData)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"ICRD")==0)
{
CopyMemory(mo->szYear,pData,min(lstrlen(pData)+1,4));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"ICMT")==0)
{
CopyMemory(mo->szComment,pData,min(lstrlen(pData)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
else if (strcmp(szType,"ISBJ")==0)
{
if (atoi(pData)!=0)
{
int i;
i=atoi(pData);
if (i<255)
{
mo->iTrackNumber=i;
mo->iTagVersion=1;
//bHandled = TRUE;
}
}
}
}
else if (strcmp(szListType,"WAVE")==0)
{
if (strcmp(szType, "ID3x")==0)
{
mo->dwSizeID3v2 = dwSize;
mo->hID3v2 = GlobalAlloc(GMEM_MOVEABLE, dwSize);
mo->pID3v2 = (BYTE *)GlobalLock(mo->hID3v2);
CopyMemory(mo->pID3v2, pData, dwSize);
bHandled = TRUE;
}
else if (strcmp(szType,"DISP")==0)
{
DWORD dw;
CopyMemory(&dw,pData,4); // Display Name string
if (dw==1)
{
CopyMemory(mo->szTitle,pData+4,min(lstrlen(pData+4)+1,30));
mo->iTagVersion=1;
//bHandled = TRUE;
}
}
}
// Any ancillary data items from Audition that we don't how to handle, let's save them here
if (!bHandled)
{
int i = mo->iNumExtraDatas;
strcpy(mo->extra[i].szList, szListType);
strcpy(mo->extra[i].szType, szType);
mo->extra[i].dwLength = dwSize;
mo->extra[i].hData = GlobalAlloc(GMEM_MOVEABLE|GMEM_ZEROINIT, dwSize);
mo->extra[i].pData = (BYTE *)GlobalLock(mo->extra[i].hData);
CopyMemory(mo->extra[i].pData, pData, dwSize);
mo->iNumExtraDatas++;
}
GlobalUnlock(hOutput);
return 1; // OK
}
HANDLE WINAPI OpenFilterOutput(LPSTR lpstrFilename,long lSamprate,WORD wBitsPerSample,WORD wChannels,long lSize, long *lpChunkSize, DWORD dwOptions)
{
HANDLE hOutput;
short nFile;
nFile=_lcreat(lpstrFilename,0);
if (nFile==-1) return NULL;
if (hOutput=GlobalAlloc(GMEM_MOVEABLE|GMEM_SHARE,sizeof(MYOUTPUT)))
{
MYOUTPUT *mo;
DWORD dw;
mo=(MYOUTPUT *)GlobalLock(hOutput);
mo->nFile=nFile;
mo->lSize=lSize; // size in bytes 16-bit PCM
mo->lSamprate=lSamprate;
mo->wBitsPerSample=wBitsPerSample;
mo->wChannels=wChannels;
dw=0x646e732e;
_lwrite(mo->nFile,(LPCSTR)&dw,4);
mo->dwFormat=dwOptions;
FillMemory(mo->szTITLE,255,0);
FillMemory(mo->szNAME,255,0);
FillMemory(mo->szARTIST,255,0);
FillMemory(mo->szGENRE,255,0);
FillMemory(mo->szKEYWORDS,255,0);
FillMemory(mo->szSOURCE_FORM,255,0);
FillMemory(mo->szMEDIUM,255,0);
FillMemory(mo->szENGINEER,255,0);
FillMemory(mo->szTECHNICIAN,255,0);
FillMemory(mo->szSOURCE,255,0);
FillMemory(mo->szCOPYRIGHT,255,0);
FillMemory(mo->szCREATION_DATE,255,0);
FillMemory(mo->szSUBJECT,255,0);
FillMemory(mo->szCOMMENTS,255,0);
mo->bWroteHeader=FALSE;
//dw=0;
//_lwrite(mo->nFile,&dw,4);
GlobalUnlock(hOutput);
}
*lpChunkSize=16384;
return hOutput;
}
THANKS!!!!!
Trevor Scott Ph.D., MSc, Eng Hons.
|
|
|
|
|
I use two classes to work with my database:
CADODatabase and CADORecordset from Carlos Antollini(See http://www.codeproject.com/database/caaadoclass1.asp#CommonQuestions[^] ).
the following part demonstrates it:
>CString strConnection=_T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=module.mdb");
>if(m_db.Open(strConnection))
>{
> m_rec=CADORecordset(&m_db);
> if(m_rec.Open(_T("main"), CADORecordset::openTable))
> MessageBox("Table 'main' is opened.");
>}
but I need a bi-directional scrolling in my database. It is important for me, because I use CTreeCtrl, that have records from my database as TVITEM's pszText. But I can't
realise it(bi-directional scrolling) like I can do it with another class CRecordset::dynaset or CRecordset::dynamic as a parameter of
m_rec.Open(...);
If someone had faced with this problem, please, leave your note here.
|
|
|
|
|
bilas,
I am using a very early version of Carlos's classes and this interested me
a bit as I would like to upgrade to Version 2.
I wrote quick program to test your problem, but could not find anything at
fault! The program connects to an existing database (JET 4), and then cycles
through a particular field. I then starts at the end of the recordset and traverse
backwards to the beginning. I hope this is what you meant by bi-directional
scrolling!
The program opens the table in direct mode (openTable) to mimic what you have
done. Have a look below and see if you can see anything amiss between yours and mine.
void CMytestDlg::OnOK()
{
CString strConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\\temp\\MyDB.mdb");
CADODatabase db;
if(db.Open(strConnection))
{
CADORecordset rs;
if(rs.Open(db.GetActiveConnection(), "Categories", CADORecordset::openTable))
{
rs.MoveFirst();
while(!rs.IsEOF())
{
CString strKeyword;
if(rs.GetFieldValue("Keyword", strKeyword))
{
Log(strKeyword);
}
else
{
Log("--EMPTY--");
}
rs.MoveNext();
}
Log("");
Log("==== AND NOW THE REVERSE =====");
rs.MoveLast();
while(!rs.IsBOF())
{
CString strKeyword;
if(rs.GetFieldValue("Keyword", strKeyword))
{
Log(strKeyword);
}
else
{
Log("--EMPTY--");
}
rs.MovePrevious();
}
rs.Close();
}
db.Close();
}
}
I Dream of Absolute Zero
|
|
|
|
|
RChin, I've done everythink, but now it does not work again.
Please, if you can, look at my code. You can download my program from
http://bilasguitar.narod.ru/confidential/tempo.zip - 54Kb.
A problem is in MyDialog.cpp
Thanks in advance,
bilas.
|
|
|
|
|
bilas, I've had a quick look at your code and although there are quite a
few issues with the code, I will try to only comment on the revelant ones.
You have a JET database with the following dataset:
<small>
Sys_Cd Sys_Nm Sys_ParRcd Sys_Rcd
-------+-----------+------------+---------
25 | record15 | 3 | 8
30 | Parent 2 | 0 | 9
31 | Child 1 | 9 | 10
32 | Child 2 | 9 | 11
33 | Child 3 | 9 | 12
10 | Parent 0 | 0 | 1
11 | record01 | 1 | 2
20 | Parent 1 | 0 | 3
21 | record11 | 3 | 4
22 | record12 | 3 | 5
23 | record13 | 3 | 6
24 | record14 | 3 | 7
</small>
.First off, this is the order that you will get when you open up the recordset
in openTable mode. If you require a different order (which I suspect you do), you will have to
either:
1. Open the recordset in openQuery mode, using an SQL statement to order your
result set. ("SELECT * FROM [main] ORDER BY [sys_Rcd]")
2. If you need to open up the table directly, you will have to ensure that the indices of the
field that you want returned in a specific order exist. Currently you have three indices defined, in addition
to the primary key.
I suspect that you wanted your tree to be ordered by the Sys_Rcd field, with the Sys_ParRcd
field determining whether the item is a parent or a child, so whould look a bit like this:
<small>
+---Parent 0
| \---record01
+---Parent 1
| +---record11
| +---record12
| +---record13
| +---record14
| \---record15
+---Parent 2
+---Child 1
+---Child 2
\---Child 3
</small>
Secondly, the problem you seem to be having is not a database
connectivity issue, but a tree population one. The ADO class acts just as it should,
you just need to know what its doing so that you can populate your tree accordingly.
The population code seems a bit messy and at times confusing. Separate this out into a separate
function and work through what you want to achieve logically. Possibly write down first on a
sheet of paper in psuedo-programming exactly what you want to be done before creating your function.
Thirdly. There one or two potentially serious coding errors that
may trouble you later on. For Example:
if(val1 == '0') , should be changed to
if(strcmp(val1,_T("0")) == 0) or if(val1.Compare("0")==0)
Infact, since the field is already a number, you can retrieve this to an integer variable.
Also, your CMyDialog is being allocated on the heap via the View class without being
deleted, so you will see memory leaks when the application exits.
Anyway, I hope these comments helps in your quest for programming peace and fulfilment
I Dream of Absolute Zero
|
|
|
|
|
RChin, I really thank you for your explanation. It is very important for me to have information you
wrote. Can't express my gratitude for your usefull efforts.
Only one question: how can I know the order of records(like you wrote above) when I open my
database?
Bilas.
|
|
|
|
|
I have slider control control with 4 ticks,
but if I ask position of index=2 tick
slider return error value - incorrect index:
<br />
int tic_min, tic_max;<br />
<br />
pForm->m_SliderPage.GetRange (tic_min, tic_max);<br />
<br />
int x= pForm->m_SliderPage.GetTicPos(poz);<br />
<br />
<br />
<br />
why so happens?
thanks
|
|
|
|
|
Have you tested other positions ? 0, 1, 3 ?
Do they return correct values ?
Your code only shows that your slider's range is from 0 to 3. It does not show whether you have set it to have ticks at 1 intervals. For this purpose, the style TBS_AUTOTICKS must be set when creating, after which a call to SetTicFreq member with parameter 1 would do the job.
Try calling GetTickPos with different values. If all return -1, you've forgotten something in the initialization of the control. If only position 2 returns -1, then check your tic frequency and/or force it to '1'.
Remember, that the range setting does not assume that there are ticks in the control. A slider control with a range 0 -> 3 without ticks would result in a bar which has 0 at the other end, 3 at the other, and nothing inbetween. This would cause a '-1' to be returned from a query for an invalid position. In this case, only positions 0 (0) and 1 (3) would be valid.
Here, I assume you use CSliderCtrl MFC class. If you use a custom slider control, then it's implementation might be buggy.
Try out those suggestions and reply with results. Then I might be able to help you more.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
0,1 postions are working.
If I make 10 positions
0-8 positions working, but not two last...
what problem witj two last positions can be?
thanks.
|
|
|
|
|
Add the style 'TBS_AUTOTICK' to the control's style flags.
Then call SetTickFreq(1) after setting the ranges. Now try again, it should work. At least I got my slider to work smoothly
The last option is to do the above, and a button to show the currently selected notch index. Then run the program, moving the slider and pressing the button at each notch to see it's index. If the "currently selected notch" query handles all notches correctly, then there's a bug in the implementation of the control. Getting an upgraded version of MFC might help.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|