|
many thanks that worked a treat passed DateTime.DbNull.Value
|
|
|
|
|
HI~
Is there any function in eVC++ which can pass some parameters to a running C# program?
"CreateProcess" can pass some parameters as a argument when a process start. However, how about the process is running?
Thanks~
|
|
|
|
|
There's many ways. You could expose your .NET components as CCWs (COM-Callable Wrappers) and communicate with them that way (most likely using the Running Object Table - or ROT - to get the running instance, but any singleton pattern will do).Read my article Embedding .NET Controls in Java[^] for an example (ignore the Java stuff; pay attention to how the C++ bridge marshals calls on the .NET Control exposed as a CCW). Also read Nick's article, Creating a CCW for COM-Enabled, non-.NET Applications[^].
You could use DDE, though adding support for this archaic API to .NET is cumbersome (but I do believe I've seen an article here on CP that may help).
You could use any IPC (inter-process communication) mechanism, such as - but not limited to - .NET Remoting (easy to implement on the .NET side, but forces you to parse and create XML fragments and post them to a TCP channel, for example, yourself in eVC++, interop'd IPC functions from the Win32 API (at least whatever is supported by eVC++ for the Windows Mobile architecture), etc.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi , anyone know if it is possible to somehow match a regex pattern at an exact index?
eg:
string text="abc 0xffaabb def ghijkl";
regex r=new regext ("0x[0-9a-f]+");
match m=r.match (text,4); //<-- i want to match at position 4 ONLY , not 5,6,7,8 or anything else , only on index 4
[edit]
ofcourse i can check if the match object returned is located at the same index, but that would lead to seriously bad performance since the whole string will be scanned. i need it to check on the index only..
[/edit]
the length param is apparently not for this , it only limits how long the result can be , and i dont know that in advance , it can be any length
//Roger
|
|
|
|
|
You can't match only at index 4 with a search result of 3+ length. That doesn't even make sense. Yes, the match starts at index 4, but is not limited to only index 4.
There is a Match(string, int, int) method that may help if you have some idea of a maximum length of a hex number (depending on the bit-length of the numeric type you're checking for.
You might also consider not using regular expressions for this very simple search. The String class has many methods that can help you parse this string that would be much faster, especially if you're not compiling the regular expression (thus it must be compiled each time it's used - very slow comparitively).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
well the expression here was just a sample , it can be any regex.
i just want a fast way to verify if the text at a given index matches a regexpattern , no matter how long it is.
//Roger
|
|
|
|
|
Ive found the solution for the problem ,
I simply needed to add a "\G" in the beginning of my regex , this will make the regex engine only match at the given index
//Roger
|
|
|
|
|
i hav a problem using the splitter.I hav tried to use it with panels and the splitting doesn't occur properly..For the form I added 3 panels. A base panel, a top panel and a bottom panel. i want to add a splitter between the top and bottom panels so that when u click and drag the panels should resize. How can I achieve this?
samitha
|
|
|
|
|
Using the designer, you have to add these in the right order. For example using a Windows Explorer-like layout, add a Panel and dock it to the left side. Add a Splitter . Now add another Panel and set the Dock property to DockStyle.Fill (just "Fill" in the designer).
If you look at the code, you'll notice that the TabStop s are 0, 1, and 2 respectively. The order in which these controls are added (the most important part; the TabStop in the designer determines this order but they don't have to match) is reversed:
this.Controls.AddRange(new Control[] {
this.panel2,
this.splitter1,
this.panel1}); Why they're reversed has to do with the way AddRange works internally.
Replicate this in your code and you should be fine. If nothing else, try throwing together a new project and layout the Panel s and Splitter s in order the way you want them. Be sure to examine the code, however, to know what's being done by the designer.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi, I want to use Outlook to send a e-mail in my code.
I have created a class library for this already.
When I run this in a Windows App., it works OK. But if I run this
as a Windows Services, I got an exception in the CreateItem line:
//Code start..
Outlook.MailItem mailItem;
mailItem= (Outlook.MailItem)app.CreateItem(Outlook.OlItemType.olTaskItem);
//..Code end
_COMPlusExceptionCode -532459699
_source "Microsoft Outlook"
_className null
_exceptionMethod null
_exceptionMethodString null
|
|
|
|
|
The service has to be able to run in a desktop session. In the Services control panel, find the service, open it's properties, and select "Allow this service to interact with the desktop". Alternatively, you can run the service as a specific user, but it will always run as that user and, thus, email will be addressed from him or her.
If you want to send email from a service, I recommend you implement an SMTP client yourself. For the basics, it's really very easy. Just click "Search comments" above and search for "SMTP" or something. I know that I've posted code snippets several times in the past and you can always search google[^] for more.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I use the control to design a window form with the DotNet pattern.I want my form to be the similar to toolbox and solution explorer,which can hide when you push the AutoHide and display when the cursor pass it.And with MagicLibrary I succeed.But I still have a problem.
The toolbox or solution explorer is so agile that an ordinary customer can not be used to it.The key is it is very difficult to put the solution explorer into its original position after a customer pulls it out. So I really want to know how I can make the solution explorer fixed to its initial position.Just like the fields "anchor".
If you know the solution,please mail to me :"w2520n2520@hotmail.com".
Thank you!
Never understand
ridical version!
|
|
|
|
|
What is "MagicLibrary" supplied by codeproject?
Is it something that appeared in an article? If so you should use the forum at the bottom of the article's page.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
MagicLibrary is a control upload by Phil Wright.
You can search "Phil Wright" or try the URL "http://www.codeproject.com/cs/miscctrl/magicdocking.asp" to understand it.Thank you for your reply.
Never understand
ridical version!
|
|
|
|
|
ILoveCS wrote:
MagicLibrary is a control upload by Phil Wright
Then I suggest that you ask in the appropriate forum. You'll find it at the bottom of the article's page[^]. I told you this in my previous post to you.
"If a man empties his purse into his head, no man can take it away from him, for an investment in knowledge pays the best interest." -- Joseph E. O'Donnell
Can't manage to P/Invoke that Win32 API in .NET? Why not do interop the wiki way!
|
|
|
|
|
Hi,
I am programming a Web Application using C#. Is there any way I can get Web Client IP address?
CD
|
|
|
|
|
Request.ServerVariables["REMOTE_ADDR"]
check out this page to get a list of all the variables.
I can imagine the sinking feeling one would have after ordering my book,
only to find a laughably ridiculous theory with demented logic once the book arrives - Mark McCutcheon
|
|
|
|
|
Thank you. It really helps
|
|
|
|
|
Anyone know how I can trap this message?
I've tried trapping it in the WndProc (0x00A2) but it never is generated. The documentation says:
"If a window has captured the mouse, this message is not posted'
does this mean its not going to be generated ?
|
|
|
|
|
Why don't you check for WM_LBUTTONUP (0x0202) instead? The following works for me:
int WM_LBUTTONUP = 0x0202;
protected override void WndProc(ref Message m)
{
if(m.Msg == WM_LBUTTONUP)
MessageBox.Show("mouse up");
base.WndProc (ref m);
}
- Nick Parker My Blog | My Articles
|
|
|
|
|
Because I'm attempting to determine when the window has been moved.
I know about OnLocationChanged and WM_MOVE and WM_MOVING, but I need to raise an event when the user is finished moving the window.
|
|
|
|
|
As we've discussed in this forum many times in the past, there really isn't a way. You could implement this by using a timer but that's pretty presumptuous. The user may have just paused while continuing to drag.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
I'm aware of how to use arrays similar to the following example.
static void Main()
{
ArrayList list = new ArrayList();
list.Add(45);
list.Add(87);
list.Add(12);
foreach(int num in list)
{
Console.WriteLine(num);
}
}
However, I'm trying to capture data strings from a log server and parse them in memory rather than FileStreaming them to a log.txt file and parsing later.
I can view the ArrayList activity with a listBox and it seems to me it only holds one (1) string at a time. I need a growing list in memory that I can sort and parse. Here's my failing setup so far. Help...... (C#)
str = System.Text.Encoding.ASCII.GetString(data); //data is a Byte[]
Al = new ArrayList(1024);
Al.Add(str);
foreach(string Line in Al)
{
listBox1.Items.Add(Line.ToString());
}
// Knowledge is a one way street, Wisdom is looking both ways before crossing
|
|
|
|
|
You've only added one string to the arrayList, so how many were you hoping would come out ? If there is a seperator in the byte[] that denotes the position of multiple strings, then use the Split function of the string class to turn str into a String[], which you can then foreach into the listbox. Assuming your delimiter is a slash or something, otherwise you may have to parse the byte array instead.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|
|
just bind the arraylist's datasource and dont add/remove items to the listbox itself eg.
listBox1.DataSource = Al;
SHould be all you need. Look at the help too, if you want to customise the display of the listbox (something member (datamember?) property).
top secret xacc-ide 0.0.1
|
|
|
|