|
See here[^] and here[^]
I hope it helps.
Regards,
Sandip.
|
|
|
|
|
good morning
in MFC what you can do is
define a member in your mydialog.h
CListBox m_MyListBox;
use DDX to link you member with the control.
DDX_Control(pDX, IDC_MYLIST_BOX, m_MyListBox)
Then to read the content
CString sText;
int ListSize = m_WLinks.GetCount();
for(int i=0; i!=ListSize; ++i)
{
m_MyListBox.GetText(iIndex, sText);
}
Regards
Franck
|
|
|
|
|
Hello Sir,
Thank you very much for the response.
In the Loop i just added this line , with .GetText method its working now.
m_MyListBox.GetText(iIndex, sText);
|
|
|
|
|
Hi all,
i m using Access databse and ODBC connection to connectivity with the database.
there is number of tabels approx 36 tabels.
Each n every table have separate CRecordset derived class.
at one point when i m using many of these table,firstly its working fine but after some time
CRecordset::Open takes so much time to open recordset and between this duration application looks like not responding.
please help me how can i resolve this.
please help for this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Le@rner wrote: please help me how can i resolve this.
Without seeing your code?
Sorry my Code Project Mind Reader Unit is out of order today!
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 created WGI, a GUI lib written with C. WGI is open source. I issue the demo project of WGI 1.0.0. Here to download its source code: http://code.google.com/p/oic-wgi/downloads/list
What WGI? WGI is doing what MFC has done, to encapsulate API, BUT WGI uses OIOIC, instead of C++.
Look forward to various advices sincerely.
|
|
|
|
|
Why don't you write an article about?
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...
I am having a CString variable like
str = "Hi this is circle then it needs ro circle jsdfhd circle hjdfhdgf circle ysdfh circle feduf";
Now i have to find how many same("circle") words repeated in the string.
How can i find?Help me.
Thanks...
G.Paulraj
|
|
|
|
|
You can use the Find method of the CString class in a loop by adjusting its iStart parameter.
|
|
|
|
|
I used Find method. But not get. can you please tell me something brief?
G.Paulraj
|
|
|
|
|
Create an integer variable iStart and set it to 0 .
Call str.Find("circle", iStart);
Check the return value.
If it is -1 , the word was not found.
Otherwise use str.Mid with the return value from Find as the first parameter.
Now increment iStart by the 6 , which is the length of the word "circle" .
Repeat the loop till Find returns -1 .
It is recommended to enclose all strings in the _T("") macro so that it works for both UNICODE and NON-UNICODE builds.
|
|
|
|
|
Thanks a lot...
G.Paulraj
|
|
|
|
|
Hope you tried your hand before getting the code.
CString csStr = _T( "Hello it is circle, how is this circle" );
LPCTSTR CIRCLE = _T( "Circle" );
int nPos = 0;
int nCountCircle = 0;
while( -1 != ( nPos = csStr.Find( CIRCLE, nPos ))
{
nPos++;
nCountCircle++;
}
Величие не Бога может быть недооценена.
|
|
|
|
|
Adam Roderick J 09 wrote: CString csStr = _T( "Hello it is circle, how is this circle" );LPCTSTR CIRCLE = _T( "Circle" );int nPos = 0;int nCountCircle = 0;while( -1 != ( nPos = csStr.Find( CIRCLE, nPos )){ nPos++;nCountCircle++;}
Could it will like this, possibly instead of nPos++ to nPos+= _tcslen(CIRCLE); , little more performance oriented code
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
The cheeky method:
Make a copy of the string and run CString::Replace() on it. It will return the number of replaced instances.
|
|
|
|
|
I download DFV_Demo from codeproject,I use my custom view doc mainframe to inherit interrelated class of DFV_Demo,but i cann't update view immediately as common .For example , when i click first button of toolbar, fistr button is press,and then i continue to click second button, sencond button is press ,but first is still press,i'm trouble in it,need your help,thank you first.
|
|
|
|
|
It's probably a 3-state button which remains pressed when it is clicked once and is released on the second click.
|
|
|
|
|
as you say it's a 3-state button ,it's a button in toolbar but i cann't understand how to update view in a dialog control
|
|
|
|
|
Can you please explain it clearly,
It is very difficult to understand whats you need.
I guess you want to update all the view of a MDI or SDI application.
Is it so then UpdateAllViews can be used [^]
Величие не Бога может быть недооценена.
|
|
|
|
|
Yes,i need to update view,it's different from with traditional SDI, it's my custom view.
The view is on the dialog control,thanks for your reply
|
|
|
|
|
Hello everybody !
I select the menus from Resource View.
Now I want to hide/remove the menu when he is login faild !
just like this :
BOOL CSSCDlg::OnInitDialog()
{
CDialog::OnInitDialog();
CLogin dlg;
int nDlg;
nDlg = dlg.DoModal();
if(nDlg == IDCANCEL)
{
......
}
}
Thanks for your reply !
Best Reguards !
|
|
|
|
|
|
I know the mean , thanks a lot !
|
|
|
|
|
Hello folks!
This isn't directly a C++ question, but i don't really know where to ask this, and it is kinda related to C++ since we do work with VC++ and use MFC so...i thought i try my luck here, sorry if i "heavily" misplaced this question. So...
We work on a project, every time we give out an RC (Release Candidate), we backup the PDB and the -that time- current source files for later usage. Then, after we receive a crash report from a test site, we check the logs what version they were created with, retriece the PDB, the EXE and the sources to analyze the minidump included with the logs. Now, my problem is that the PDB seems to have the paths to the source files "hardcoded" into it and because of this, every time when we get a dump to analyze, we have to replace our latest sources with the less recent ones which were archived when the given RC went out so we know where the crash occured, what threads were doing and so on. After we are done with it then we have to get back to our latest sources again to continue the development. As you can think this is a bit...uncomfortable. Is there a way to tell Visual Studio (2003, yes, i know, it is old...) to search for the source files somewhere else than where they originally were located when the PDB was made? What i mean is, for example let's say a given file is in c:\projects\the_thing\the_file.cpp when the project is being built. Once the RC is out we make changes to the_file.cpp, then we get a crash, instead of having to replace the_file.cpp with the earlier version to see where the crash occured, i would rather try to copy the earlier version to c:\dumpchecks\the_thing\the_file.cpp and then somehow tell VS to instead of c:\projectss\the_thing, use c:\dumpchecks\the_thing to locate the sources. Of course i wouldn't like to do this for every single file, just tell it once to use c:\dumpchecks instead of c:\projects. Is this duable, or is there some other simple way i don't know of to solve this? I tried to change some folders in project settings and such like the "Working folder" but nothing seems to change this. Thanks in advance for any help.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
Not sure if you can do this in Visual Studio, but you can set a source path in a Windbg session.
|
|
|
|