|
you are correct. It works.
Thanks for the help.
It has been a great learning experience. thanks for your time.
|
|
|
|
|
You are welcome. I'm glad to be able to help you out.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
hey kakan,
iam trying to do the following which is the next stage in my code.
As you know, the data gets stored in a group of files. the files have to be called back or opened at a later stage to plot.
on selecting a checkbox, the default or the first file name (of say, 4 files) should be displayed in an edit bar. the edit bar goes active only on clicking the check box. the edit bar should be able to scroll through to find all the available files. the files are stored with .txt extension.
the file that gets selected gets plotted which is done by clicking another pushbutton "plot".
I cannot get the file names to be displayed in the edit bar. how do i do it?
Thanks in advance.
|
|
|
|
|
Hello again thathvamsi!
I'm sorry for the delay, but I have som work to do too...
I suggest you do like this (two alternatives).
1.
Show a normal file selection dialog and let the user select the file to plot.
When the user clicks the "OK" button, start plotting the file.
2.
Search for the interesting files and put their names in a listbox or combobox.
When the user double-clicks a text line, start plotting the selected file.
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
Hello again.
I came to think about a thing you might want to change.
Now, you are using the extension .txt for your files, and that's not the best extension to use, since .txt implies it's a text file.
And that's not true for a file filled with binary values.
I suggest you use another extension for your files, preferably something special for the plot data files, such as (for instance) .plt (for "plot") or .bin (for binary file).
If you let the user select file to plot, it will be easier to use a special extension. Then you can make a selection filter for that type of extension, and the user will only see the correct files. That will lessen the user mistakes, since the user has to select the correct file type.
Imagine what the plot would be like if the user selects an ordinary text file...
-- modified at 9:50 Friday 1st September, 2006
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
if u waana create a directory for ur file write purpose pls use the API CreateDirectory()
RinuRaj
|
|
|
|
|
I have been succesfull in reading data from a binary file using a console application, and using cout to view thedata, but for the life of me, I can't seem to figure out how to load the data into a listview...
f.read(reinterpret_cast<char*>(&Items),sizeof(int));
m_List.InsertItem(0, Items);
What must I do to get the "Items" data loaded into the listview?
Thanks
Jeff
|
|
|
|
|
Jumpin` Jeff wrote: m_List.InsertItem(0, Items);
this sets label for that item, Do you forgot to call SetItemText ?
|
|
|
|
|
I am under the impression that
m_List.InsertColumn(0, "Header Label", LVCFMT_LEFT, 120);
sets the header label, that
m_List.InsertItem(0, "Row");
inserts a new row, and that
m_List.SetItemText(nItem, 1, "Sub Item");
inserts a new sub item to the nItem row....
With my example above, if I change
m_List.InsertItem(0, Items);
to
m_List.InsertItem(0, "Hello!");
it will insert a new row "Hello!" so the issue really is getting the variable Items to convert to the proper format to display in the listview.
That is what I am asking.
In a console window, I can display the Items extracted from the file using the reinterpret_cast<char*>&Items with a simple
cout << Items <<endl;
items has="" no="" special="" formating.
yet="" when="" i="" attempt="" to="" use=""
m_list.insertitem(0,="" items);
i="" get="" nada!
when="" use
m_list.insertitem(0,="" "items");
i="" the="" text="" "items".
i="" simply="" want="" see="" what="" is="" contained="" in="" variable="" 'items',="" within="" listview.="" i've="" made="" listview="" work,="" but="" not="" with="" my="" variable.=""
i've="" following="" link="" as="" guide,="" it="" uses="" static="" also...="" need="" convert="" data="" from="" a="" binary="" file="" view="" list...
<a="" href="http://www.visualcomponentlibrary.com/visualc/listview/lvsdi1.htm">http://www.visualcomponentlibrary.com/visualc/listview/lvsdi1.htm[^]
Jeff
|
|
|
|
|
Jumpin` Jeff wrote: With my example above, if I change
m_List.InsertItem(0, Items);
to
m_List.InsertItem(0, "Hello!");
it will insert a new row "Hello!" so the issue really is getting the variable Items to convert to the proper format to display in the listview.
this form of call expects LPCTSTR as second parameter.
Can you tell datatype of Items .
If you are expecting either integer of string as Items , and use above call , then you need to call conversion function to convert int to string .
Jumpin` Jeff wrote: In a console window, I can display the Items extracted from the file using the reinterpret_cast&Items with a simple
cout << Items <<endl;< blockquote="">
Here << operator is overloaded to display standard data type.
Am I under stood correctly, what you want to say? If not can you be specific.
|
|
|
|
|
As indicated with f.read(reinterpret_cast(&Items),sizeof(int));
Items is indeed an int.
So what do you recommend for the conversion?
1. sprintf
2. stringstream
3. itoa
???
Thanks again.
|
|
|
|
|
Why dont you directly read it in char pointer; If you are using it for displaying purpose only.
Jumpin` Jeff wrote: So what do you recommend for the conversion?
1. sprintf
2. stringstream
3. itoa
I dont know how stringstream can be used. But if possible its better. Otherwise I would have gone with sprintf .
|
|
|
|
|
That's actually what I intend to do... I've been successful at using sprintf, so I think I'll continue to use it. Thanks!
|
|
|
|
|
|
Ok gurus and guruettes. I gotta one of them-there questions.
It was recently brought to my attention that one should not do much processing (or any at all for that matter) in DLLMain() (for DLLs of course) and I would like to know why, as I've been doing this for years without a problem.
So, to get things rolling, I'd like to start by quoting some of Mike Dimmick's words on the matter:
Mike Dimmick wrote: The problem is that the loader takes a process-wide lock just before entering DllMain. It also doesn't guarantee an order for calling different DLL's DllMain functions. That reduces the set of reliably callable functions to those that the loader will definitely have processed before calling your DllMain
I don't see how this could be an issue when each DLL in fact will link to any required libs they also need for each call.
[edit] Nevermind, this whitepaper[^] helped clear things up a lot. [/edit]
|
|
|
|
|
One of my program, renamed here as MyApp.exe, which is called by a win32 service using CreateProcess() is failing with exception. Here is the how stack look like in the Windbg from the *.mdmp file I got from the server it failed.
--
ChildEBP RetAddr Args to Child
00129f28 7c822124 77e6bad8 000000d0 00000000 ntdll!KiFastSystemCallRet
00129f2c 77e6bad8 000000d0 00000000 00129f70 ntdll!NtWaitForSingleObject+0xc
00129f9c 77e6ba42 000000d0 0001d4c0 00000000 kernel32!WaitForSingleObjectEx+0xac
00129fb0 6951163f 000000d0 0001d4c0 0012c060 kernel32!WaitForSingleObject+0x12
0012a018 69506136 0012e060 0012c060 00000078 faultrep!MyCallNamedPipe+0x15b
0012e474 69508b5c 0012f994 0012f09c ffffffff faultrep!StartManifestReport+0x1d5
0012f2c0 77e99a6b 0012f994 ffffffff c0000005 faultrep!ReportFault+0x3d2
0012f948 77bc3e74 0012f994 00000000 00000000 kernel32!UnhandledExceptionFilter+0x4b1
0012f968 00401a01 c0000005 0012f994 77bc6cd5 msvcrt!_XcptFilter+0x178
0012ffc0 77e523e5 00000000 00000000 7ffd9000 MyApp!mainCRTStartup+0x101
0012fff0 00000000 00401900 00000000 00000000 kernel32!BaseProcessStart+0x23
--
Is the stack corrupted? How come I don't see MyApp!main or any othre symbol from MyApp.exe on the stack? My release version of program is build with PDB. Is it possible that I'm using PDB build on different (newer) date. No change in the program has been made since it has been released. Thanks.
mdexch
|
|
|
|
|
As always when asking a question about an excpetion one needs to cite the type of the exception.
Steve
|
|
|
|
|
It is an access violation. Here is more detail from the dump.
--
(84c.850): Access violation - code c0000005 (first/second chance not available)
eax=00000000 ebx=80070000 ecx=00000418 edx=00000000 esi=000000d0 edi=00000000
eip=7c82ed54 esp=00129f2c ebp=00129f9c iopl=0 nv up ei ng nz ac pe cy
cs=001b ss=0023 ds=0023 es=0023 fs=003b gs=0000 efl=00000297
ntdll!KiFastSystemCallRet:
7c82ed54 c3 ret
--
mdexch
|
|
|
|
|
Hello,
I'm trying to download the html for the forum pages here on CP, so that I can pull out the messages and do something with them(i.e. sort, search, display, etc.)
When I use view source in I.E. the messages(the text i am typing now) are in the html, however, when i download the html using wininet the bodies of the posts are missing. Only the titles appear in the html ("Different html with wininet than I.E." in the case of my post).
Anyone have any clue as to why this would happen? Is there some extra part of the url that i need to enter into wininet to get the correct version of the html?
Thanks.
P.S. If this would be better placed in the Web Development forum let me know and i'll repost it there, thanks.
|
|
|
|
|
epicyeti wrote: P.S. If this would be better placed in the Web Development forum let me know and i'll repost it there, thanks.
You are right about that. What URL are you using to download the source?
|
|
|
|
|
My intention was to ignore this thread if it was in the wrong place, but since you asked a question ...
I'm using:
http:
for the soapbox.
|
|
|
|
|
It may be because of the user-agent header. What header are you sending?
Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. -Brian Kernighan
|
|
|
|
|
Currently it's just sending "NewDeveloper" as the user agent. This is probably a poor choice, but i thought it described what i was doing best. I am new to wininet and http, so i appologize for my naivity.
|
|
|
|
|
|
by writing a few commands into your C++ editor and compiling it into a working exe. The forum is here to help with problems you may be having. Perhaps if you showed us some of your attempts we may be able to point out where you have gone wrong.
|
|
|
|