|
hey, i tried to share data between two form in different project under same solution. i have two project(project A,project B) in one solution and i want to send data from project A to Project B. and also at that time i want to activate form from project B and same time wants to close previous form. please help me in this case. i really stuck with it. i am using windows application in C# and doing serial communication.
please reply as soon as
|
|
|
|
|
arpi8319 wrote: please reply as soon as
?????
If they are in the same solution, means NOTHING. You need to use something like WM_COPYDATA, or if you want to be all modern, use WCF.
Christian Graus
Driven to the arms of OSX by Vista.
"! i don't exactly like or do programming and it only gives me a headache." - spotted in VB forums.
I can do things with my brain that I can't even google. I can flex the front part of my brain instantly anytime I want. It can be exhausting and it even causes me vision problems for some reason. - CaptainSeeSharp
|
|
|
|
|
Hi,
Use WCF if these 2 projects are running in different app domains. Ensure to,
-Use Named Pipe binding (I assume that both are winform applications and running on same machine)
-Implement duplex contract for notifications.
Let me know if you need help for implementing this.
|
|
|
|
|
What is the command in c# .net to turn off a pc with windows xp ?
|
|
|
|
|
Have you tried to Google[^] for this? There are many articles out there on the topic. On my search the first hit is what you are looking for. Maybe this will help.
In C#, you could use System.Management classes and the WMI class Win32_OperatingSystem.<br />
<br />
The possible flags for controlling the system<br />
<br />
0 = Log off the network.<br />
1 = Shut down the system.<br />
2 = Perform a full reboot of the system.<br />
4 = Force any applications to quit instead of prompting the user to close them.<br />
8 = Shut down the system and, if possible, turn the computer off.
Next time google first and if all else fails post here.
Excellence is doing ordinary things extraordinarily well.
|
|
|
|
|
Why not just run shutdown.exe with the correct command-line arguments?
Between the idea
And the reality
Between the motion
And the act
Falls the Shadow
|
|
|
|
|
|
First question. (Please don't hit me just because I'm stupid.)
I have a short-deadline (90-day) assignment to convert an almost-working Access 2000 application to C#.net. The application has fifty forms, covered with fiddly little fields that have to be precisely aligned. I am relatively inexperienced in C# .Net development, but I have learned the basics, and have completed several applications of a complexity similar to this assignment. The job is easily achievable within the time limit if the forms don't have to be drawn, but for me to draw them to an acceptable quality will take at least 90% of the time available for the project. Plumbing the code behind the forms holds little terror for me, and can be done easily within the time limit.
Here's the question: Does anyone know of existing software (Codeproject article, other article, commercial software, shareware) that can convert MSAccess 2000 forms to the Visual Studio .Net environment? Retaining the names of the objects would be nice, but not necessary, all I really need is the wireframes of the forms with the objects in their prior spatial arrangement. The development platform is XP.
Searching the web, EvolutionOne seemed to offer hope that I could do a three-cornered MSAccess>VB.Net>C#.Net kludge, but drilling down to their demo software found their website hollow. Looks like they died about 2002.
My bosses are willing to spend up to about 500 (US$)for a product that can do this with a short learning curve. Particularly when faced with the costs of hiring a squad of temporary mouse-wranglers to draw the hateful forms within the time allotted.
Any sensible suggestions will be regarded with gratitude.
"To do is to be." [Descartes]
"To be is to do." [Voltaire]
"Do be do be do..."[Frank Sinatra]
|
|
|
|
|
I looked a year or two ago, unfortunately I wasn't able to find anything, and don't think it exists.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
There is nothing that will convert Access Forms to C#, or any other language for that matter. Access Forms work quite a bit differently from others, so there is no real direct conversion possible.
You're going to have to redesign the forms, by hand.
|
|
|
|
|
Converting the app as a whole would be a massive undertaking, but if I understand correctly the OP would only need something to create the designer code on the real language side. That would be a significantly simpler task, unfortunately AFAIK there's no tool to even do that much.
It is a truth universally acknowledged that a zombie in possession of brains must be in want of more brains.
-- Pride and Prejudice and Zombies
|
|
|
|
|
Please visit Microtools.us website at http://www.microtools.us. ANETVC7, Access Whiz Option H can help you to convert Access forms to C#.
|
|
|
|
|
Just because you can use a tool to do [some|all] of the conversion for you, doesn't mean it's a good idea.
|
|
|
|
|
A possible approach would be to write some VBA in Access that iterates through the AllForms collection and the controls on each form and outputs their properties to a text file.
You could then use C# to parse the text file and create the corresponding forms in .Net.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
|
|
|
|
|
Most Excellent Answer, it would not have occurred to me, but YES, this did the trick nicely. I'm a developer who appreciate how Access puts the "Rapid" into "RAD", but yes, it sure is a bummer when you have 25 forms with 50 to 100 fields each (they are REALLY crowded), and then it's a "Yikes" I have to convert them by HAND! (eg. into Winforms for SQL w/ VB.NET or Web form for ASP.NET etc). But "Voila", after taking the suggestion of David R, life is good! OK, so I'm not done, but it's going well, "the nut is cracked" (as the squirrels say).
So rather than more platitudes, here is the code (below). As they say, "your mileage may vary", you will probably want a few more parameters (tabindex#, Locked etc), but this is the core.
I decided that "On Error Resume Next" was the easiest way to skip the errors that occur when a control is missing a property, for instance a label does not have a ControlSource. I hope this is clear enough as is, but please "drop me a line" if I can answer further questions. Time permitting, I'll turn this into a shareware offering (like the now dearly departed EvolutionSoft, what happened to them?).
Here is the Access VBA code "snippit":
("CTL" is abbreviation for Control; "CTL SRCE" is "ControlSource")
On Error Resume Next
FOR i 0 to Me.Controls.Count -1
OutFile.WriteLine("CTL- NAME: " & Me.Controls(i).NAME)
OutFile.WriteLine("_CTL SRCE: " & Me.Controls(i).ControlSource)
OutFile.WriteLine("_____LEFT: " & Me.Controls(i).Left)
OutFile.WriteLine("_____TOP: " & Me.Controls(i).Top)
OutFile.WriteLine("___WIDTH: " & Me.Controls(i).Width)
OutFile.WriteLine("___HEIGHT: " & Me.Controls(i).Height)
Next i
John A
|
|
|
|
|
I'd forgotten about this. Glad to hear it's going well.
You have to be careful trying to produce a general solution that will work with all versions of Access.
I did something similar (but a bit more complicated) in Access 97, only to find it broke in Office XP.
Microsoft changed the object model.
Regards
David R
---------------------------------------------------------------
"Every program eventually becomes rococo, and then rubble." - Alan Perlis
The only valid measurement of code quality: WTFs/minute.
|
|
|
|
|
Good point (& thanks for the follow up). My version is "MS Access 2002 (10.6771.6847) SP3", which I believe is the "Office XP" version. Seems like that makes it two versions ago, I normally keep to VB as there is less of that sort of stuff (oops, notwithstanding that big one from VB6 to VB.NET nine or so years ago - my how time flies!). At that, I'm still using the .NET Studio 2003 & 2005 versions (and still keeping a VB6 machine alive, for that matter).
But you are right, as one ponders a "product" even a shareware one, version compatibility is a consideration and finding a break in the object model is certainly enough to "ruin one's day". I will post again if/when I have useful further info that warrants it.
Best Regards, John A
|
|
|
|
|
Hi,
I have created a macro through which I am able to read the above mentioned property.
but to get all property I had to call the macro from each form.
Is there any easier way to achieve the same result easily which will loop through all the forms and get all controls property like database documenter does.
Anyone has any idea about how database documenter works like which tables it queries to get all the database related information.
I got a helpfull query :
SELECT MSysObjects.Name FROM MsysObjects WHERE (Left$([Name],1)<>"~") AND
(MSysObjects.Type)=-32768 ORDER BY MSysObjects.Name;
which retrieves all the forms in a particular database but it doesn't get called from .net application.
I am getting Exception:
Record(s) cannot be read; no read permission on 'MsysObjects'.
I tried to resolved this using suggestion provided here :
http://www.justskins.com/forums/trouble-accessing-the-ms-59921.html
but I do not find 'MsysObjects' in object list.
Any help provided is much appreciated.
It's urgent.
Thanks
Ruchika,
ruchika.sharma83@yahoo.com
|
|
|
|
|
In C#, if I make a transparent windows form using transparency key colored "control", then on clicking anywhere on screen(while application is in focus), transfers focus of the app to the one behind it, which is normal behaviour.
If I want the application to retain the focus, is it possible to do anyhow ?
|
|
|
|
|
Use a timer to set focus? Maybe P/Invoke to SetWindowFocus?
|
|
|
|
|
I do not want the window to loose focus at all, because user will be drawing on this transparent window.
Isn't there a straightforward way to do it, than to hack/tweak things?
|
|
|
|
|
Did you try setting the topmost property to true?
|
|
|
|
|
Yes, I tried that. It is not effective.
|
|
|
|
|
|
How about skipping all this garbage and taking a screen shot and drawing on that instead. No need to worry about transparency and mouse clicks going to the wrong form at all.
|
|
|
|