15,616,232 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 Python questions
View Javascript questions
View C++ questions
View Java 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 Michael Haephrati (Top 200 by date)
Michael Haephrati
24-Jan-23 14:12pm
View
The problem was due to memory corruption caused by another function called just before, so I will delete this question.
Michael Haephrati
24-Jan-23 12:48pm
View
This is a very odd problem. I need to compose a minimal code sample which can reproduce the problem.
Michael Haephrati
24-Jan-23 11:51am
View
What I get is
Exception thrown: read access violation.
_Val was 0x9.
Michael Haephrati
5-Jan-23 7:59am
View
The OP specifically asked: "Write a program to calculate fun(100)", however I updated my solution. Thanks
Michael Haephrati
5-Jan-23 7:59am
View
Deleted
The OP specifically asked: "Write a program to calculate fun(100)", however I updated my solution. Thanks
Michael Haephrati
5-Jan-23 7:53am
View
Deleted
You can add
if (n < 0)
{
// Handle negative input here
return 0;
}
Michael Haephrati
25-Sep-22 13:02pm
View
Can you share your similar solution?
Michael Haephrati
25-Sep-22 9:50am
View
Here is an interesting solution https://stackoverflow.com/a/67535631/1592639
Michael Haephrati
5-Sep-22 15:50pm
View
Will the path include the "\" at the end?
Michael Haephrati
9-Aug-22 11:01am
View
Try opening the file in ios::binary mode.
Michael Haephrati
9-Aug-22 9:59am
View
There is nothing "serial" in this code. SG cards are read through the USB port. Serial ports were used 20 years ago. "Serialize" and "Serial" are two different things. There is no way you can get help without adding more information. 'SD_Handle " definition is missing.
Michael Haephrati
4-Jan-22 8:21am
View
It solved issues in the past, especially when CString was used as part of a non MFC project. Some CString member functions as slightly different between the MFC version and the ATL one, so when ATL is used, such conflicts are avoided.
Michael Haephrati
1-Nov-21 8:25am
View
What was the actual solution for getting the line as UNICODE?
Michael Haephrati
15-Oct-21 7:05am
View
Great answer! That worked. Got my 5 stars.
Michael Haephrati
15-Oct-21 7:03am
View
This solution doesn't seem to work
Michael Haephrati
23-May-21 13:12pm
View
That worked!
Michael Haephrati
20-Jan-21 12:11pm
View
The link doesn't work
Michael Haephrati
9-Nov-20 11:26am
View
I see that now (as a comment), but I am answering questions for the benefit of the entire community. I am not assisting the OP, especially since oddly enough, he is asking a coding question having no source code...
Michael Haephrati
16-Oct-20 12:16pm
View
What is 'SmtpMail'?
Something is missing in your code
Michael Haephrati
10-Sep-20 14:12pm
View
Adding controls is easy. Here is a better example: http://www.equestionanswers.com/vcpp/file-open-dialog.php. However, adding a Context Menu and hooking the Shell Extension options is tricky.
Michael Haephrati
10-Sep-20 7:49am
View
Rick, if you happen to find some code snippet for hooking File Open dialog box, please let me know.
Michael Haephrati
10-Sep-20 7:14am
View
DlgDirList - that's a good idea!
Michael Haephrati
27-Jun-20 18:33pm
View
So my code https://www.codeproject.com/Articles/3135812/Creating-a-Console-Based-Window-for-Debugging won't work even from a Dialog Box application with several threads?
Michael Haephrati
27-Jun-20 15:05pm
View
Dave, yes. That's my idea but had it been a Win32 c++ program, I would have been able to add my own Console window for each thread. You can even add a Console window to a Dialog based application. I don't know the answer when it comes to c#.
Michael Haephrati
16-Jun-20 15:55pm
View
Please elaborate and give an example
Michael Haephrati
26-May-20 13:33pm
View
@JMatthews Checked your solution and it works!
Michael Haephrati
18-May-20 12:34pm
View
The article mentioned in this solution contains the following statement: "Loading an image from a resource is disabled due to problems recognizing it correctly as an image", and the question happens to be about that exact disabled feature.
Michael Haephrati
18-May-20 12:31pm
View
Again, being a member of the CP community since 2003, I hold an opinion in which any question / article / answer are valid as long as they refer to a topic is relevant today. If you show me a recent answer to an old question about Windows 95, I would agree, but this question is about an ability used today hence my comment. To be more specific, I have noticed that the article mentioned https://www.codeproject.com/Articles/24969/An-MFC-picture-control-to-dynamically-show-picture, could have been relevant today, however it contain the following statement: "Loading an image from a resource is disabled due to problems recognizing it correctly as an image", and the question happens to be about that exact disabled feature.
Michael Haephrati
18-May-20 5:44am
View
Nope, it never worked and had it worked back in 2012, it would have worked today. There is a comment by the author saying it doesn't work. Coders come here to find answers and it doesn't mater if a good answer is from 2012.
Michael Haephrati
16-May-20 13:35pm
View
This link doesn't work
Michael Haephrati
16-May-20 13:33pm
View
I checked solution 2 and one of the most important parts (LoadFromResource) doesn't work, so this isn't a good solution for loading an image from a resource.
Michael Haephrati
16-May-20 13:32pm
View
Please explain how your function should be called / used. Its not enough to post a function as is.
Michael Haephrati
6-Apr-20 17:29pm
View
I entirely agree with what you wrote but you should have placed it as a comment. This is not an answer
Michael Haephrati
4-Apr-20 17:41pm
View
Check this answer https://stackoverflow.com/questions/10024796/c-virtual-functions-but-no-virtual-destructors
Michael Haephrati
6-Dec-19 10:13am
View
Thanks Dave.
Michael Haephrati
5-Dec-19 13:57pm
View
Right now, because of the scenarios you list here, SHGetKnownFolderPath() will fail and even cause a crash in applications used for both Desktop applications and Windows Service (for example, a Static library used by both types). My ideal answer would be a wraparound function that will call SHGetKnownFolderPath() and if possible return the correct path, let's say when a Windows Service is running, and there is one user logged in), and if not, return nullptr, or similar...
Michael Haephrati
2-Nov-19 10:32am
View
Found it here: https://docs.w3cub.com/cpp/types/is_empty/
#include <iostream>
#include <type_traits>
struct A {};
struct B {
int m;
};
struct C {
static int m;
};
struct D {
virtual ~D();
};
union E {};
struct F {
[[no_unique_address]] E e;
};
int main()
{
std::cout << std::boolalpha;
std::cout << "A " << std::is_empty
::value << '\n';
std::cout << "B " << std::is_empty
::value << '\n';
std::cout << "C " << std::is_empty<c>::value << '\n';
std::cout << "D " << std::is_empty<d>::value << '\n';
std::cout << "E " << std::is_empty<e>::value << '\n';
std::cout << "F " << std::is_empty<f>::value << '\n'; // the result is ABI-dependent
}
Michael Haephrati
20-Oct-19 9:29am
View
Excellent answer. You got my 5 stars!
Michael Haephrati
8-Oct-19 14:53pm
View
Deleted
and yet your vote still stands... :)
Michael Haephrati
8-Oct-19 14:47pm
View
I did reply but deleted my reply. Never mind…
I accept your criticism about pointing to another site (let alone ONLY pointing to another site with nothing more than a link…) - that's my bad! I hold an opinion about answering old questions and I expressed it many times. In my opinion, while many old questions may be irrelevant, (and in such case, maybe should be deleted), as long as a question is relevant (meaning, if someone had asked it today, you wouldn't see anything wrong with it), there is no reason not to answer it. Answering an old question is not against any rule and shouldn't be.
Michael Haephrati
8-Oct-19 13:59pm
View
Deleted
You should know by now that it doesn't matter when was the question posted as long as it is relevant (and if it isn't, it should be deleted).
Michael Haephrati
16-Aug-19 7:31am
View
I agree that when an external program like calc.exe is started by CMD, we need to externally locate the process ID of the new process (calc.exe) and monitor it
Michael Haephrati
15-Aug-19 13:40pm
View
Can you be more specific? The linked example won't help as long as I wish to check the status of the process periodically
Michael Haephrati
15-Aug-19 11:08am
View
In fact, I need to monitor a process that was invoked by CMD. There must be a way to do so. WaitForSingleObject will require a separate thread otherwise I won't be able to periodically check the status, like I do now, with the WM_TIMER event.
Michael Haephrati
3-Aug-19 6:17am
View
This is NOT a question
Michael Haephrati
2-Aug-19 5:02am
View
Basically, what I did is to use the Microsoft default Dialog based project source code, and that's how the source code looks like when you create a new MFC Dialog based project.
Michael Haephrati
1-Aug-19 15:50pm
View
The question isn't clear at all.
SELECT * FROM diamond_tbl WHERE ...
is supposed to fetch multiple rows, not a single row.
Michael Haephrati
11-Jul-19 9:54am
View
The member has been removed. This question should be removed as well. This isn't a question. Its an assignment.
Michael Haephrati
10-Jul-19 9:52am
View
Try this solution from : https://stackoverflow.com/questions/13890021/mysql-workbench-error-opening-eer
Just close and reopen the application.
Michael Haephrati
7-Jun-19 6:54am
View
I would be happy to access your answer if you go over the question again. Look at the source code from WTSEnumerateSessions() and down. The question is about not being able to find the first logged in user and instead finding only the "SYSTEM" token, which leads to launching a desktop client (with UI) as "SYSTEM", which is bad, as you rightly say, but the purpose is to launch the desktop client application to the logged in user, and when that is properly done, the UI is shown. I have managed to do so on Windows 10.
Michael Haephrati
7-Jun-19 6:50am
View
This isn't a correct answer. No one claimed Windows services have or should have any UI. That would be impossible as services run on session 0, which is also known as "user SYSTEM". The question is about the recommended method of invoking a Desktop process by calling CreateProcessAsUser() which fails only on Server 2012 (please don't mix between "service" and "server").
Michael Haephrati
7-Jun-19 6:48am
View
This is a technical question. Not a request for consultancy. We prefer to avoid using .NET in Desktop and core Server applications and use pure Win32 API. Dave's answer is not an answer but more like a comment. I addressed this comment. To be more specific, when you run any executable on Windows Server 2012 and this executable launches another executable, no UI will be shown. Further, following Microsoft's guidelines, using CreateProcessAsUser, for some reason the only token found, is of the special "SYSTEM" user which causes this problem.
Michael Haephrati
4-Jun-19 7:56am
View
My question isn't about finding a workaround for Services, as they are now isolated, but about a phenomenon with Windows Server 2012 that EVEN the child Win32 program, doesn't show any UI.
I am aware of the changes but my question comes after these changes were made. The change you are referring to is this: https://www.msigeek.com/1521/appcompat-series-session-0-isolation-and-secure-desktop.
Since this change, Windows services can't have any interaction with the user, and therefor need to invoke a client process per each logged in user (that answers your question about a user not logged in), and my question is about that. It works perfectly on Windows Desktop (i.e. 10), but not on Windows Server 2012.
You wrote: "The proper way to do it would be you have a small user app that runs when the user logs in and it talks to the service via an IPC channel, like named pipes. When the service has to launch an app, it just tells the small application to do it for the service. Launching an app from there is super easy and will always be done as the user that's logged in.", well my user app works perfectly alongside with the Service on Windows 10, but not on Windows Server 2012.
Michael Haephrati
31-May-19 6:38am
View
SOAP Agent is a commercial product that comes without its source code, and the binary files cost $2000+. gSOAP can be used for free unless its for a commercial product, in such case, the license comes with a price.
Michael Haephrati
30-May-19 7:21am
View
That's in c#. Not c++
Michael Haephrati
18-May-19 12:41pm
View
Excellent answer
Michael Haephrati
18-May-19 12:39pm
View
Thanks. I appreciate it.
Michael Haephrati
18-May-19 10:17am
View
Files are sent one at a time and you are responsible on running over the contents of a path and sending each file separately.
Michael Haephrati
18-May-19 10:15am
View
Did you check the guidelines for connection strings? https://www.connectionstrings.com/mysql/
Michael Haephrati
18-May-19 9:37am
View
Try this https://www.askvg.com/how-to-add-remove-items-from-new-menu-in-windows/
Michael Haephrati
18-May-19 9:34am
View
I think you should call SetColorKey with the correct transparency
Michael Haephrati
18-May-19 9:30am
View
What is the value of frameSize when you get that error?
Michael Haephrati
18-May-19 9:27am
View
Please share the entire source code so we can help you
Michael Haephrati
13-May-19 6:43am
View
Sorry. My bad
Michael Haephrati
20-Apr-19 19:27pm
View
I don't work for him. I answer unanswered questions for the benefit of the entire community.
Michael Haephrati
13-Apr-19 22:35pm
View
You are welcome
Michael Haephrati
13-Apr-19 22:02pm
View
Unless this question is outdated and irrelevant to today's technologies (in such case, should be deleted), there is no reason why not to answer it. It is better appeared here with an answer than without one.
Michael Haephrati
13-Apr-19 22:01pm
View
I viewed unanswered questions with some filters (i.e. c++ / MFC/ Win32) and there were the first questions shown to me. Why are they shown on top of the list? Ask Sean. I don't know. Should I avoid answering questions from 3 years ago? In my opinion - absolutely not! These are valid questions (if you think otherwise, request to delete them). They are not questions about outdated products or technologies and are still valid. When someone searches for an answer, he/she might find this question and the question is better published with an answer than be published without an answer because of its date. That's my opinion. Michael
Michael Haephrati
23-Jan-19 17:59pm
View
This isn't a programming question, and yet, codeproject is a programming oriented web site.
Michael Haephrati
23-Jan-19 17:58pm
View
This isn't a question and you haven't posted your source code. The "source code" is the question (which isn't really a question) repeated...
Michael Haephrati
7-Jan-19 11:32am
View
This is a bug reported to Microsoft. See: https://social.msdn.microsoft.com/Forums/en-US/fe8f0860-d705-4d55-8d17-7891ab0ffea2/msft-api-querychangesvirtualdisk-retruns-accessdenied-error-0x5?forum=servervirtualization
Michael Haephrati
27-Nov-18 10:01am
View
Hi OriginalGriff, sorry for the interruption but your (right) reply here would better be served as a comment and not as a solution... :)
Michael Haephrati
26-Aug-18 14:22pm
View
I use "sc query <service name>. After a hard reboot, the server appears installed but in a "STOP" state. If I type "sc start <service name>" everything is good. The problem is that it doesn't start.
There are many reports of this problem: https://superuser.com/questions/1026496/automatic-services-doesnt-start-automatically-after-windows-restart
Michael Haephrati
26-Aug-18 12:58pm
View
Thanks Dave, I will take a look.
Michael Haephrati
26-Aug-18 10:57am
View
I have found that if I install a driver, it always start regardless of how the PC was turned off. As for the service, it always start after a soft reboot so I think it is more of a problem with how Windows proceeds after a hard reboot.
Michael Haephrati
26-Aug-18 10:52am
View
Dave, I usually don't check when a question has been raised because if it is not relevant, you should ask for it to be deleted. If the question is here, then there is a place to answer it even after 20 years. About ActiveX, you are right. However, my answer is (or could be) generic for people looking for ways to create a .cab file. Unfortunately, the need to create these old files (.cab) is still valid. Microsoft still requires it for setup.exe applications or drivers. So I was just trying to share my knowledge about the .cab files ignoring the outdated ActiveX mentioned in the question.
Michael Haephrati
26-Aug-18 10:09am
View
Your comment is good for almost any question about a Microsoft product, so what's your point? if I find the answer I will post it here.
Michael Haephrati
26-Aug-18 5:14am
View
Thanks for your kind comments, guys. Sure I will elaborate. It's 5:00 AM now! Later on will do.
Michael Haephrati
13-Aug-18 13:57pm
View
The service perfectly starts after installation and after a soft reboot, but not after a hard reboot
Michael Haephrati
15-Jun-18 7:26am
View
What solved the problem was removing this line
ATLENSURE_SUCCEEDED(hr);
Michael Haephrati
15-Jun-18 7:22am
View
I can't get an error code because when I run the executable on any Windows desktop OS, it never fails, however when I run it on a server, it crashes and since I don't have any IDE installed I can't get the error code.
Michael Haephrati
11-Jun-18 8:10am
View
HRESULT hr = ::CoInitializeSecurity(
NULL,
-1,
NULL,
NULL,
RPC_C_AUTHN_LEVEL_DEFAULT,
RPC_C_IMP_LEVEL_IMPERSONATE,
NULL,
EOAC_NONE,
NULL);
ATLENSURE_SUCCEEDED(hr);
Michael Haephrati
25-Apr-18 6:29am
View
There is http://winapi.freetechsecrets.com/win32/WIN32WMCUT.htm
Michael Haephrati
23-Apr-18 15:50pm
View
This may be a different limitations but let's say you develop App1 and a user running App2 is cutting text and pasting it to the same app (App2). There are ways to capture this text but I wonder how can one determine whether it was a Copy or a Cut...
Michael Haephrati
23-Apr-18 15:38pm
View
I meant some sort of "global hooking" to capture the Copy or Cut events
Michael Haephrati
23-Apr-18 14:39pm
View
You got my 5 stars! I wonder if there is a creative solution to capture the CUT or COPY actions
Michael Haephrati
21-Jan-18 13:11pm
View
Jochen, please publish a code snippet with your solution. Doesn't have to be a full project but just the part that was discussed here, but as a full block of code (if you may). Thanks!
Michael Haephrati
16-Jan-18 17:21pm
View
I want to mark your answer as accepted. I still don't understand the last 2 paragraphs in your previous comment.
The hval() function returns the content of a header field where the version with two arguments returns only the content of the passed sub part.
That means that c.hval("Content-Type","boundary") returns the boundary string which is then passed to the parser to split the body into the boundary separated portions.
Could you show me how to add that part to my code?
Michael Haephrati
16-Jan-18 5:30am
View
It appeared first in my search (due to a bug), however I see nothing wrong about answering wrong questions (I already explained why - if tomorrow someone need something similar he will find the answer). If you think a question shouldn't be here, delete it. I only ignore questions that are irrelevant for today's technology (like, Windows XP, etc. ). That is not the case. The question and my answer are both relevant
Michael Haephrati
15-Jan-18 13:34pm
View
I followed your comments and updated the code in my question.
I still need your help implementing this:
"The hval() function returns the content of a header field where the version with two arguments returns only the content of the passed sub part.
That means that c.hval("Content-Type","boundary") returns the boundary string which is then passed to the parser to split the body into the boundary separated portions."
Not exactly understand what you mean...
Michael Haephrati
12-Jan-18 18:13pm
View
Yes, I agree. I am certainly not looking for old questions and there seems to be a bug I reported. I will check the date of questions before I answer them.
Michael Haephrati
12-Jan-18 17:29pm
View
Thank you for the warning... There is nothing wrong with answering old questions. If you think these questions shouldn't be there, delete them.
Michael Haephrati
12-Jan-18 17:15pm
View
If I find them interesting then yes!
Michael Haephrati
12-Jan-18 14:37pm
View
... and yet I got it in the first place. I definitely wasn't looking for old questions
Michael Haephrati
12-Jan-18 14:30pm
View
Richard, I reported that as a bug https://www.codeproject.com/suggestions.aspx?msg=5475847#xx5475847xx.
This questions appeared on the top of my list!
Please see my screenshot
2018-01-12__7_.png (549.9 KB)
As you can see, this question appears on top of my list and the only filters I can see are: "Active" (so this question is still marked as Active), and "UNICODE"
Michael Haephrati
12-Jan-18 13:41pm
View
I updated the question with my recent source code. This source code is from the point that szMailBody contains the email's raw data and using mimelib (https://www.codeproject.com/KB/cpp/1114232/mimelib.zip ) I am trying to extract from the raw data all elements (embedded images, HTML body, attachments, etc.) assuming that can be done statically, i.e. with no need for any interaction with the Gmail server.
Problem, I am expecting Contents to contain all elements but it doesn't.
Michael Haephrati
12-Jan-18 10:53am
View
Ok. I understand. I will try to pack my code into something that I can just publish here
Michael Haephrati
12-Jan-18 10:52am
View
I updated the question with my recent source code. This source code is from the point that szMailBody contains the email's raw data and using mimelib (https://www.codeproject.com/KB/cpp/1114232/mimelib.zip ) I am trying to extract from the raw data all elements (embedded images, HTML body, attachments, etc.) assuming that can be done statically, i.e. with no need for any interaction with the Gmail server.
Problem, I am expecting Contents to contain all elements but it doesn't.
Michael Haephrati
12-Jan-18 8:47am
View
Just to explain further, when I select "Unanswered questions" or search for questions (for example, in c/ c++) I get to this and other questions regardless of their date. If this is a conceptual bug, it should be changed. I was just trying to help...
Michael Haephrati
12-Jan-18 8:44am
View
Please post an answer to your own question. It would be useful to others facing a similar problem.
Michael Haephrati
12-Jan-18 8:43am
View
Go for it! such 3rd party libraries cover too much (193 files) while a solution to this specific issue (parsing gmail raw data) and only it, doesn't exists and can fit few files if you create a minimal solution.
Michael Haephrati
12-Jan-18 8:18am
View
Can you share here (as an answer) a working example of doing so? Saving the buffer into a file and loading it, isn't vital for the purpose of explanation. Just going over this buffer and parsing it, whilst showing that indeed, as I assumed, all the necessary information will be encapsulated within the raw data.The expected answer would be source code pasted here. It doesn't have to be a complete project but can surely demonstrate how key elements are extracted (for example an embedded image within the email's body, or an attachment).
Michael Haephrati
12-Jan-18 7:03am
View
The definition is here https://www.electrictoolbox.com/gmail-view-raw-email-message/
As I see it, at the point that you have the full raw data, you don't need any interaction with the Gmail servers and can do it offline. All the information is already in the raw data. I guess we are talking about the 2nd task. Not the 1st one.
Michael Haephrati
12-Jan-18 7:01am
View
Is this your solution??? the question is how can such raw data be converted to the email's ingredients, such as inline photos, attachments, etc.
Michael Haephrati
12-Jan-18 5:15am
View
Thanks for the tip. I didn't see any indication this question is inactive. I do hope my answer will serve others who may be looking for the same issue...
Michael Haephrati
12-Jan-18 5:10am
View
Its not about a format but about a practical way to convert Gmail raw data to its indigents. That is what my question is about. You wrote about interactive protocols to communicate with the Gmail server, but I think, with the raw data, one should be able to convert this data to the contents of an email without such interaction, for example, while being offline. Is that so?
Michael Haephrati
12-Jan-18 5:08am
View
Apparently there is no expiration date to questions and when I looked for unanswered questions, I got here...
Michael Haephrati
11-Jan-18 15:35pm
View
I am sure 7 good years are now to come :)
Michael Haephrati
11-Jan-18 14:09pm
View
go to https://www.codeproject.com/suggestions.aspx
Michael Haephrati
11-Jan-18 13:51pm
View
Jochen, I have accepted your answer but now wish to reject it (sorry) so others will submit answers which may be hopefully more focused in this specific type of data (Gmail raw data). There might be libraries / code snippets for this specific type.
Michael Haephrati
11-Jan-18 12:44pm
View
There is nothing wrong with that. The purpose of the Q&A is to publish questions, as long as they aren't already published, for the benefit of the entire community. Next time someone will look for this question he will find it and even though I published my own solution, I didn't mark the question is solved and awaiting other solutions (maybe better than mine).
Michael Haephrati
9-Jan-18 13:41pm
View
Thanks for your help. The author hasn't responded and indeed his code doesn't explain much.
After changing the code to
vector<mimelib::content> Contents;
MIMELIB::ParseMultipleContent2(Body,Body.GetLength(), a1.c_str(), Contents);
I still get an empty vecrtor
Michael Haephrati
9-Jan-18 9:58am
View
Please note that there is a purpose for the "What I have tried" section. Please add there what you have done so far to solve this problem. Remember that the purpose of the Q&A is not only to get you an answer but to allow others to find this answer when they have a similar problem.
Michael Haephrati
9-Jan-18 8:39am
View
I added this code
vector<mimelib::content> Contents;
MIMELIB::ParseMultipleContent2(Body,strlen(a1.c_str()), a1.c_str(), Contents);
// Body mail parts are now in Contents
// Check type with Contents[ndx].hval("Content-type")
// Use Contents[ndx].Decode() to get a byte array with decoded data
// like binary for binary attachments or usually UTF-8 for text / HTML
int i;
for (i = 0; i < Contents.size(); i++)
However it doesn't get into the loop, like Contents is empty..
Michael Haephrati
9-Jan-18 8:33am
View
Can you give me an example of how will an attachment be encoded and how to extract it?
Michael Haephrati
9-Jan-18 8:32am
View
Thanks. You should use ParseMultipleContent2() not ParseMultipleContent() which is commented in the source code... Correct?
Michael Haephrati
9-Jan-18 7:45am
View
Deleted
I did that but I am not sure how to use your code to parse the email. I don't need the plain text of the email. I need all attributes (sender, date, subject), along with the body (HTML or richtext) and any attachment.
Updated text file: https://www.dropbox.com/s/9oxsu4esah1ytso/test.txt?dl=0
If possible please show me how to parse an email with your code.
Michael Haephrati
9-Jan-18 7:10am
View
Deleted
See here https://www.dropbox.com/s/fowopgw6tjo2n25/2018-01-09%20%282%29.png?dl=0
Value starts with:
"<title>Original Message<link rel=\"shortcut icon\" href=\"https://ssl.gstatic.com/ui/v1/icons/mail/images/favicon5.ico\" type=\"image/x-icon\"><div class=\"page-wrapper\"><div...
The .txt file I saved from the raw email is here:
https://www.dropbox.com/s/9oxsu4esah1ytso/test.txt?dl=0
Michael Haephrati
9-Jan-18 6:58am
View
If I save the data into a file, and name it test.html, it will be shown properly. Can I hire you privately to do such job?
Michael Haephrati
9-Jan-18 6:02am
View
Its not about a specific mail but in general and I am reading the emails directly from gmail.com. If you use gmail you can try with any gmail message and see.
Michael Haephrati
9-Jan-18 5:34am
View
Unfortunately the thread correspondence didn't solve my problem. So can you point to me of a source code example for parsing this format? (RFC 2822: Internet Message Format)
Michael Haephrati
22-Oct-17 8:06am
View
Deleted
What is "solutio"?
Michael Haephrati
21-Oct-17 14:58pm
View
I answered this question, but missed the "C" tag. Sorry about that
Michael Haephrati
21-Sep-17 15:50pm
View
That means it fails
Michael Haephrati
21-Sep-17 15:36pm
View
I shouldn't have used the term "nothing" but I meant that literally.
Michael Haephrati
21-Sep-17 14:42pm
View
Just so you know, MPEG is not open source and require a license from http://www.mpegla.com/main/programs/M2/Pages/Agreement.aspx . We got one several years ago. It is free unless you sell thousands copies of your software.
Michael Haephrati
14-Aug-17 6:53am
View
The link dosn't work
Michael Haephrati
13-Jun-17 7:09am
View
I think the ideal solution must allow these definitions within the source code with no need to play around the user's Registry keys
Michael Haephrati
10-Jun-17 10:35am
View
The question is so unclear in terms of its English that I had to read it 5 times and yet I don't understand it at all. In my answer I gave a generic explanation but I can't comment on your source code itself because it isn't clear, where does it start and where does it end. What didn't work and what did?
Michael Haephrati
4-Apr-17 7:10am
View
I don't want to execute it but to offer the user to download it after payment via PayPal, and to have this download with an additional command line arguments based on the PayPal token and PayerID.
Michael Haephrati
4-Apr-17 7:09am
View
I don't want the file to be automatically executed but as in any web site that offer software to be downloaded, I want that when the software IS downloaded by the user, and if the user chooses to open it, it will add command line arguments.
Michael Haephrati
30-Mar-17 10:48am
View
"If you are strictly limited to a lib and header file, you must store the data as binary arrays and provide helper functions to load them like resources as mentioned in the thread." - Yes. that's the solution I am looking for (the icon can be converted to a static array using bin2c), however the icon should then be available the same way a standard icon would be, so LoadIcon would work with this memory based icon
Michael Haephrati
30-Mar-17 10:09am
View
I read them but we wish to deploy 2 files: .lib and .h. These solutions require deploying the .rc file and having whoever uses our static library to link / include it as well.
Michael Haephrati
14-Mar-17 8:27am
View
The question is : how can a single program check if the OS used is Windows 10 (or greater), while such program can run on any earlier version of Windows as well.
Michael Haephrati
30-Jan-17 14:02pm
View
Not that I'm aware of
Michael Haephrati
30-Jan-17 8:06am
View
Yup, my bad. Since you know I am not fishing for rep point trust me I try to spend my spare time on bringing old questions, answers and articles up to date, otherwise there is no room from them here. None of the other answers included anything about databases - that's was my point (unless " //database call here " is some new database code I am not aware of...). Would you like me to delete my answer? Based on the other answers and the question being so old, I would vote to delete the entire question. CP is not a museum. If something isn't useful today, there is no point keeping it.
Done. I just marked the entire question to be deleted. Please do the same. There is no point having a question with this wording "store checkbox state in database" !? Hope you agree.
Michael Haephrati
29-Jan-17 15:08pm
View
What can I say? when you are right you are right. My solution is in c++ and I assume the "write to DB" part isn't the important part of the question (otherwise I would have asked 'which database'), and as for the question being old, that doesn't matter unless we start a new policy of closing old questions).
Michael Haephrati
21-Feb-16 13:46pm
View
That's why CPPSqlite3U is used. To wrap sqlite3 because of its limitations. The question is NOT about sqlite3 API but about CPPSqlite3U - the wrapper class.
Michael Haephrati
21-Feb-16 12:52pm
View
I looked at it but couldn't find an equivalent that accepts UNICODE strings
Michael Haephrati
21-Feb-16 9:54am
View
Where does it support Unicode?
Michael Haephrati
31-Jan-16 6:00am
View
Try now
Michael Haephrati
18-Aug-15 8:46am
View
Great solution!
Michael Haephrati
9-Aug-15 10:38am
View
If you want someone here to help you do the following. Run the x64 version. When it crashes, go to Debug -> Windows -> Call Stack and copy the stack so we know which modules / files causes the crash. We can't guess...
Michael Haephrati
12-Jul-15 16:39pm
View
I think that a file after downloaded will hold the date/time converted to the local timezone, however, while testing it, I noticed that URLDownloadToFile doesn't preserve the creation date of the downloaded file! Any ideas how to get the creation date? The date I get is the date/time of the download.
Michael Haephrati
12-Jul-15 10:04am
View
To be more specific, I have a software update on a server in one country, and a client running in another country. I want to know which version is newer? the one on the server or the one running at the client.
Michael Haephrati
12-Jul-15 9:23am
View
Correct but I have another CTime I need to convert. I check a file's date and time and need to convert the date/time to GMT, keeping the result as CTime as well...
Michael Haephrati
12-Jul-15 8:50am
View
Look like your answer works. After this adjustment (which is due to difference time zone in server and in client) I would like to adjust the result again to GMT. How do I do that?
Michael Haephrati
15-Jun-15 8:10am
View
And the alternative is start with a IF and then I can use the VALUES?
Michael Haephrati
15-Jun-15 7:59am
View
What about VALUES (NULL, 20150615050829, 2,'EEE','test','123') ?
Michael Haephrati
15-Jun-15 7:54am
View
See this answer
INSERT tblSoftwareTitles (SoftwareName, SoftwareSystemType)
SELECT @SoftwareName,@SoftwareType
WHERE NOT EXISTS
( SELECT 1
FROM tblSoftwareTitles
WHERE Softwarename = @SoftwareName
AND SoftwareSystemType = @Softwaretype
);
from
http://stackoverflow.com/questions/17991479/insert-values-where-not-exists
Michael Haephrati
15-Jun-15 7:50am
View
You can use WHERE if you use INSERT INTO. The error is "near "WHERE": syntax error"
Michael Haephrati
15-Jun-15 7:10am
View
near "WHERE": syntax error
Michael Haephrati
17-Mar-15 9:10am
View
Wouldn't that be a breach of the integrity of a commercial product, which makes it illegal? I don't think CodeProject is the place for such things.
Michael Haephrati
1-Feb-15 14:53pm
View
Your solution is good but I couldn't find that it 100% works. If you use outlook and uncheck the "Set as default mail client", and then check the registry, it leads to false positive results. Not really sure..
Michael Haephrati
13-Jan-15 5:26am
View
"read only" is a matter of the file's (Excel file's for that matter) attriutes
Michael Haephrati
9-Jan-15 17:00pm
View
It is advicedd to use wcscpy_s instead of wcscpy while your solution is using wcscpy
Michael Haephrati
6-Jul-14 16:40pm
View
Deleted
How about this?
http://msdn.microsoft.com/en-us/library/windows/apps/windows.storage.fileproperties.imageproperties
Michael Haephrati
6-Jul-14 16:38pm
View
Sergey, I just want to make sure I am clear. I am talking about one of the attributes Windows Explorer allows displaying. See: http://res1.windows.microsoft.com/resbox/en/windows%207/main/5877754d-48c2-47dd-8387-d53e419c622d_62.jpg So do I need the library you have mentioned (tons of code) just to get or set this attribute, while other attributes such as Last Access Date or Creation Date are a matter of a single line of code?
Further, I have checked and found another file format that has this attribute. NEF. I guess all photo formats support that attribute.
Michael Haephrati
6-Jul-14 16:20pm
View
Thank you Sergey
Michael Haephrati
6-Jul-14 14:22pm
View
Well, The attribute DateTaken doesn't appear always, like "last access date" and "creation date" but only for photos. I am talking about .JPG files but maybe other formats as well.
Michael Haephrati
6-Jul-14 14:21pm
View
Yes. I found this:
PropertyTagDateTime
Date and time the image was created.
Tag 0x0132
Type PropertyTagTypeASCII
Count 20
Not sure it is the correct one. but in any case, I think my question can be useful if fully answered with some code sample to save time to others in the future...
Michael Haephrati
29-Jun-14 15:59pm
View
The question is tagged as vb.net but looks like c++
Michael Haephrati
29-Jun-14 15:16pm
View
My guess is that your assignment is to go over 2 files:
1. Orders (customer details, order date, package selected)
2. Packages (package UID, package name, package price, etc.
and then generate an invoice from each order...
Michael Haephrati
13-Jun-14 10:51am
View
Reason for my vote of 1 \n Not clear.
Michael Haephrati
4-Oct-13 17:21pm
View
Do you mean auto start?
Michael Haephrati
1-Oct-13 17:43pm
View
You are wrong. The USB GUID is brought here just as an example but you can replace it with any other valid GUID.
Michael Haephrati
22-Sep-13 15:17pm
View
Reason for my vote of 5 \n Great
Michael Haephrati
22-Sep-13 6:55am
View
Again, I am not trying to compose a solution but querying why an existing solution doesn't work. If you haven't checked the source code included in the question, I don't see much point of anyone trying to help here. If posting a dropbox link is not suitable, I guess we need a better way for attaching large amount of code.
Michael Haephrati
22-Sep-13 6:54am
View
I wrote to the author but never got a reply...
Michael Haephrati
22-Sep-13 6:52am
View
The idea is to be able to get the full path of the library before it was statically linked to the executable. I was trying to see if it is possible to add a resource to a static library (which technically IS possible), which is why I posted this question.
Michael Haephrati
21-Sep-13 17:08pm
View
I didn't get to the point I tried my own DLL, just tested a well known DLL (EasyHook). So I would suggest that you check first, maybe I made a stupid mistake at the implementation stage...
Michael Haephrati
21-Sep-13 16:54pm
View
That might be true, but you can locate a path of a DLL for example
Michael Haephrati
21-Sep-13 16:53pm
View
The question was about a certain library / SDK that does that (i.e. loads a DLL from memory). So your answer doesn't address the question. An answer would be based on the source code attached to my question, trying to figure out why it failed to load the DLL like it should.
Michael Haephrati
17-Sep-13 16:59pm
View
Reason for my vote of 5 \n Very interesting
Michael Haephrati
23-Aug-13 18:37pm
View
It says "Window 32"
Michael Haephrati
15-Aug-13 14:13pm
View
Reason for my vote of 5 \n See also
http://www.codeproject.com/Articles/319181/Haephrati-Searching-for-a-reliable-Hardware-ID
Michael Haephrati
13-Aug-13 11:45am
View
Well
Error: identifier "hResLoad" is undefined
-> Define it
#define MAKEINTRESOURCE ;
Change to
#define MAKEINTRESOURCE
Error expected an expression
Error: identifier "HL" is undefined
-> Define it
#define RT_ICON MAKEINTRESOURCE(3)
Error: identifier "lpResLock" is undefined
-> Define it
Error: return value type does not match the function type
and so on...
Michael Haephrati
13-Aug-13 3:32am
View
HGLOBAL hRes; // handle to loaded resource
HMODULE hExe; // handle to existing .EXE file
HANDLE hUpdateRes; // update resource handle
BOOL result;
Michael Haephrati
31-Jul-13 15:47pm
View
Reason for my vote of 5 \n How come you use a static buffer with no dynamic memory allocation and yet you call LocalFree at the end of the function?
Michael Haephrati
1-Jul-13 12:14pm
View
Please indent your source code... What error are you receiving?
Michael Haephrati
1-Jul-13 12:08pm
View
You probably didn't put things back to normal after accesing the database. Please add the source code so we can help you. We can't help you without the source code.
Michael Haephrati
21-Apr-13 16:51pm
View
Correct
Michael Haephrati
21-Apr-13 15:26pm
View
I have done that, and the first time the variable is mentioned, is at the end, with the same error message:
unresolved external symbol __imp_XXX (where XXX is the variable name).
Michael Haephrati
17-Mar-13 5:35am
View
If you are now not getting any compilation errors you can go ahead:
First, to convert DateTime into TimeSpan use this:
TimeSpan span1 = new TimeSpan(tm1.Now.Ticks),span2 = new TimeSpan(tm2.Now.Ticks),span3 = new TimeSpan(tm3.Now.Ticks);
To add them three, you need :
TimeSpan span1=tm11;
TimeSpan total = span1.Add(span2);
total=total.Add(span3);
Michael Haephrati
17-Mar-13 3:59am
View
I will het back to you later
Michael Haephrati
16-Mar-13 18:10pm
View
If you compile it, most c / c++ compilers can create Assembly code.
Michael Haephrati
16-Mar-13 18:09pm
View
I have deleted my solution, as your solution is perfect. Thanks!
Michael Haephrati
16-Mar-13 18:08pm
View
My initial idea was to update the entire item's selection index. So my solution is wrong, because of the '[0]' and yours will definitely work.
Michael Haephrati
16-Mar-13 17:38pm
View
No !!
Michael Haephrati
16-Mar-13 17:10pm
View
Let's keep in touch. My email is : haephrati@gmail.com. Send me a private email and we can continue from here.
Michael Haephrati
16-Mar-13 17:04pm
View
All your errors are because you use TimeSpan which I already told you not to use. Just use strings to get the query results. You will receive something like "00:09:02". Remove everything else. You should then get no compilation errors. Then, tell me what you need to do and we will go to the next step
Michael Haephrati
16-Mar-13 17:02pm
View
If you liked my answer please "accept"it and vote for it :) Now as for your questions, if you want to merge user inputs for all users, you can do it (and it is a great idea!) but it will not take place automatically. You need to do it programatically. So your application doesn't necessary have to run online this time. Just write a routine that periodically update the server, and the server will update all users.
Michael Haephrati
16-Mar-13 16:57pm
View
And the error messages you receive?
Michael Haephrati
16-Mar-13 16:48pm
View
Sure boss. I'll just get into it. By the way, today I have some personal errands. Can I leave 1 hour earlier?
Michael Haephrati
16-Mar-13 16:45pm
View
So it is saved as a string. Read the query result into a string argument and only then convert it or use it as is. Again, it would be best if you send full source code and exact error message
Michael Haephrati
16-Mar-13 16:41pm
View
Another advice: prepare a small code sample of your problem (place there only what is necessary). Submit here this code sample along with the exact error messages you receive (even a screenshot).
Michael Haephrati
16-Mar-13 16:39pm
View
Change this line
TimeSpan tm11 = tkk1.ExecuteScalar;
into
DateTime tm11 = tkk1.ExecuteScalar;
Read here about TimeSpan and DateTime and the difference between them
http://msdn.microsoft.com/en-us/library/system.timespan.aspx
Michael Haephrati
10-Mar-13 9:54am
View
Radio buttons, unlike Check Boxes, are mutual exclusive, meaning that in order to uncheck one Radio button, you need to check the other and vice versa. Further, you need to update the state of all controls. If you publish the entire project, it will be easier to help you
Michael Haephrati
9-Mar-13 17:40pm
View
Can I also make you a cup of coffee?
Michael Haephrati
9-Mar-13 14:24pm
View
You need to create a proper event loop, otherwise you will not get any signals when the end user presses your menu options. Please add your main routine and event loop
Show More