Click here to Skip to main content
15,118,323 members

Comments by Leo Chapiro (Top 200 by date)

Leo Chapiro 2-Dec-19 9:21am View
Dude, we don't understand what you intend ...
Leo Chapiro 27-Nov-19 9:56am View
If you create a simple MicroService on the server side, your C# client can easily communicate over REST interface with it. I would write the MicroService in JAVA or JavaScript if you are familiar with this technique. But is is possible as well in C#.
Leo Chapiro 22-Nov-19 10:05am View
Try to debug your code row by row.
Leo Chapiro 20-Nov-19 7:31am View
Sorry to say it, but I have not understood what you are trying :(
Maybe you can remove not relevant for your question source code?
Also the question itself - can you try to rewrite it somewhere that it will be more clearer?
Leo Chapiro 1-Nov-19 6:25am View
Funny, seems to be a bug of CP: I have not seen any comments of you and other guys as I answered yesterday! It looks like a new question apart of old creation date which I haven't noted :)
Leo Chapiro 30-Oct-19 10:30am View
Sorry to say it, but your question does not make any sense. Can you try to explain your problem in other words? Also, you can not "debugging this problem", you can only debug your source code.
Leo Chapiro 17-Oct-19 10:48am View
Is it a separate solution or rather a comment to other solution?
Leo Chapiro 17-Oct-19 10:05am View
Dude, do you understand my question? Why do you keep on posting these strange SQL statements?
Leo Chapiro 17-Oct-19 9:49am View
You wrote: "I have this JSON document below" .
I don't see any JSON below but an SQL statement. So what do you mean by that? You do know what JSON format is?
Leo Chapiro 4-Oct-19 8:38am View
It can not work: pChildDlg->Create(IDCANCEL, this);
You need to create a new dialog first, the IDD_DIALOG_CHILD in my example is its ID. Take a look: Create a Modeless Dialog Box as Child Window
Leo Chapiro 4-Oct-19 7:25am View
I have updated, take a look (above).
Leo Chapiro 4-Oct-19 5:43am View
Yes, better as Karsten mentioned, you use the PostMessage.
Leo Chapiro 4-Oct-19 5:34am View
Richard, _T(*pstr) uses not a pointer but de-referenced it in contrast to _T(pstr) what you probably mean.
Leo Chapiro 5-Apr-19 4:21am View
Thank you, Richard! Nice idea, I will try it!
Leo Chapiro 3-Apr-19 10:58am View
Yes, I have this problem only on some systems: it may be a strange Registry setting but I cannot find which exactly ...
Leo Chapiro 3-Apr-19 7:51am View
Thank you for the answer! I need to SHOW this picture in the WebBrowser control. This control is basically the simple IE window, that can both things: download AND show the picture.
The idea to use WebClient is nice (+1) but not exactly what I need :(
Leo Chapiro 2-Apr-19 8:20am View
I have so many questions:
- How can it be a solution of your problem?
- Why was the format not correct?
- What are you trying to achieve by giving us so small info?
- ...
Leo Chapiro 15-Mar-19 10:24am View
Please check the title of your question: do you really need to separate alphabet and number from alphanumeric text in VB.NET or rather in MS Access?
Leo Chapiro 15-Mar-19 10:13am View
I want to point to the title of OP's question: "How to separate alphabet and number from alphanumeric text in VB.NET". This question is exactly what I answered :)
Leo Chapiro 15-Mar-19 8:52am View
Sorry to say this, Maciej, but VBA does support RegEx, I personly have used it ofter, take a look for example
Leo Chapiro 7-Feb-19 7:21am View
Why don't you ask the author of this video?
Leo Chapiro 21-Dec-18 7:59am View
What have you already tried?
Leo Chapiro 19-Dec-18 9:11am View
Friend, please give us a little more information!
Leo Chapiro 19-Dec-18 7:14am View
Can you show us what you are doing? Your source code?
Leo Chapiro 7-Dec-18 10:15am View
You are welcome! Consider to mark the answer as "accepted" if it works, it may help other users.
Leo Chapiro 7-Dec-18 10:11am View
The link to book you provided is unfortunatelly dead: HTTP Error 503. The service is unavailable. Have you checked it?
Leo Chapiro 1-Nov-18 9:22am View
Words of wisdom!
Leo Chapiro 31-Oct-18 5:48am View
You can use GridView in WPF: GridView In WPF
Leo Chapiro 30-Oct-18 16:52pm View
Why do you think so? OP asks "How to do in c#?"
Leo Chapiro 26-Oct-18 6:06am View
Your question is incomplete: what error get you? What programming language are you using: VB.NET, VB6, VBA, VB Script? Have you tried to debug your code? Where exactly (row) occurs the error?
Leo Chapiro 19-Oct-18 9:12am View
Alex, make me a pleasure, please: save the code I gave you as test.vbs and let it run ("cscript.exe test.vbs" on console). You will see that the default browser opens the google site - that is all I can do for you now. Have no more time dude, sorry!
Leo Chapiro 19-Oct-18 7:22am View
You need to use "Set" to create objects in VBS/VBA.
Try this (VBS):

Dim webbrowser2
Set webbrowser2 = CreateObject("Wscript.Shell")
If webbrowser2 Is Nothing Then
MsgBox "Error on creating WebBrowsewr object"
webbrowser2.Run "http:\\", 1, False
End If
Leo Chapiro 19-Oct-18 5:11am View
Yea, a kind of "aggressive" defense :)
Leo Chapiro 19-Oct-18 4:34am View
Maybe bad experienses in other forums, I can't imagine that was someone of us :)
Leo Chapiro 19-Oct-18 2:47am View
CreateObject("Wscript.Shell").Run - take a look Are you not familiar with VBS?
Leo Chapiro 18-Oct-18 14:33pm View
@Alex: Have you tried call WShell.Run(url, 1, false) ?
Leo Chapiro 18-Oct-18 14:33pm View
Have you tried call WShell.Run(url, 1, false) ?
Leo Chapiro 18-Oct-18 10:46am View
This is the possibility to get the staandard browser by using the windows registry. Why should that not to be relevant to asked question?
Leo Chapiro 15-Oct-18 7:21am View
In other words, you don't speak english, know nothing about C and that is why you want us to write a C program for you?
Leo Chapiro 28-Sep-18 8:28am View
Try to open a file in shared mode: File.Open Method
Leo Chapiro 24-Sep-18 9:55am View
May it be, your select returns no results?
Leo Chapiro 24-Sep-18 7:57am View
I see, you mean OP needs to remove this part - than it's OK!
Leo Chapiro 24-Sep-18 7:51am View
No, it will not: the fact() calls recursivelly itself without a break condition -> stack overflow.
Leo Chapiro 24-Sep-18 5:47am View
It is difficult to say without to see your code, dude. Please share the appropriate code (not all you wrote) with us by adding it to "What have I tried".
Leo Chapiro 24-Sep-18 5:43am View
>this code returning one value
I think this code returns a List<string>?
Now you need to parse this list and add a cooma or whatever between the parts?
Or what is exactly the problem here?
Leo Chapiro 24-Sep-18 4:34am View
What means pClass in pInstance = Py_CallObject(pClass, NULL)? How was this object created?
Leo Chapiro 21-Sep-18 13:26pm View
memset(void *str, int c, size_t n) copies the character c (an unsigned char) to the first n characters of the string pointed to, by the argument str.
This is just an initialisation of "name" with 0.
Leo Chapiro 21-Sep-18 9:29am View
And what exactly is "mobile plug in"? Do you mean, the connecting of a mobile device on an USB port? Or connecting over Bluetooth?
Leo Chapiro 21-Sep-18 7:24am View
What have you already found out? This is a very broad field ...
Leo Chapiro 21-Sep-18 5:51am View
No one knows ... (SCNR)
Leo Chapiro 20-Sep-18 4:35am View
As far as I remember, I have helped you by this task tomorrow - the error was that your list *i1 was not created (NULL pointer), you have missed
l1 = create_emp();
Why do you ask the same again now?
Leo Chapiro 19-Sep-18 8:27am View
Have you tried to execute this statement by SQL Management Studio (MS SQL Server) directly?
Leo Chapiro 19-Sep-18 8:18am View
Take a look at this example: Add a RichEdit to your app! (non-MFC) and check what you are missing else.
Leo Chapiro 19-Sep-18 7:33am View
Marked as unclear.
Leo Chapiro 12-Sep-18 11:01am View
Leo Chapiro 11-Sep-18 4:16am View
Marked as "unclear"
Leo Chapiro 10-Sep-18 8:48am View
Thank you, Maciej!
Leo Chapiro 10-Sep-18 8:17am View
Nice solution, +5 as well ! :)
Leo Chapiro 23-Aug-18 10:40am View
Your goal is not really clear: what do you want to achieve by that?
Leo Chapiro 20-Aug-18 11:56am View
You wrote that you have had no idea, now you have an algorithm. It will not be difficult to change it to LINQ, there is even online tools for this purpose.
Leo Chapiro 6-Aug-18 9:53am View
Oh, sorry, I've removed the accidentally added answer. Thank you!
Leo Chapiro 23-Jul-18 8:34am View
Is it a statement, a wish or a question?
Leo Chapiro 24-May-18 9:59am View
Thanks, Richard, updated.
Leo Chapiro 24-May-18 9:59am View
Thanks, Richard, updated.
Leo Chapiro 24-May-18 7:02am View
Jerry, just out of curiosity: assuming you've started to programming been 15 years old, you supposed to be 55 + 15 = 70 years old now, am I right? I ask because I was born in 1963 ...
Leo Chapiro 18-Apr-18 10:30am View
What exactly is your problem here? Start to write the class "Sportsperson" having "Name" as a string, then go ahead with the child classes ...
Leo Chapiro 4-Apr-18 9:49am View
This is not an answer, consider to remove it and add as a comment to your question above!
Leo Chapiro 29-Mar-18 9:24am View
Your question is not clear, dude. What exactly is the problem you try to solve? Do you have many forms in your application and user can switch from one of them to another? How can he do it: by clicking on some button? Please show some source code how the switch between forms will be done.
Leo Chapiro 27-Mar-18 11:08am View
You are welcome.
Leo Chapiro 27-Mar-18 11:07am View
You are welcome
Leo Chapiro 27-Mar-18 9:42am View
Do you have any problems with your long long code?
Leo Chapiro 27-Mar-18 9:22am View
Looks like your homework, dude. Do you not want to do it by yourself? Uncle OriginalGriff has already a properly answer, I guess? Know what I mean? ;)
Leo Chapiro 19-Mar-18 11:59am View
Apparently says this error message that you can't compare an "int" to an "object" so what?
Leo Chapiro 19-Mar-18 11:08am View
Your question is unclear, please improve it! What is your goal, what is the error you get and so on ...
Leo Chapiro 7-Mar-18 10:43am View
I have also a question: How to avoid re-post?
Leo Chapiro 20-Feb-18 8:17am View
Wrong question, the right one is: what do you need?
Leo Chapiro 20-Feb-18 5:10am View
No, but marked as "Incomplete question"
Leo Chapiro 14-Feb-18 8:37am View
Impossible to help without to see your source code.
Leo Chapiro 7-Feb-18 5:55am View
>Maybe i must write with int.TryParse -> Maybe.
What gone wrong with this approach?
Leo Chapiro 2-Feb-18 9:48am View
Your question is not clear: an integer cann't looks like "001" but only like "1", the "001" is a string. You can convert it to integer: "001" -> 1. Is that what you need?
Leo Chapiro 29-Jan-18 7:46am View
I'm not sure whether the title of your question is correct. As I see, you are not really interesting on a problem "How to prevent SQL duplicate inserts" but just want to get a hint, why your code is running twice?
Leo Chapiro 29-Jan-18 5:40am View
Did your solution not work properly, what is the issue with it? Marked as unclear...
Leo Chapiro 23-Jan-18 10:02am View
Try to debug your source code and to localize where the error is
Leo Chapiro 8-Jan-18 5:20am View
Thanks a lot, Maciej!
Leo Chapiro 6-Jan-18 5:01am View
Thank you, Maciej!
Leo Chapiro 5-Jan-18 11:10am View
I can not solve all your problems, dude. The answer refers to your question about "how to change a value". If it helps, don't hesitate to mark it as accepted.
Leo Chapiro 5-Jan-18 10:39am View
Dude, what are you talking about?
Leo Chapiro 5-Jan-18 10:15am View
Keep on reading:
Leo Chapiro 3-Jan-18 10:26am View
Another good question for Afrasiab Cheraghi the author of this project.
Leo Chapiro 15-Dec-17 4:48am View
Yes, this is IMHO the only one possibility.
Leo Chapiro 14-Dec-17 8:45am View
update mytable set col1 = '', col2 = '', ...., coln = '' where LTRIM(RTRIM(ISNULL([{0}],''))) = ''
Leo Chapiro 14-Dec-17 5:00am View
What is about void *notfiy_func() ? Where is it declared? I miss it in your code ...
Leo Chapiro 12-Dec-17 6:07am View
The link you shared refers to .NET rather then to C++/MFC?
Leo Chapiro 8-Dec-17 7:07am View
Have you tried to use the wxWindow::SetLabel function?
Leo Chapiro 27-Oct-17 7:14am View
And the question is?
Leo Chapiro 7-Aug-17 6:53am View
+5 , as always beautiful explained!
Leo Chapiro 7-Aug-17 5:23am View
What have you tried?

