|
I have the 4 views in my application, but I need to control LVS_SMALLICON behavior... there must be a way to do this, because the way the contents are displayed is not predictable at all, it is 3-items in a row when i switch from LVS_ICON, while it is 1-item in a row when I switch from LVS_LIST view.
Regards,
Mohammad
And ever has it been that love knows not its own depth until the hour of separation
|
|
|
|
|
Yes I agree with Mila025 your sound like you need to LVS_REPORT?
|
|
|
|
|
Mohammad A Gdeisat wrote: CListView problem
What's the problem ?
Just can't read it in your post.....
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I have created winpe 2.0 image but my WMI application doesnot runs on it.
I have added WMI support in winpe 2.0 image using following following cmd
peimg /install=WinPE-WMI-Package c:\winpe_x86\mount\windows
-Regards
Sachin
|
|
|
|
|
UINT ListFiles(LPVOID pParam)
{
CFileFind tempFind;
CString temp(_T("C:\\mysettings\\*.*"));
AfxMessageBox("before");
BOOL IsFinded=tempFind.FindFile(temp);
AfxMessageBox("after");
return 0;
}
void CCSetDlgDlg::OnButtonList()
{
AfxBeginThread(ListFiles,this);
}
My code is very simple.Everything is ok under debug configuration.but when I changed the configuration into static release.something happened.I found that 'before' message box showed,but never the 'after' message box.It seemed that the code was blocked at 'FindFile'.
How could this happen? I think my project settings may be wrong somewhere.(MFC6/VC6)
I have done a lot to figure out the problem but no way. My project is a little large and would be finished soon.
Could anybody give me a help please?
|
|
|
|
|
Just quick thought. Remove message boxes, and create log instead.
Probably, your code is working correct.
|
|
|
|
|
Thank you Prasad.
Yes, I tried. I tried log. And I also removed the log before 'FindFile'. But still,what ever the code right behind FindFile,It would never be there.
|
|
|
|
|
|
You need to find out exactly where the program is hanging. To this end I’d alter the project settings for the release configuration so it contains debug information then run the release build in the debugger and break into it when it’s hung and check out the call stack. The enable debug information in a release build follow these steps (MSVC6):
- Select “Project->Settings”
- Select “Release” configuration.
- Select “C/C++” tab.
- In the “Category” combo select “General”.
- In the “Debug info” combo select “Program Database”. Note that in a debug build you’d select “Program Database for Edit and Continue”.
- Select the “Link” tab.
- Select “Debug” in the “Category” combo.
- Tick/select “Debug info”, “Microsoft format” & “Separate types” (same as in debug builds).
This is the first change I make when setting up a new project. If I made the IDE these would be the default settings.
PS:
PI = 3.141592653^58979323846......
The '^' shows where you name stops. Normal convention is to round up if the digit after is 5 or above, thus I feel your name should be:
3.141592654
Steve
|
|
|
|
|
Thanks for your reply.
Infact I have done as what you have said already.
And If I configured as you had said,everything is fine either.
since I can't figure out the problem I post a help here.
PS:3.141592653 is my name.
but my signature is "3.141592653..... Never Stop!"
3.141592653..... Never Stop!
|
|
|
|
|
Can you post the call stack to the hang?
PS: I'll just call you "three and a bit".
Steve
|
|
|
|
|
call stack?
I found that my program was blocked here:
->LPTSTR pstrBack = _tcsrchr(pstrRoot, '\\');
LPTSTR pstrFront = _tcsrchr(pstrRoot, '/');
in BOOL CFileFind::FindFile(LPCTSTR pstrName /* = NULL */,
DWORD dwUnused /* = 0 */)
pstrRoot is correct
|
|
|
|
|
Stephen Hewitt wrote: PS:
PI = 3.141592653^58979323846......
The '^' shows where you name stops. Normal convention is to round up if the digit after is 5 or above, thus I feel your name should be:
3.141592654
Now that’s taking being pedantic to whole new levels.
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
My intent was to be a smart ass.
Steve
|
|
|
|
|
I do not think the debugger or call stack or whatever will get you out of this trouble. Indeed, nothing seems wrong with this code. It has noting to do with your build settings, normally erros with that result in huge numers of error messages.
I think this has to do with corrupted memory. It may be caused by any part of your application. What I would do in this circumstances is to isolate parts of the application by switching off code (cemment out). Then try to find out when te problem disappears. Italso ma be useful to check carfully for possibly corrupted memory. Did you intialize all pointers? Did you maybe release meory (using delete or free), but try to accessthis memory from other places? Is it possible that you exceed any array bounds? It may take a lot of time to debug.
I wish you good luck in this bug hunting. It happened to me two or three times in my career, but I always found a reason for tis behaviour.
|
|
|
|
|
Hi all,
This is a basic C programming question.
I need to save group of data in to a file with the datas separated by commas.
But, if the datas have commas within themselves, I need to strip that comma and save the data as one single word without commas. But each data item needs to be separated by commas.
Can anyone tell me how to escape or strip the comma if it is within the datafield.
eg., 1, Steve,Dave, 25yrs, California
I want to strip or ignore the comma that is between Steve and Dave and store the data as
1, SteveDave, 25yrs, California
I know this is a basic question. But i need help in this guys.
Many thanks in advance.
|
|
|
|
|
thathvamsi wrote: eg., 1, Steve,Dave, 25yrs, California
I want to strip or ignore the comma that is between Steve and Dave and store the data as
1, SteveDave, 25yrs, California
Easy, just read it character by character in a simple for loop, if it's comma, ignore it.
|
|
|
|
|
how to ignore it?
how can i print the data without comma?
|
|
|
|
|
Wait I re-read your question, I misunderstood. I got your question this time.
thathvamsi wrote: eg., 1, Steve,Dave, 25yrs, California
I want to strip or ignore the comma that is between Steve and Dave and store the data as
1, SteveDave, 25yrs, California
You can see if the next character is space, if not, then it's in the datafield.
|
|
|
|
|
I dont understand. sorry.
I have a group of data fields. each data field is separated by comma but the data itself shouldnt have a comma in it. ie., for eg., St,eve, David, Ross
I want to print just Steve, David, Ross by ignoring only that comma that is between 't' and 'e' . i need the other commas to separate the datafields.
how do i do it?
if u can showe some code snippet, thats great.
|
|
|
|
|
thathvamsi wrote: I have a group of data fields. each data field is separated by comma but the data itself shouldnt have a comma in it. ie., for eg., St,eve, David, Ross
Okay, suppose you have a txt file called data.txt, where the content: St,eve, David
The following code will print Steve David
modify the code a bit yourself to add comma in the end result. Hope that helps.
<br />
#include < stdio.h ><br />
<br />
int main(int argc, char *argv[])<br />
{<br />
FILE *fp = NULL;<br />
char buffer[20] = { 0 };<br />
char ch = 0;<br />
int i = 0;<br />
<br />
fp = fopen("data.txt", "r");<br />
<br />
for (i = 0; (i < 20) && ((ch = getc(fp)) != EOF) && (ch != '\n'); i++)<br />
{<br />
if (ch != ',')<br />
buffer[i] = (char) ch;<br />
else<br />
i--;<br />
}<br />
<br />
buffer[i] = '\0';<br />
printf( "%s\n", buffer);<br />
<br />
fclose(fp);<br />
<br />
return 0;<br />
<br />
}<br />
|
|
|
|
|
thanks.
how do i do it if the contents are stored in an array of counted byte strings instead of a file.
eg., row[0]=Steve
row[1] =david
row[3] = ross
|
|
|
|
|
The requirement was to save to a file, not read from it.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hope I understood your question
if you want to delete comma of you can use CString::Find for get commas and then remove their of your string with CString::Delete.
|
|
|
|
|
WhiteSky wrote: Hope I understood your question
I think he is asking how to parse a file that contains comma and want to ignore them when parsing.
|
|
|
|