|
I have created a very simply Windows Service.
I know the service runs because the event view shows it runs and the service writes a short text file as extra proof it is running.
What I would like the service to do is called an old C++ FormView based application. So I haved coded a process call like this;
OnStart()
{
Process myProcess = Process.Start("C:\\TestDir\\TestProcess.exe");
}
The "TestProcess.exe" also runs, again it writes to a text file to prove it has run.
But the TestProcess (which is FormBased-FormView) displays no visible window. My question is- how can I see the Form of the TestProcess, is there a way to make it visible?
thanks
|
|
|
|
|
Services run on a different WindowStation from the interactive user. This is by design. You need to back up and reconsider your plan here - a service runs all the time, what would you expect to happen to that TestProcess GUI application as a user logs in and back out all while you service is still running?
--
-Blake (com/bcdev/blake)
|
|
|
|
|
Can you set COM+ attributes at runtime inside you code? Thanks.
norm
|
|
|
|
|
I complied unmanaged C++ code to .dll and call the method in .NET.
I have found that the memory of a pointer is freed more than one time. The block used for freeing memory is as under.
int *p;
p = memalloc(sizeof(int)*100);
...
if( p != NULL)
{
free(p);
p = NULL;
}
Even though it has been checked if p not equal to NULL while calling this code from .NET aware language the assertion is thrown by .NET run time!!! What should be done for this issue?
|
|
|
|
|
try using __nogc*
|
|
|
|
|
Posted a question a while ago:
"Is there some way to manipulate/store/use 256 bit int/float/long so that finally a calculator for those 256 bit values can be made?"
One suggestion was to divide that number into 2 decimals or 4 longs BUT I'm pretty much a newcomer so could anyone help me out some little more and tell me howwww exactly to divide that 256 bit input into those 2 128 bit decimals? I mean the problem facing me is this: I take a string input (readline) and then have to convert that to some numerical form to perform the mathe operations...but to do that I have to have some container, a datatype big enough to hold that converted 256 bit value first right?...so how do I know how and from where to break that converted string input into 2 decimals actually during conversion? I do hope I haven't muddled this up ...BUT anything possible plz? ...
Thanks beforehand for time and help...
|
|
|
|
|
|
I want to create an XML web service that allows a user to enter two U.S. addresses, and be able to obtain step-by-step driving directions.
At first I was hoping that Yahoo or Mapquest would have a web-based API that I can use, but I can't find any APIs for them. PLEASE let me know if they (or any other map sites) have these APIs.
So my second alternative is to find a free XML web service somewhere out there that can provide more or less the same functionality. That way, I can still create my custion XML web service, and have it call the 3rd party web service to do the job.
Microsoft's MapPoint.NET web service (http://www.microsoft.com/mappoint/webservice/default.mspx) would have been the perfect solution for me, but it's not free. I'm doing this for a school project and, as a student, I can't cough up what Microsoft is charging for using its MapPoint.NET service.
So, I would like to know if anyone knows of another map web service that is free. Thanks.
|
|
|
|
|
.Net use a stranger approach to pass data into event handler, all event handler has the same prototype:
void eventhandler(object sender, System.EventArgs e)
but there is no event-specific data contained in the EventArgs object, so how can i get event-specific data (such as X/Y in a mouse event)?
in my case, i wrote a event handler for the Click event of ListView, when user click on one of the subitem in the ListView, I want to know whick subitem is clicked.
any comments is welcome
|
|
|
|
|
ListViewItem Selected = MyListView.SelectedItem;
or, if you have multiple ListView's and they all use the same event handler
<br />
ListView MyListView = (ListView) sender;<br />
ListViewItem Selected = MyListView.SelectedItem;<br />
|
|
|
|
|
thanks, Wjousts
what i really want is the sub item be clicked
ListViewItem Selected = MyListView.SelectedItem;
this code will get the selected item, not sub item.
I have found an approach, send a WIN32 message LVM_GETSUBITEMRECT to the ListView window, it's work, but I think there must be some better way.
|
|
|
|
|
Wjousts wrote:
MyListView.SelectedItem
Sorry! Doesn't work. Use MyListView.FocusedItem instead.
|
|
|
|
|
You should set the ListView.FullRowSelect=true, otherwise ListView.SelectedItem will always be empty.
|
|
|
|
|
|
ispring wrote:
but there is no event-specific data contained in the EventArgs object, so how can i get event-specific data (such as X/Y in a mouse event)?
Try the MouseDown or MouseUp events - they have MouseEventArgs e instead of EventArgs e .
To get which sub-item was clicked, either use the Windows API, or first get the GetItemAt() method to get the item, then use the GetItemRect(index, portion) overload of GetItemRect() to get all its subitems and hit-test them.
|
|
|
|
|
I want to display my debug info in a simple console windows as various events are fired from my program. I can not figure out how to open a Console from my form and then to writeline to it. Can someone point me in the right direction...
rod
www.bigmansoftware.com
|
|
|
|
|
There is only one console per app, and you can easily show this console even if your app is a WinForms app. I don't know what the option is called in VS.NET, but in SharpDevelop, it's called "Hide Console Output".
|
|
|
|
|
Here is what I have tried.
Console c - new Console(); - did not like that, got a protection err
so then...
Console.Writeline("test"); - nothing shows, a Console never appears.
I just want a Console open with my Window form to write data and displays too.
rod
|
|
|
|
|
just change you app to be a console app...
Project, Properties, Common Properties, General, "Output Type" = Console Appliation.
You will need to create main as per a console app, and the will have to show the main form...
"When the only tool you have is a hammer, a sore thumb you will have."
|
|
|
|
|
I am C# Student and I have an application that I am developing that I need to get a string value from a text box in the child form into the parent form where I am converting it to an int to use in a random number generation. I have not been able to get any help or find the solution anywhere, so any help would be great. Please only give me C# code as I have never programmed anything but this. Thank you for your time.
Thanks,
Brad
"If you fell sad about your life, just go to the mall"
|
|
|
|
|
hi,
how can TcpClient detect other side closed the connection?
i want to check when the server close connection and i can start process received data afterward.
any help?
regards,
jim
|
|
|
|
|
I'm redesigning the way our application saves and restores sessions. Presently it's serializing using SOAPFormatter, and that's not so good. Most importantly, it's not backwards or forwards compatible. So I want to use XML so that the format is forwards-compatible, and future versions of the application are backwards-compatible with older formats.
Does anyone have any tips regarding this? Any good techniques or interfaces to use? XmlDocument vs. XmlWriter/XmlReader?
Since some of my data involves Rectangle and Point objects, for instance, and Color objects, too, etc., is there a good way to handle that data without having to handle them specially and write extra code for that?
XmlSerializer even seems tantalizing because it might be quick and easy, but I'm afraid that it will be too tied to the internal data representation or class/package structures.
Thanks!
|
|
|
|
|
Hmm, maybe Reflection will somehow help me with the System classes.
|
|
|
|
|
Do most people use databinding with winforms or
do they use a homegrown solution. My experience with
databinding has been problematic at best. I've ran into
numerous problems with anything other then a simple form.
These problems range from programmatically setting a value
in a text box, and the databinding ignoring it, to strange
problems with nulls. I guess I'm stuck in my ways but I
prefer the old ddx, ddv validation of atl and mfc. Although
I am willing to change
I'm also curious about ado versus ado.net.
Is a In memory database really needed? When and were
would the decision between the two be made.
Also does anyone know of any orm tools for c++ and classic ado.
I dont want to cross post to two boards so I am hopeing this is the
correct place. I apologize if they are not.
Thank you
|
|
|
|
|
Data binding is a done in a new way in C#. I think the best thing to do is research and find out. I love .NET databinding. Its very flexible and powerful.
Same story with ASP.net it has been totaly redon based on the .net framework. It runs a lot fast (some people say up to 3 times faster) and is way more powerful and flexible.
About orm tools im not sure.
|
|
|
|