Maybe can this helps: LMGTFY
Leo Chapiro 9-Jun-17 10:17am View
"I want the source code" is not the same like "I am trying to learn Java with full dedication"?
Leo Chapiro 18-May-17 4:33am View
Marked as "Question not clear": please add your relevant source code.
Leo Chapiro 26-Apr-17 10:51am View
As @NotPolitcallyCorrect already mentioned, pictureBox1.Image needs an instance of Bitmap but you are trying to put a String in it, don't you see it?
Leo Chapiro 20-Apr-17 8:16am View
And I want peace all around the world - so what? Looks like both of us will not get they want :( Thank you!
Leo Chapiro 7-Apr-17 5:38am View
You want a windows application starting on MacOS?
Leo Chapiro 28-Mar-17 10:32am View
If this task is too hard for you consider to purchase a programming service instead of trying to do it by yourself. I marked your post as "Not a question" .
Leo Chapiro 28-Feb-17 6:05am View
Try to debug your code, take a look at dataGridView1.Columns
Leo Chapiro 27-Feb-17 5:15am View
Instead of answer of the question you just copy/paste your post again - I'm not sure that it really helps to help you.
Leo Chapiro 7-Feb-17 4:44am View
This is a very bad habit, just to copy a question into "What I have tried", don't do it please!
Leo Chapiro 2-Jan-17 8:57am View
You need to delete a row in the DB table, then synchronise your GUI with the DB!
Leo Chapiro 23-Dec-16 10:11am View
"i solve it with long number to 10 digits" - let's take a look.
Leo Chapiro 23-Dec-16 10:04am View
How have you solved this problem "with long number to 10 digits"? can we take a look?
Leo Chapiro 21-Dec-16 5:31am View
Right, better!
Leo Chapiro 2-Nov-16 8:18am View
Why do you want to combine two setups (just out of curiosity)?
Leo Chapiro 2-Nov-16 5:44am View
Nope. I've changed the tag to "Drupal".
Leo Chapiro 2-Nov-16 5:39am View
This is a little bit few infos: we know now what you want but unfortunate NOT what exactly you have already done?
Leo Chapiro 1-Nov-16 6:55am View
I can without trouble compile and execude your code in VisualStudio Pro 2013 Update 1, the output is "n = 3"
Leo Chapiro 26-Oct-16 5:48am View
Hello, can you share your relevant source code instead of posting the same twice please?
Leo Chapiro 26-Oct-16 5:17am View
Why have you tagged your question with C - Tag?
Leo Chapiro 25-Oct-16 9:13am View
BTW, adding the source code twice don't make it twice as good :)
Leo Chapiro 25-Oct-16 9:08am View
Pls show what you have already reached and where exactly you need our help!
Leo Chapiro 25-Oct-16 8:19am View
OK, now I understand your question: PGM is a grayscale image file encoded with either one or two bytes (8 or 16 bits) per pixel; contains header information and a grid of numbers that represent different shades of gray from black (0) to white (up to 65,536); typically stored in ASCII text format, but also has a binary representation.

Do you want to read ONLY the ASCI part of the file?
Leo Chapiro 25-Oct-16 8:09am View
Didn't you said "when i read ... from image file"? What kind of file is that?
Leo Chapiro 25-Oct-16 8:02am View
You need to read a text file instead of a picture!
Leo Chapiro 24-Oct-16 11:04am View
I just wanted to show you the way how to "let user enter two command in one line", that's all. HTH
Leo Chapiro 24-Oct-16 10:57am View
int main(int argc, char* argv[]) {
cout << "argc = " << argc << endl;
for (int i = 0; i < argc; i++)
cout << "argv[" << i << "] = " << argv[i] << endl;
return 0;
Leo Chapiro 22-Oct-16 3:43am View
You write, "I have tried many me.".
It would be helpful to show us what you have already achieved and where you need a help ...
Leo Chapiro 14-Oct-16 9:36am View
So we shall help you to use POSTman?
Leo Chapiro 23-Sep-16 10:06am View
Words of wisdom, +5 :)
Leo Chapiro 23-Sep-16 8:50am View
But it seems to be possible (as per your company policy) to ask for help in this forum. And there are rools here: you need to show what you already achieved before ask for code ...
Leo Chapiro 23-Sep-16 8:44am View
As @NotPolitcallyCorrect already said, show us your code please, we can't read your mind, dude!
Leo Chapiro 21-Sep-16 6:54am View
I'm now after reading the posting of F-ES Sitecore (Solution 2) insecure whether you really are looking for a solution of your problem. You have in Solution 1 a working example of how to work with SignalR - has it helped? if not what exactly is now a problem?
Leo Chapiro 20-Sep-16 14:24pm View
Leo Chapiro 20-Sep-16 9:43am View
Thank you! :)
Leo Chapiro 20-Sep-16 8:31am View
int subcode = num%100; returns 58!
Leo Chapiro 20-Sep-16 7:44am View
What is the error you get? You need to deploy the DB as well, you know that , don't you?
Leo Chapiro 12-Sep-16 8:38am View
Show your C# source code please: how do you enter this values?
Leo Chapiro 6-Sep-16 11:55am View
What exactly do you want to achieve: do you want to debug an application remotely?
Leo Chapiro 1-Sep-16 10:58am View
And what is exctly the problem with currently solution?
Leo Chapiro 30-Aug-16 10:51am View
What shall be a problem to assemble the menu items dynamically dependent on context?
What have you not understood here?
Leo Chapiro 30-Aug-16 8:58am View
Don't you mean that "I don't tried any coding" and "I'm interested to learn this" is an opposition?
Leo Chapiro 1-Aug-16 4:54am View
Maybe it is not the best to start with "I want ..." if you need some help? Better way IMHO would be to show what you have already achieved and where you are stick?
Leo Chapiro 27-Jul-16 11:22am View
That was possibly Copy&Paste error: in the row above stays the same ... I've marked the question as unclear/incomplete.
Leo Chapiro 23-Jul-16 7:39am View
I have edited, try it like this please - it's a list of list ...
Leo Chapiro 20-Jul-16 5:32am View
If the substring you are looking for is separated by blancs, you can use the Split methode of String-Class.
Leo Chapiro 20-Jul-16 4:21am View
This "code" can't work because e.g. the function ExecuteLPR12() does not return any byte[]!
Leo Chapiro 14-Jul-16 7:50am View
Show your code / SQL statement, dude!
Leo Chapiro 6-Jul-16 10:27am View
Is it not the same what has sudgested Jochen Arndt in his Solution 3?
Leo Chapiro 6-Jul-16 9:57am View
That's it! +5
Leo Chapiro 6-Jul-16 5:38am View
Please take a look at this solution: String protection in RichTextBox. The point is, you can use controls like Labels inside the RichText box ...
Leo Chapiro 5-Jul-16 11:24am View
Well, this project I linked to is a good starting point to understand how to work with MySQL DB by using a C# I think. You have the examples for Delete() and Insert() as well ...
Leo Chapiro 5-Jul-16 8:13am View
You have to add a reference to System.DirectoryServices.AccountManagement.
Leo Chapiro 1-Jul-16 7:55am View
And what is wrong with your solution: any errors?
Leo Chapiro 1-Jul-16 5:17am View
Marked as repost of
Leo Chapiro 30-Jun-16 10:12am View
A very good and IMHO helpful answer! +5
Leo Chapiro 20-Jun-16 7:25am View
To use any of the widget classes, including the file dialog, you need to have an instance of QApplication, although that instance doesn't have to have its exec() method called:
Leo Chapiro 20-Jun-16 4:54am View
Never minds, you can write a console application that USES the GUI elements/dialogs, it's possible! For example, you can call a Message Box from console and so on ...
Please take a look:
Leo Chapiro 17-Jun-16 4:52am View
What are you trying to achieve, dude?
Show your attemps (code) pls!
Marked as unclear and incomplete.
Leo Chapiro 31-May-16 10:55am View
What are you talking about,dude? Show what are you trying (code), please!
Leo Chapiro 26-May-16 9:53am View
The List is good documented in C# MSDN, couldn't this help: List<t>-Klasse?
Leo Chapiro 26-May-16 6:13am View
>Is it free program?
No, it is not free. BTW, there is a new version of source safe 2005.
Leo Chapiro 18-May-16 9:06am View
You are welcome!
Leo Chapiro 25-Feb-16 7:06am View
Now it works
Leo Chapiro 25-Feb-16 4:23am View
"I want a code" is not how it works here, dude! Take a look at What have you tried?
Leo Chapiro 16-Feb-16 9:26am View
Who are you and what do you doing in the thread of "Member 11349428231"?
Leo Chapiro 5-Feb-16 9:50am View
What have you tried? Show your source code and mark the point where you're stuck.
Leo Chapiro 25-Jan-16 11:14am View
Can you translate your question in english please? Merci!
Leo Chapiro 25-Jan-16 9:56am View
Leo Chapiro 25-Jan-16 9:55am View
Leo Chapiro 18-Jan-16 7:59am View
Try to debug it!
Leo Chapiro 18-Jan-16 7:37am View
Can you please explain what exactly are you trying to do? Why are the programming languages C# AND C++?
Leo Chapiro 15-Jan-16 5:57am View
Urgent for whom?
Leo Chapiro 14-Jan-16 7:55am View
I thought that is what you need? If not, can you please explain, what is your goal?
Leo Chapiro 14-Jan-16 5:52am View
You'll receive paintEvent every time when the operating system needs you to repaint your window. And you can't "fix" it! What do you want to achieve?
Leo Chapiro 14-Jan-16 5:39am View
Fill free to upvote the answer if it helps!
Leo Chapiro 14-Jan-16 3:54am View
And what is exactly the problem with your code? Any error message, exception ?
Leo Chapiro 14-Jan-16 3:30am View
Dude, please read your question one more time and say: do you really think, anyone can help you having this information?
Leo Chapiro 14-Jan-16 3:24am View
What have you tried to fulfill your homework, dude? How can we help you?
Leo Chapiro 13-Jan-16 9:29am View
Marked as unclear
Leo Chapiro 13-Jan-16 8:03am View
Thank you for advice, +5!
Leo Chapiro 12-Jan-16 6:08am View
Looks like a valid answer, I think?
Leo Chapiro 8-Jan-16 4:11am View
Marked as unclear
Leo Chapiro 6-Jan-16 9:37am View
What do you mean by "request", what have you tried?
Leo Chapiro 6-Jan-16 8:09am View
Why do you need to save them, are the data not safe in the DB? ;)
Leo Chapiro 5-Jan-16 9:10am View
Marked as unclear and incomplete
Leo Chapiro 5-Jan-16 8:58am View
Do you know what exactly is the regular expression?
Leo Chapiro 5-Jan-16 8:49am View
Do you ask for a regular expression to check the validity of the email address? In this case this is the worst-asked question I ever read!
Leo Chapiro 5-Jan-16 7:41am View
You can do it by writing some source code, I guess :)
Leo Chapiro 5-Jan-16 6:21am View
I don't think that this is possible: instead you can "slide" with the constant window size over the memory by using paging ...
Leo Chapiro 27-Dec-15 3:49am View
Is it not better to check your own answer before to criticize an answer of other people? :)
Leo Chapiro 23-Dec-15 11:44am View
>I dropped button, but i dont know which code should i write !!
Short answer: you don't!
Leo Chapiro 23-Dec-15 8:16am View
Where do you want to send file to, dude?
Leo Chapiro 23-Dec-15 7:55am View
Your question is not clear: what file do you want to send? Do you mean a screenshot?
Leo Chapiro 23-Dec-15 4:05am View
Nice, +5 :)