|
Did you checked one of the best available source code here[^]
|
|
|
|
|
Thank you very much. I also found that article, after I posted my request. I already programmed my own CMap extension class, because I use MFC in my project (and therefore don't use STL, because I don't want to mix them). I will write an article about my extension class for codeproject when I have some free time.
Regards
Konrad
|
|
|
|
|
Konrad Windszus wrote:
because I use MFC in my project (and therefore don't use STL, because I don't want to mix them).
Why not? What's the problem?
Kevin
|
|
|
|
|
Hi all,
I am about to become a crazy man because of the following:
I want to use a structure and some functions in winuser.h file, I #include it and link user32.lib with my project, but the compiler always tells me that they are undefined, I tried this on many projects and always the same:
I write :
INPUT i;
and the compiler writes:
error C2065: 'INPUT' : undeclared identifier
Please try it.
I feel like I have not ever done anykind of programming.
Regards,
Mohammad
|
|
|
|
|
|
Hi Mike,
Thanx for replying my message, but I have another question:
the FAQ question you refered includes a link to micrososft windows sdk updates, but when I got into the page I found that these updates are for Windows Server 2003, should I install these on Windows 2000/XP/98?
Do they work well for these platforms?
If no, Where Can I find other SDK updates for other versions of Windows?
Regards,
Mohammad
|
|
|
|
|
Hi,
Are you sure that th compiler is familiar with these files?
Go to Tools->Options,choose the "directories" tab,and search in the list box those directories(Full path name).
If it's not in the list box,you should add this(add the directory of winuser.h to the "include files listbox" and the directory of the user32.lib to the "library files list box").
this sould solve your problem.
Good luck,
Eli
|
|
|
|
|
Questions:
how to delete some installed files (i.e. COMs) which are used by Windows system by inno uninstall (in section or script)?
those files were installed by inno setup.
normal uninstall does not work for these files because they are used by system and can not be deleted - even can not be deleted manaully.
thx
includeh10
|
|
|
|
|
Hi, I have use the text that a user input in an Edit Box in MFC, in my function.
Infact, the user input a sentence and I have to broke it into tokens. But the problem is that Im dont kno how to retrieve the sentence from the edit box to use it in the tokeniser function. Can sm1 plz help. I Need it soon koz lots of work is going pending since I cant see if the function is working properly b4 continuing.
& plz also tell me how to display the text that my function returns. Have done it in C++, it works but the only problem is MFC
|
|
|
|
|
Hello There!
Let Consider the m_strEditBox of type CString which is the variable associated with the EditBox from which you want to get text input by User.
now! For Getting Text in to your Variable i.e. m_strEditBox
Call UpdateData(...); with TRUE as Argument
this->UpdateData(TRUE);
this will fill your m_strEditBox with the data entered by user
.................
Now do anything with the m_streditBox variable i.e. broke in token etc etc.
..................
now if you want to update the data back to Edit Box
just again Call UpdateData(...); with FALSE as argument
i.e. UpdateData(FALSE);
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
Thanks.
how do I display my output in some other edit box now .
|
|
|
|
|
Now let the m_strEditBox1 of type CString is associated with some other edit box where you want to put data.
//now give value to m_strEditBox1
m_strEditBox1 ="Codeproject is great";
//Update the data back to edit box call UpdateData
this->UpdateData(FALSE );
"I Think this Will Help"
[Vote One Here,.....]
<h5
alok gupta="" <br=""> visit me at http://www.thisisalok.tk
|
|
|
|
|
CEdit m_MyEditControl;
CString m_csEditControlText;
// fill in edit field immediately, bypassing dialog's UpdateData call...
m_MyEditControl.SetWindowText(m_csEditControlText);
|
|
|
|
|
check msdn for GetWindowText().
suhredayan There is no spoon.
|
|
|
|
|
I tried to use it b4 but cant extract the text coz its return type is void
|
|
|
|
|
reenacutie wrote:
I tried to use it b4 but cant extract the text coz its return type is void
Just curious to know, Where you got the information that the GetWindowText() function will return the edit text ?
suhredayan There is no spoon.
|
|
|
|
|
void CWnd::GetWindowTest( CString& s );
well duh ( sorry, it's 3:00 am, and I'm not asleep ), you pass a reference to a CString to GetWindowText...
CString myString;
MyEditBox.GetWindowText( myString );
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
As Maximilien said, you give the GetWindowText() a String, and it will fill it for you.
As for getting the right variable to call GetWindowText() on, you can use the ClassWizard to make a so called Control Variable for you. Thats a variable of the Type of your control (probably CEdit) and you can use it without resorting to the complicated and confused UpdateWindow()-stuff.
You just need to set one hook in the Class Wizard.
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
I have the following code adding to a CListCtl on a dialog box named m_cList, but for some reason the first element I add doesn't show up:
<br />
LRESULT CRTFParseTest1Dlg::OnCreateListGroup(WPARAM wParam, LPARAM lParam)<br />
{<br />
CStringArray sa,<br />
sa1;<br />
CString sFormat;<br />
<br />
for(int a(0); a < 3; a++) {<br />
sFormat.Format("Column %d", a);<br />
sa.Add(sFormat);<br />
}<br />
InsertColumns(sa);<br />
sa.RemoveAll();<br />
<br />
sa.Add("Item");<br />
for(int b(0); b < 5; b++) {<br />
sFormat.Format("Group %d", b);<br />
AddListGroup(b, sFormat);<br />
<br />
for(int b_0(0); b_0 < 2; b_0++) {<br />
sa[0].Format("%d:%d", b,b_0);<br />
AddItemToGroup(b_0, sa, b);<br />
}<br />
}<br />
<br />
return 0;<br />
}<br />
<br />
<br />
LRESULT CRTFParseTest1Dlg::AddListGroup(int id, CString sTitle)<br />
{<br />
USES_CONVERSION;<br />
<br />
if(!m_cList.IsGroupViewEnabled()) {<br />
if(m_cList.EnableGroupView(TRUE) == -1 || !m_cList.IsGroupViewEnabled()) {<br />
TRACE("==>CParseTest1Dlg::AddListGroup { Could not enable list grouping }\n");<br />
return -1;<br />
}<br />
}<br />
<br />
LVGROUP lvg;<br />
ZeroMemory(&lvg, sizeof(lvg));<br />
<br />
lvg.cbSize = sizeof(LVGROUP);<br />
lvg.mask = LVGF_GROUPID | LVGF_HEADER | LVGF_STATE;<br />
lvg.pszHeader = A2W(sTitle);<br />
lvg.cchHeader = sTitle.GetLength();<br />
lvg.iGroupId = id;<br />
lvg.stateMask = LVGS_NORMAL;<br />
lvg.state = LVGS_NORMAL;<br />
<br />
return m_cList.InsertGroup(-1, &lvg);<br />
}<br />
<br />
LRESULT CRTFParseTest1Dlg::AddItemToGroup(int id, CStringArray &sColumnText, int iGroupId)<br />
{<br />
int iRes = m_cList.InsertItem(id, sColumnText[0]);<br />
<br />
if(iRes >= 0) {<br />
iRes = TRUE;<br />
for(int i(1); i < sColumnText.GetSize() && iRes != FALSE; i++) {<br />
iRes = m_cList.SetItemText(id, i, sColumnText[i]);<br />
}<br />
<br />
if(iRes != FALSE && iGroupId != -1) {<br />
LVITEM lvi;<br />
lvi.mask = LVIF_GROUPID;<br />
lvi.iGroupId = iGroupId;<br />
lvi.iItem = i;<br />
<br />
iRes = m_cList.SetItem(&lvi);<br />
}<br />
}<br />
return iRes;<br />
}<br />
<br />
bool CRTFParseTest1Dlg::InsertColumns(CStringArray &sColumnTitles)<br />
{<br />
int iRes(0);<br />
for(int i(0); i < sColumnTitles.GetSize() && iRes!=-1; i++) {<br />
iRes = m_cList.InsertColumn(i, sColumnTitles[i], LVCFMT_LEFT, 100);<br />
}<br />
return (iRes != -1);<br />
}<br />
Any idea how to make it work?
|
|
|
|
|
your code displays 10 elements and is working. starting from 0.0 to 4.1 . Which is the exact string you feel is missing as per the code.
suhredayan There is no spoon.
|
|
|
|
|
The code to create them does work, but in the list the groups don't have the right elements in them. Here is what I get in my list control:
Group 0
-0:1
Group 1
-0 <--This should be in group 0
-1:1
Group 2
-1 <--This should be in group 1
-2:1
Group 3
-2 <--This should be in group 2
-3:1
Group 4
-3 <--This should be in group 3
-4:1 <--Where did 4 go? It doesn't show up in the list.
The problem is the first element in each group shows up in the preceeding group, which is probably why 4 does not show up. I can't seem to figure out why this happens and how to fix it. Got any ideas?
|
|
|
|
|
i have developed one console application in VC++. It contains following code;
system("\\\\COMP1\\shared\\app1.exe");
it tries to execute app1.exe, which resides on remote machine. It works when run as a console application.
I have created one service MyService. This service calls the above console application.In this case system() fails to execute app1.exe .
please help me.
bhavesh
|
|
|
|
|
service by default runs as "SYSTEM" user. Suggested way is to make service run as
a different user, who has the permission to access the "COMP1\\shared" folder. Open "SCM->dbl clk MyService->Logon_tab" change the user.
suhredayan There is no spoon.
|
|
|
|
|
2 questions
1) is wininit.ini in windows directory or system directory?
2) how to write keys to a secton of wininit.ini file?
thx
includeh10
|
|
|
|
|
1) The \windows directory
2) It's an INI file, however for deleting it's harder because the format is:
[rename]
NUL=C:\temp\file1.exe
NUL=C:\foo\file2.exe and so on. You can't use WritePrivateProfileString() because the second NUL line would replace the first. You need to read the whole file in, modify it, and write it back out. I know I saw an MSDN article with code to do this, but I can't find it now.
--Mike--
LINKS~! Ericahist updated! | 1ClickPicGrabber | CP SearchBar v2.0.2 | C++ Forum FAQ
Strange things are afoot at the U+004B U+20DD
|
|
|
|