|
Fernando A. Gomez F. wrote: Both reside within a DLL. Then, from my exe,
Uh, oh! Are you maybe statically linking the CRT?
|
|
|
|
|
Hello,
in the project property pages it says it is linking to the "multi-threaded [debug]" runtime library, yet there is another option which says "multi-threaded [debug] DLL". Is that what you mean, that I should link to the latter one?
Man, I feel like a complete rookie...
-- modified at 1:23 Sunday 11th November, 2007
Solved , thanks a lot.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Fernando A. Gomez F. wrote: when ending Foo, the compiler (VC8) is throwing an assert.
What line of what file is asserting?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hello,
template<class _Ty,
class _Alloc> inline
void _Destroy_range(_Ty *_First, _Ty *_Last, _Alloc& _Al)
{
_Destroy_range(_First, _Last, _Al, _Ptr_cat(_First, _Last));
}
The bolded line, which is in the line 226 of the "xmemory" file.
Thanks.
Hope is the negation of reality - Raistlin Majere
|
|
|
|
|
Hi,
I want to connect two combo boxes, it means that when i choose a data from the list of first combo box, the list box or edit box of second combo box change according to first combo box.
my program is on C++ language(MFC).
(i use embedded software)
please help me.
thanks a lot
|
|
|
|
|
Handle ON_CBN_SELCHANGE on the first combo and populate the second combo in the handler.
|
|
|
|
|
Hi,
Thanks a lot for your answer, it works.
|
|
|
|
|
Hello guys!
I`m working with a file from which i read data. I don`t know its encoding (to be honest I`m not sure I know exactly what`s the difference between encodings), all I know it`s a simple .xml another application gets data from.
Its structure is like:
< var> value < /var>
each var on a line
Some vars have filepaths stored in them, like:
< path> filepath < /path>
I read this file line by line and process the data, copying into another .txt file only those filepaths.
I`ve seen that in the .xml I have HTML character sequences for some characters, and by this I mean that all & characters (from the physical path) are replaced with & # x 2 6 ; (without the spaces - the same thing happens in this field where I write this question)
The question is ... is there any simpler solution to translate these sequences into characters rather than write a function that searches for them and replaces them with the right special character (that is, some specification for when I read the file so that my string gets only the character and not all the characters composing the special character)
Specifically: gets only & rather than 6 characters compsosing it: &,#,x,2,6,;
Thanks for your time!
Shpid3r
|
|
|
|
|
Is there any particular reason why you are not using an XML parser to parse the XML file?
|
|
|
|
|
Oh my god,
I agree -- just use a darn XML parser. There's one I found here on codeproject which I think is fantastic -- TElemW[^]
It saves me all kinds o time.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<br />
Peter Weyzen<br />
Staff Engineer<br />
<A HREF="http://www.soonr.com">SoonR Inc -- PC Power delivered to your phone</A>
|
|
|
|
|
Thanks for the suggestions!
I have already wrote all the code to parse this xml file myself, except that unicode / multi-byte - ascii. Moreover, the .xml has a very simple structure, with only 4 tags... <start> <file> <files> <path> (and closing versions). So i really don`t need all the parsing logic (well, i didn`t even know that something like this exists)..
End of the line: at this moment integrating that program to suit my needs would be killing. All I need now would be to convert those sequences into their characters. As a last resort, I`d rather use a switch than studying how that thing works... Though in future projects i`ll remember it!
Any other ideas ?
|
|
|
|
|
There is to my knowledge no MFC etc function available to do this. But, hey, you effectively rolled your own parser! That means that you have to write all functions to deal with stuff that XML can throw at it. If you leave something out, you will sooner or later become a cropper. The writing of a function to convert the simple escapes you mentioned appears to me to be a relatively minor issue in the greater scheme of things you are taking on.
regards,
Bram van Kampen
|
|
|
|
|
shpid3r wrote: to be honest I`m not sure I know exactly what`s the difference between encodings
If your going to parse XML from a windows box and attempt to do something with the data, you will need to understand the differences between UTF-8, UTF-16, UCS-2, and code pages if your compiling for MBCS. There is no compromise on this if you want your parser to work and your results to display correctly, without corruption in your Visual C++ program.
Even from my little experience in XML processing, it is obvious based on your post that you are attempting to tackle a non-trivial subject with a trivial approach thats likely to end in frustration. Do yourself a favor and use an already existing and well supported XML parser. You will still likely need to understand encodings anyway, but it will save you a lot of headaches early on.
|
|
|
|
|
ON_COMMAND_RANGE(IDC_RELAY1, IDC_RELAY8, ChangePin)
hi there,
the Above code will call the function ChangePin() when checkbox's in the range IDC_RELAY1 to IDC_RELAY8 are changed, can anybody tell me what kind of message is sent when a user clicks one of the checkbox's?
i am trying to progmaticaly send the "BN_CLICKED" message to trigger the ChangePin function from my code without having to physicaly use the mouse to heck the checkbox.
thanks chris
|
|
|
|
|
try simply checking the checkbox programatically and see.
AFAIK that should automatically call the associated function.
good luck.
--------------------------------------------
Suggestion to the members:
Please prefix your main thread subject with [SOLVED] if it is solved.
thanks.
chandu.
|
|
|
|
|
i tried checking the checkbox,by setting its value to TRUE,and then Updating the dialog using UpdateData(false); sure enough the checkbox checked but it failed to call the ChangePin function.
any other idieas?
thanks
chris
|
|
|
|
|
You can always use SetCheck() to change the check state of the
checkbx then call ChangePin direcly, passing the id of the checkbox.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hello everyone,
I want to confirm that on a 32-bit machine,
1. compare the value of two byte to see whether they are equal or not;
2. compare the value of two integer (4-byte) to see whether they are equal or not.
(1) and (2) should have the same performance, right? I am using x86 32bit Windows machine to develop native unmanaged C++ application.
thanks in advance,
George
|
|
|
|
|
Depends a bit on allignment,and on the precise processor on the target machine, but the difference should be insignificant for most purposes.
regards
Bram van Kampen
|
|
|
|
|
Hi Bram,
I am interested to learn what do you mean alignment. Could you provide more information please?
regards,
George
|
|
|
|
|
Allignment
I thought this was a quite Basic, Simple and well understood topic, but I must admit, cannot find any articles about it. Must write a short one myself to fill this void. Watch this space, and I get something together soon.
Regards,
Bram van Kampen
|
|
|
|
|
Hi Bram van Kampen,
I am not saying that I do not understand what is memory alignment.
My question is I do not know why you mentioned memory alignment matters to the performance of equal comparison in my question. Could you provide more information please?
regards,
George
|
|
|
|
|
If the item being compared is less than the natural word size in the CPU, the item may need to be shifted before the comparison takes place. That takes more time than if the item falls on a natural word boundary.
Judy
|
|
|
|
|
Thanks Judy,
I do not know why if loading one byte, other than 4-bytes (32-bit), the system needs additional efforts to do alignment? For one byte, the system can load the continuous 4 bytes from memory which contains the one byte and could meet with 32-bit alignment requirement, and in this way, only one CPU cycle is needed, and no additional cycle is needed to do alignment for 4-byte (32-bit) data, right?
Please correct me if there are anything wrong with my statements above.
regards,
George
|
|
|
|
|
Read Bram's post again more carefully. The difference comes in if the item to be compared is not one byte long and is not stored on a 4-word boundary. If the item is 4 bytes long but is not aligned on the boundary, the CPU must do two fetches to get the item in its entirety before it can compare.
Judy
|
|
|
|