15,894,064 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Dan page (Top 53 by date)
Dan page
4-Jul-13 8:39am
View
nv3 One more thing. You write:
"And all that under the assumption that the binary format of the Blob object is really compatible to an array of SomeStructure"
Now that I read it this is *really* important right, otherwise members of the SomeStructure will not get correctly initialized (if the format of Blob does not reflect structure of SomeStructure)?? right?? Thanks.
Dan page
4-Jul-13 2:28am
View
Hi, yes, but if we forget efficiency for a moment - it works at least right. It seemed bit suspicious to me too initially, but now that I look at it I think it will work. The cast will seem to work and ptr++ will also move to the next SomeStruct element appropriately.
Dan page
3-Jul-13 10:49am
View
hi H.Brydon, what do you mean with "Go for it"? as I mentioned this is not my code, I am analyzing reading someone else's code; I might need to modify it at times though.
Dan page
3-Jul-13 10:31am
View
Hi, the data inside the Blob class I think is stored as: void * data; (so it may indeed contain contigious array of SomeStructure objects).
This is not my code.
Sometimes they use this keyword in data structures: __packed (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.dui0491c/CJAFJHJD.html) - maybe that is how they defeat issues with the padding?
thanks.
Dan page
2-Jul-13 17:04pm
View
Hi CPallini, thanks, just as I remember it was other way around, meaning in my example, say CustomStruct contains four elements first three int-s and one char. Then, OtherCustomStruct would contain just those first three int-s.
Dan page
2-Jul-13 9:20am
View
hi, thanks also actually there is another trick in the code. like: `memcpy(&obj,Variable[index].get_blob().data(sizeof(OtherCustomStruct )*i),sizeof(OtherCustomStruct ));` obj is again of type CustomStruct, however OtherCustomStruct is basically similar as CustomStruct just they differ on one element, OtherCustomStruct seems to be kind of subset of CustomStruct. And the copy is still working, seems it should be like that right?
Dan page
2-Jul-13 9:02am
View
ok, thanks
Dan page
26-Jun-13 2:53am
View
I don't mind, but which do you mean?
This: >>"convert all kinds of strings to array of bytes using UTF-8 Unicode encoding."?
Yes, but how? You mean use std:string with UTF-8? I am ok with it just could you explain bit more how/why that would work.
I am reading some links you gave me now.
Dan page
26-Jun-13 2:43am
View
like this?
ps. this is error2:
Error 2 error C2782: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &,std::basic_string<_Elem,_Traits,_Alloc> &)' : template parameter '_Elem' is ambiguous c:\users\documents\visual studio 2012\projects\consoleapplication3\consoleapplication3\consoleapplication3.cpp 34 1 ConsoleApplication3
some other parts of code I managed to modify. I get two or three other errors to but they are same as I posted above, and at same lines.
Dan page
26-Jun-13 2:23am
View
I posted errors above, below nav3's comment
Dan page
26-Jun-13 2:22am
View
This is one error:
- (from operator <<) Error 1 error C2679: binary '<<' : no operator found which takes a right-hand operand of type 'const std::string' (or there is no acceptable conversion)
this is second:
- Error 5 error C2780: 'std::basic_istream<_Elem,_Traits> &std::getline(std::basic_istream<_Elem,_Traits> &&,std::basic_string<_Elem,_Traits,_Alloc> &,const _Elem)' : expects 3 arguments - 2 provided
The above one is related to getline
Dan page
25-Jun-13 10:55am
View
Hi, thanks although I got familiar myself with Unicode and encodings already (more or less). e.g., Unicode stores characters in certain format, called codepoint -- UTF 8 for example is encoding then which indicates how Unicode should be interpreted. but I'll look at your links, seems unicode support with c++ isn't trivial
Dan page
25-Jun-13 10:52am
View
It's not easy to fix those issues, that's the problem ...
Dan page
25-Jun-13 10:36am
View
>>"First of all, you can mix wstring and string (why not, in principle?)"
Hi, because if I declare one of my wstrings above as a string, I get compilation errors.
>>"convert all kinds of strings to array of bytes using UTF-8 Unicode encoding. "
Can you explain a bit more details on this how? and also bit more information on the second part of your first paragraph.
Dan page
19-Jun-13 4:56am
View
I think the one I showed is just for "Short Hands" because I can't see how the code I showed, enforces int to be 32 bits for example?
Dan page
17-Jun-13 5:19am
View
hey, what is meant with that it's "GNU specific?"
Dan page
13-Jun-13 3:34am
View
I might verify it Once - which does not mean that will happen always, that is why I asked.
Dan page
10-Jun-13 4:19am
View
I see, ok, thanks
Dan page
5-Jun-13 10:01am
View
ok, just I didn't test any of the solutions yet (suggested ones)
Dan page
5-Jun-13 8:03am
View
why will rethrown exception be caught by line 8 exception? as nv3 pointed out and as it seems to make sense, my first code snippet and second one are not related, e.g., they are not stacked. Due to handlers etc.
Dan page
5-Jun-13 4:48am
View
Are you sure this will let my "FIRST" catch(...) block (e.g. line 8), catch this exception? Check nv3's comment too.
Dan page
5-Jun-13 4:35am
View
Hi nv3 thanks, I think this is the main problem: "When the user later selects a menu item and Item1Handler is being executed, you are no longer in that try / catch(...) block"
Dan page
5-Jun-13 4:11am
View
Hi, Peter, can you elaborate a bit more?
Dan page
23-May-13 8:33am
View
a, ok you mean just use? Window->get_text();
Dan page
23-May-13 8:24am
View
Sure just I wanted to format it a bit before I display it
Dan page
23-May-13 8:13am
View
no, it's not MFC
Dan page
23-May-13 8:13am
View
it's there to retrieve value of amount entered by user on display
Dan page
23-May-13 8:07am
View
Deleted
no, it's not MFC
Dan page
22-May-13 3:22am
View
hmmm. I see. Now, it seemed strange to me. Imagine there is a class Settings. Now inside the Settings.cpp I see a declaration: (just after includes) Settings _settings; Then elsewhere in another class I see _settings.someFun() - directly being used.
Dan page
21-May-13 2:15am
View
Hi Andreas. Thanks. But please note MyDataStructure - is a "struct" it is not a Class. What to do in this case then?
Dan page
19-May-13 14:39pm
View
Hi Sergey Alexandrovich Kryukov. Thanks. But I can't wait for the 1,2,3,4 stages. I need to get involved in doing this already now (what I posted). I can say that I have already average (maybe even above average) coding skills. What to say about the code I need to read. Just it is not documented. Some of its classes I understand relatively easily too. Some of them I still need to look at, just they use I think functions classes (maybe from some SDK) which I am not familiar with yet...
Dan page
19-May-13 14:31pm
View
print you mean put it on the paper?
Dan page
19-May-13 14:06pm
View
hi what do you mean with "print code pages?". No I can't debug it. As I mentioned the only way is possible to debug is to write to log files and then read those logs from the device.
Dan page
19-May-13 14:04pm
View
Hi thanks. Yes, but as I said I have access to the *source code* of the project, so why do I need to reverse engineer it?
Dan page
19-May-13 13:42pm
View
That's actually a problem: The code is written for an embedded device and you can't debug it. I think they just use logs for debugging.
Dan page
19-May-13 13:29pm
View
Deleted
That's actually a problem: The code is written for an embedded device and you can't debug it.
I think they just use logs for debugging.
Dan page
16-May-13 9:34am
View
yes, I 'll probably have unique names for each error (which also makes sense) and then return appropriate ones from different functions etc... thanks
Dan page
16-May-13 4:00am
View
what is the drawback of putting it outside the class?
Dan page
16-Apr-13 11:13am
View
Now I see output 13, I really don't know what was the problem last time. Maybe it was because I was running the program using Ctrl+F5? although I recompiled the source I remember. anyway it works now.
Dan page
16-Apr-13 7:40am
View
Yes but that way I may have to wait for the answer too long - and this question might not necessarily be specifically related to that article, that is why I posted it here.
Dan page
10-Apr-13 16:37pm
View
ok, so far i found this material which seems Ok: http://www.codeproject.com/Articles/14746/Multithreading-Tutorial
Dan page
8-Apr-13 8:11am
View
Hi, thanks, Yes I also found this link: http://msdn.microsoft.com/en-us/library/vstudio/60k1461a.aspx, which I guess answers that.
Dan page
3-Apr-13 12:42pm
View
Hy Brydon, I will try CppUnit - have some issues building Google test.
I am using Windows XP and Microsoft Visual Studio 10. Can you please tell me
- or maybe provide links - how to install/build/run Cppunit on my machine?
Thank you.
Dan page
1-Apr-13 10:04am
View
no :) check last comment of nv3 also.
ps. THis line: MyClass object2 = object1; will call the Copy Constructor.
Dan page
1-Apr-13 8:33am
View
Hi, meaning all the assumptions I had made in my comments (in the "code" section) in my initial post seem to be true.
Dan page
1-Apr-13 8:32am
View
No, I think that's not true :)
Dan page
1-Apr-13 8:24am
View
Hi, no not true in the first case object 2 does not exist so copy constructor should called.
Dan page
1-Apr-13 8:04am
View
Hi, thanks for your reply. What gets called in such a case? MyClass object2 = object1; I guess the copy constructor also?
Dan page
30-Mar-13 12:35pm
View
i meant a deep copy
Dan page
30-Mar-13 12:08pm
View
this is what I want to achieve(as mentioned also in my initial post): "Making a copy of object of my class and to use it in another thread must be safe"
Dan page
30-Mar-13 11:33am
View
Dear Matthew sorry, maybe I didn't highlight well enough: We don't want to achieve (1) actually - we may discard it, we just want to achieve (2).
Dan page
30-Mar-13 10:28am
View
hi Matthew thank you for an elaborate answer. My class has some get and also set methods, so anyone can read at any point in time. I could set locks (I use mutex btw) at the start of each Set function and unlock it at the end as you suggest (maybe do similar for Get-ers?). Just my confusion was, there are two situations it appears: (1) one to make some class thread safe in case many threads try to access the SAME object, and (2) make a copy of the instance of that class and usage of that copy in other thread should be safe. The (2)-nd issue is what I want to achieve and my problem was that I can not differentiate between the two, what do I need to do to achieve (2)? And why is it different from (1)??
Dan page
26-Mar-13 19:01pm
View
Hi, thanks. What happens in such case, imagine in the constructor of car I added
truck = new Truck();
But inside Truck class, I also have a member variable
Wheel *wheel;
- but I do not initialize it in the constructor of Truck (e.g., I don't do new and just assign a NULL to it for example).
wheel
in such a case will remain uninitialized right? e.g., no allocation will be done for it automatically..
Show More