|
Danish Samil wrote: Microsoft Word Container
And what would this container be? An ActiveX Control or are you using Windows API hacks to host the entire Word application inside the form? If the case is latter, I doubt if you can do it at all.
|
|
|
|
|
I am using Windows API.
Surprisingly toolbar button displays hover effect but the issue is the call to method behind the click - which works by clicking twice as discussed. In addition i tried overriding onmousehover but in vain.
This might give a clue on what to do next.
|
|
|
|
|
I played with this concept once. The issue is that when Word is focused, the form is deactivated. You could use the form activated event but that would fire if you jumped to the form using Alt-Tab. The code shown below detects the WM_Activate message sent to the form and verifies that it was generated by a mouse-click.
private const Int32 WM_ACTIVATE = 0x6;
private const Int32 WA_CLICKACTIVE = 0x2;
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
if (m.Msg == WM_ACTIVATE && m.WParam.ToInt64() == WA_CLICKACTIVE)
{
Point pt = toolStrip1.PointToClient(Cursor.Position);
if (toolStrip1.ClientRectangle.Contains(pt))
{
foreach (ToolStripItem item in toolStrip1.Items)
{
if (item.Bounds.Contains(pt))
{
item.PerformClick();
break;
}
}
}
}
}
|
|
|
|
|
Thanks a thousand times - it worked.
You Rock!
|
|
|
|
|
I want to develop a search engine like Google, bing. Which are the things are need to implement the search engine. I need some example code snippets.
Thanks
Anand. G
"There is no Limits to think!" 
|
|
|
|
|
This[^] author has written a whole series of articles on creating a custom search engine. It's rather wonderful.
|
|
|
|
|
Thanks Pete O'Hanlon. I already seen that Populating a Search Engine with a C# Spider. I executes the code myself and find that, the problem is the code search the contents within the local server not in a web.
OK. Sir, Can you explain how to use[^] the code to search the contents from the internet.
Thanks.
|
|
|
|
|
I advised you to look at all his articles. This[^] one moved onto web searching.
|
|
|
|
|
To be honest, you probably don't - not unless you have very, very deep pockets. The hardware Google uses to run their search engine consumes between 500 and 680 megawatts of power: about the same as the total output of two or three coal fired power stations. The cost of this alone is staggering, without the cost of the hardware behind it, or repairs to that hardware - and Google replaces a faulty HDD every minute or less...
Find yourself a project that doesn't require such massive storage capacity!
Those who fail to learn history are doomed to repeat it. --- George Santayana (December 16, 1863 – September 26, 1952)
Those who fail to clear history are doomed to explain it. --- OriginalGriff (February 24, 1959 – ∞)
|
|
|
|
|
I agree with you sir. But I need to do with my own hand. I want develop a simple featured text-based search engine.
Thanks
"All fishes know how to swim in sea" 
|
|
|
|
|
Oh Griff!!!, You're turning down a future entrepreneur. If Sergey and Larry had consulted you, we'd not be having Google today 
|
|
|
|
|
At a minimum, you need a server infrastructure that hosts the search page, the crawler, storage, etc.
Crawler
Write a crawler that will hit the home page of the site you're trying to index, extract all the links in the page and recursively crawls each the links and saves the url along with the keywords, images, etc.
Search
Write a search component that will search the indexed pages using the keywords and present the url of the pages to the user.
|
|
|
|
|
Hi, Please help me to convert from "\\r\\n" into "\r\n" .
I am giving input from registry to class i.e. "\r\n" and my code is converting into "\\r\\n". But i need in "\r\n" to get the results.
|
|
|
|
|
Can you show the code in your input?
It is very possible that you have no handle of escaped chars as \r (remember it is ONE char the backslash - called escape - is there to tell you we do not talk about a r as is, but we want to assign to it a special meaning).
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
if (SuffixValue != null)
_RCVData =_SetSerialPort.ReadTo(SuffixValue);
else
_RCVData = _SetSerialPort.ReadLine();
I am doing these things...I am passing "\r\n" to variable SuffixValue but in code its coming \\r\\n.
When i do hard coding instead of variable i.e. "\r\n" then its working fine.
|
|
|
|
|
As I told - when you hard-code the value your IDE handles the escaped characters (convert \r\n to two characters), however when it comes via some port read it still a character sequence of four characters. You have to check your source (port) how it generates the string. maybe teach it to do in C way or add some handling of your own...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
SuffixValue = _deviceSettingsKeys.GetValue("ReceiveSuffix", "");
if (SuffixValue != null)
_RCVData = _SetSerialPort.ReadTo(SuffixValue);
else
_RCVData = _SetSerialPort.ReadLine();
Can you fix this, how i should do this.
|
|
|
|
|
You should do some string replace...
* find escape character (\)
* check if next character has special meaning after escape
* replace the pair with the real one...
I'm not questioning your powers of observation; I'm merely remarking upon the paradox of asking a masked man who he is. (V)
|
|
|
|
|
I can do that things whatever you are telling, but here problem is when take harcoded value "\r\n" instead of SuffixValue then its working fine, but when i pass use variable then its not working....can you post any way to do it.
Thanks Kornfeld Eliyahu Peter
|
|
|
|
|
I'm going to bet that your code isn't really converting it into \\r\\n. I rather suspect that you have put a breakpoint in your code (well done for that), and you are inspecting the value in the debugger - this is why it appears to be incorrect. The debugger shows escape characters as double slash, rather than single slash - but the underlying value is still a single slash.
|
|
|
|
|
No, when i pass \r\n from registry
if (SuffixValue != null)
_RCVData = _SetSerialPort.ReadTo(SuffixValue);
else
_RCVData = _SetSerialPort.ReadLine();
From the registry i am taking suffix value "\r\n". When i do hard coding then its working fine:
When i take using variables then its not reading. When i use variable then getting System.TimeoutException: The operation has timed out.
if (SuffixValue != null)
_RCVData = _SetSerialPort.ReadTo("\r\n");
else
_RCVData = _SetSerialPort.ReadLine();
modified 18-Feb-14 6:12am.
|
|
|
|
|
Yes correct exactly i am doing the same what you mention in your comment
|
|
|
|
|
Ok Ok...i am agree with you, what you are telling is correct. But can you run this and check why its not showing the TRUE results:::
class Program
{
static void Main(string[] args)
{
string check = "324214234\r\n";
RegistryKey regKey = Registry.LocalMachine.CreateSubKey("SOFTWARE\\MyRegKey\\Settings");
regKey.SetValue("ReceiveSplChar", @"\r\n");
string value = regKey.GetValue("ReceiveSplChar").ToString();
if (check.Contains(value))
Console.WriteLine("TRUE");
}
}
|
|
|
|
|
The reason is to do with what you are writing to the registry. By putting @"\r\n", you have told the application to write a slash followed by r followed by a slash followed by an n. These are four separate characters. Change that line to:
regKey.SetValue("ReceiveSplChar", "\r\n"); It will now work.
|
|
|
|
|
It may useful to you. [*]
|
|
|
|