|
so
first i define a variable for my edit control lets say m_EDIT1
but when i wrote m_EDIT1.SetWindowText()
an error show up saying :
SetWindowTextA' : is not a member of 'CString
what s wrong
|
|
|
|
|
lahom wrote: SetWindowTextA' : is not a member of 'CString
m_EDIT1 should be a CEdit control variable. See here.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hello all,
I am creating an installer for a windows application that requires PostgreSQL, therefore this installer launches the PostgreSQL setup silently. Since the PostgreSQL installer creates a local windows account on the target machine, I need to gather this information (username/password) and pass it to postgres-setup when it is launched. But, if the password does not meet the minimum requirements set in the Local Security Setting, installation fails. My question:
Is there a way to programatically check if a given password-string meets the password policies? (Preferably in C++)
Thanks in advance.
|
|
|
|
|
Hello,
I know it's possible, with a bit of work and a custom sorting algorithm, to add the ability to drag&drop-order items in a CListCtrl (in ICON view mode) to reorder them manually. I found this article: http://support.microsoft.com/kb/822483/en-us pertaining to such a thing, but it's all in VB/C# and was wondering if there was a way to do it in C++...?
Currently, I have set up the correct OnBeginDrag, OnMouseMove and OnLButtonUp functions working just fine -- I get a dragIndex and dragPoint&dropPoint ,... but the problems are:
1.) dropIndex is not calculated correctly, because it can be ordered in both different X and Y coordinates to drop it into
2.) deleting the currently dragged item at it's position, and adding it to the correctly dropped position
3.) then shifting all the other items into their correct (new) positions
Here is the code, the sorting algo is currently quite(!) incomplete and just for left&right sorting tests...
<br />
POINT startPT;<br />
GetItemPosition(m_nDragIndex, &startPT);<br />
<br />
POINT endPT;<br />
for (int i = 0; i < GetItemCount(); i++)<br />
{<br />
if (i == m_nDragIndex) continue;<br />
<br />
GetItemPosition(i, &endPT);<br />
<br />
if (endPT.x > m_ptDropPoint.x)<br />
{<br />
m_nDropIndex = i;<br />
if (startPT.x < m_ptDropPoint.x) m_nDropIndex--;<br />
<br />
break;<br />
}<br />
}<br />
<br />
char szLabel[256];<br />
LVITEM lvi;<br />
ZeroMemory(&lvi, sizeof(LV_ITEM));<br />
lvi.mask = LVIF_TEXT | LVIF_IMAGE | LVIF_STATE | LVIF_PARAM;<br />
lvi.stateMask = LVIS_DROPHILITED | LVIS_FOCUSED | LVIS_SELECTED;<br />
lvi.pszText = (LPWSTR)szLabel;<br />
lvi.iItem = m_nDragIndex;<br />
lvi.cchTextMax = 255;<br />
GetItem(&lvi);<br />
<br />
if (m_nDropIndex < 0)<br />
m_nDropIndex = GetItemCount();<br />
<br />
lvi.iItem = m_nDropIndex;<br />
InsertItem(&lvi);<br />
<br />
if (m_nDragIndex > m_nDropIndex)<br />
m_nDragIndex++;<br />
<br />
SetItemData(m_nDropIndex, GetItemData(m_nDragIndex));<br />
<br />
DeleteItem(m_nDragIndex);<br />
I have auto-arrange currently turned off for certain purposes and feel this is necessary for this sort of custom-sort. If anyone has any ideas, or can convert that article's code into the correct C++/MFC ones, that'd be an immense help!
Thanks!
|
|
|
|
|
Hello again,
I've made quite a bit of progress on this --
All that's left is the correct sorting algorithm.
The algorithm on this is a bit tricky, because on list/report views you can use the HitTest() and get the correct index to swap to...but unfortunately with the thumbnail view, there's dead/white space between each item and if you drop an item between two items, it will not return correct results or any kind of flags to check for...
I figure there's a few instances:
1.) Drag to the right on the same row
2.) Drag to the left on the same row
3.) Drag below on the same column
4.) Drag below to the right
5.) Drag below to the left
6.) Drag above on the same column
7.) Drag above to the right
8.) Drag above to the left
Does anyone have any ideas on how this algo can be achieved?
Thanks
|
|
|
|
|
Hi,
I am working with a project where all the anci strings are converted to Unicode to support japanese language.
One console module which takes command line arguments retuns junk/japanese characters in Argv.
Could any one give some suggestions regarding the settings/code changes that i need to do.
Thanks,
kk
|
|
|
|
|
what does your main() function look like?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
int main( int argc, TCHAR* argv[] )
|
|
|
|
|
Ok, so what of argv are you having trouble with?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I read the article MFC Grid control 2.26 (By Chris Maunder). I added necessary files. I created a custom control, named it, created a variable of CGridCtrl class but when I created, it failed. Some one who used to use this class successfully plz show me a solution. Thanks !
|
|
|
|
|
this question is directly related to the use of the sources of that article.
consequently, you'd be glad to ask this question in the forum at the bottom of the article, so that the author will directly get notified.
|
|
|
|
|
capint wrote: it failed
Read "How to get an answer to your question", pay attention to item #2
led mike
|
|
|
|
|
capint wrote: ...when I created, it failed.
Which means what exactly?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
As a wild guess (because you didn't provide a lot of usefull information): do you have a DDX_GridControl line in your DoDataExchange function from your dialog class ? If not, then you'll need to add one.
|
|
|
|
|
|
I'll show exactly what I did so that you can help me
I put a custom control, add class name as MFCGridCtrl
In the file .h, I add the variable CGridCtrl grid. In the file .cpp, at the function DoDataExchange, I add manually DDX_GridControl(pDX, IDC_CUSTOM3, grid);
And I create by the function grid.Create()
But it show the error : Debug Assertion Failed
|
|
|
|
|
Does identify of IDC_CUSTOM3 is unique on the resource file?
|
|
|
|
|
Yes
|
|
|
|
|
Did you use of breakpoints for trace your code line to line and if yes did you see which line has error?
|
|
|
|
|
When I debug, the debugger stop at the line : ASSERT(pWnd->m_hWnd == NULL); in the file wincore.cpp
I used : grid.Create(rect, this, 1);
I don't know if the handle of window parent is true or false
|
|
|
|
|
It seems that you have a null hwnd does grid.Create(rect, this, 1);(and did you see that rect and this are valid or they are empty) has return value if yes what is it and do you want to use of MFC grid on your project or when you want to compile it you got this error?
|
|
|
|
|
The error doesn't come from my project because I just create a blank based dialog. Of course, rect & this are valid ( I use the pointer this in OnInitDialog())
I uploaded my file so that you can see clearly : http://www.mediafire.com/?ijb5p1vxgme[^]
Plz help me
|
|
|
|
|
You must wait until I compile your project.
|
|
|
|
|
compile your code with
/* CGridCtrl grid;
RECT rect;
rect.top = 10;
rect.left = 10;
rect.bottom = 50;
rect. right = 50;
//CWnd * pWnd;
//pWnd->GetParent();
grid.Create(rect, this, 1);
*/
For test insert these statement
grid.InsertColumn(_T("111"));
grid.InsertColumn(_T("111"));
grid.InsertColumn(_T("111"));
grid.InsertRow(_T("112"));
grid.InsertRow(_T("112"));
grid.InsertRow(_T("112"));
|
|
|
|