[Solved] Correctly receive messages from button

[ad_1] To detect a button press in another process, you have to hook that process. You have four choices for doing that: use SetWindowsHookEx() to install a WH_CALLWNDPROC or WH_GETMESSAGE hook into the target process to catch the WM_COMMAND/BN_CLICKED message that is sent to the button’s parent window when the button is clicked. The message … Read more

[Solved] Which is faster, for loop or LINQ

[ad_1] Neither. Using a loop has less overhead than LINQ, so that is a good start. Use the < operator in the loop condition, that is the standard way of writing such a loop, so it’s more likely that the compiler will recognise it and optimise it properly. Using Math.Pow to square a number is … Read more

[Solved] Compile:error LNK2001 [duplicate]

[ad_1] #include <VECTOR> I’m assuming you meant to include #include <vector>. Unresolved external ? You did not implement ~Vec(void); only a declaration exists. Please implement the destructor or simply do not declare it. Also for a better style I would recommend deleting the using namespace std; and use std::vector<T> instead. Another style issue is your … Read more

[Solved] C# get part of array by array mask

[ad_1] I suggest finding the index of the first mask ocurrence: private static int MaskIndex(byte[] source, byte[] mask) { if (mask.Length == 0) return 0; // or source.Length; or throw exception for (int i = 0; i < source.Length – mask.Length + 1; ++i) { bool found = true; for (int j = 0; j … Read more

[Solved] How to copy Data from one class to another [closed]

[ad_1] To keep it simple and answer your question, here is the code needed. The anticipated issues? I’ve commented the line I am most skeptical about, I hope you’re considering another design because this design somewhat resembles a recipe for disaster. This answer however should set you on the right path, you can implement further … Read more

[Solved] c# searching on C:\Users\John\Desktop using the text on text.box as search key? [closed]

[ad_1] Below should work. It enumerates that path. Be sure to have a multiline textbox called txtOutput, and a txtSearch named control. You can put this in a button click or where ever. txtOutput.Text = “”; foreach(string file in Directory.GetFiles(“c:\\path”)) if(Path.GetFileName(file).Contains(txtSearch.Text)) txtOutput.Text += txtOutput.Text + file + “, “; 2 [ad_2] solved c# searching on … Read more

[Solved] executing programs from command prompt [closed]

[ad_1] After it begins to execute, is your program using relative paths to input files that might be different? Are you an administrator on the computer and/or running eclipse as administrator? You could try running the command prompt as administrator to confirm that it isn’t a permissions issue. 2 [ad_2] solved executing programs from command … Read more

[Solved] An Update statement in a loop

[ad_1] This can be done with a single update statement. delete from question where id = 2; with new_order as ( select row_number() over (partition by survey_id order by question_no) as new_question_no, question_no as old_question_no, id from question ) update question set question_no = nq.new_question_no from new_order nq where nq.id = question.id and survey_id = … Read more