|
Yeah I read the example over a couple of times, but I'd like a more concrete example. That is if that is possible of course. And I also have to say that I code in notepad/mono =)- Dont have VS.NET.
And yes there is indeed mostly information in C++, but there has to be some good ones in C# too.
Hmm..
//- UP THE IRONS, MORTEN S. KRISTENSEN -\\
|
|
|
|
|
Morten Kristensen wrote:
And I also have to say that I code in notepad/mono =)- Dont have VS.NET.
Good for you. I do a lot of coding in GViM, but what does that have to do with anything? You don't need VS.NET to code these solutions.
Morten Kristensen wrote:
but there has to be some good ones in C# too.
There has to be? Someone has to be first. If you do a search on CP like I said, you'll find plenty of related articles about how to emulate a console window. The first link was how to actually embed the cmd.exe console window. If you can't find decent material in .NET, P/Invoke the functions required in the good C++ articles. Not everything is available in .NET, not even when Longhorn comes out (though a LOT more APIs will be available for managed applications).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
but what does that have to do with anything?
Yeah so right... =)
Okay I think im gonna study again.. Thx Man
//- UP THE IRONS, MORTEN S. KRISTENSEN -\\
|
|
|
|
|
Does anyone know of any examples of a document/view model in c#?
Thanks a ton,
|
|
|
|
|
There's been a recent multi-part article on document-centric applications on the Microsoft Developer Network (MSDN): http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnforms/html/winforms09182003.asp[^]. As a developer, you should frequent not only CodeProject but MSDN as well - it contains a HUGE library of API and framework documentation, plus thousands of articles and tutorials on practically any Microsoft-related technology (and even some non-Microsoft technologies) you can think of.
Note: I gave you the link to part 1. See the table of contents (TOC) on the left of the page for other other 2 or 3 parts.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I have a regular window application project by C#. I like to embed this window application on the browser which is a ASP.NET application. I used to program ASPX page with ActiveX control component from 3rd party.
How do I convert C# based application to activeX control so I can run on the browser? Once I create dll files within .NET 2003 environment (C# compiler), can I program a activeX control by either C#, VB and/or C++ in .NET?
Or is it impossible to use .NET dll with VB6.0 in order to create activeX control?
Thank you,
Young
Java and C# programmer
|
|
|
|
|
You don't - you can embed .NET controls in Internet Explorer. You can make an CCW (COM-callable wrapper) for your .NET control, though, so that you can script it. I've been working on converting an older article from another site, but this should help you: User Controls for Windows and the Web[^]. There's also an article by Nick Parker that goes a little more in depth about how to create a CCW for your .NET control here: Creating a CCW for COM enabled non .NET applications[^].
Note that all this still uses the <object> tag, but with a different format for the classid parameter: it is a URL to the assembly, followed by a # sign, then the fully-qualified type name for the Type that you want to embed. There is more information in MSDN about this deployment method: Deploying a Runtime Application Using Internet Explorer[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Is there a simple way to emulate console mode on a GUI form or dialog box? Perhaps an article or control somewhere? Would it be logical to create one as a derived Rich Text box?
Thank you,
Ray Gregory
|
|
|
|
|
Ray Gregory wrote:
Would it be logical to create one as a derived Rich Text box?
No! The RichTextBox is not really a line-driven control and would be left parsing lines - perhaps even RTF for multi-line commands or commands with tabs - and it would not be worth it.
There is one article here on CP that I know about that actually embeds a console window in an Explorer bar: Command Prompt Explorer Bar[^]. This might give you some tips about embedding it in your application, but make sure you know how to P/Invoke native functions.
You should also search[^] the CodeProject site for "console". There are many pages worth of hits, and the link above only searching C#/.NET/VB.NET article topics. Add MFC/C++ in there if you feel comfortable P/Invoking native functions.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hi, Guru
How to know at any time the Shift or Control key up or down. (console application)
Thank You.
Sorry for bad English.
|
|
|
|
|
Using Windows Forms, this is pretty simple. You can either get this information in the KeyEventArgs , or using the Control.ModifierKeys static property.
Since you're not using Windows Forms, you'll have to P/Invoke the GetKeyState function. You can either use the System.Windows.Forms.Keys enum, or if you don't want the overhead of referencing the Windows Forms assembly for a console app, you can find the VK_XXX constant values in the winuser.h header file.
See a previous reply I wrote here: http://www.codeproject.com/script/comments/forums.asp?msg=687790&forumid=1649&XtraIDs=1649&searchkw=GetKeyState&sd=9%2F23%2F2003&ed=12%2F22%2F2003#xx687790xx[^]
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
How can I format an integer into a string so that it is a fixed size (with leading zeros if necissary)?
In C++, I could do something like this:
int val = 1;
printf( "%03d", val ); And it would appear as "001" on the screen.
In C#, I can do something like this:
int val = 1;
Console.WriteLine( "{0}", val ); But I can't figure out how to format the "{0}" part so that what is printed on the screen appears as "001" instead of just "1".
Any assistance is greatly appreciated!
|
|
|
|
|
You should read the documentation for the NumberFormatInfo class and the String.Format method. You still can use format specifiers, but they work a little differently. For a similar format for "%03d", you would use Console.WriteLine("{0:000}", val) . This more closely represents the MaskEdit control commonly used in VB (and various ports).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Thanks! I was having a hard time trying to find the info in the documentation.
|
|
|
|
|
Don't worry. That little feature isn't actually documented, just like using a number after the "X" format code to manipulate hex values, like "X2" is used to format a byte so that you always get 2 characters per byte (necessary for hex values in many cases). I meant to mention that it isn't really documented in the .NET Framework SDK, but I only remember after I hit "Submit".
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ahh... you always beat me to it!
|
|
|
|
|
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Ah, Justin, shouldn't you know by now that there's no beating Heath!
"if you vote me down, I shall become more powerful than you can possibly imagine" - Michael P. Butler.
Support Bone
|
|
|
|
|
|
int val = 1;
Console.WriteLine( "{0,0:000}", val );
But the angel said to them, '...I bring you good news of great joy... Today in the town of David a Savior has been born to you; he is Christ the Lord.'
FLUID UI Toolkit | FloodFill in C# & GDI+
|
|
|
|
|
Hi, I need to serialize following class 'F'..., but is not working (propably because there are circular references, but in MSDN is something like "we support it". ). Any solutions ? thanx.
<br />
[Serializable]<br />
public class G {<br />
public F f;<br />
public G() {<br />
}<br />
public G(F f) {<br />
this.f = f;<br />
}<br />
}<br />
[Serializable]<br />
pblic class F {<br />
public G g;<br />
public F() {<br />
this.g = new G(this);<br />
}<br />
}<br />
Wizard_01
|
|
|
|
|
First of all, using the SerializableAttribute will not make the object XML-serializable if you're talking about the System.Xml.Serialization namespace classes (mostly, the attributes therein).
Second, what is the specific error that you're getting?
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
It wrote : "There was an error generating the XML document. A circular reference was detected while serializing an object of type WindowsApplication1.F."
from MSDN :
The serialization architecture provided with the .NET Framework correctly handles object graphs and circular references automatically. The only requirement placed on object graphs is that all objects referenced by the object that is being serialized must also be marked as Serializable ...
Wiizi
|
|
|
|
|
For serialization (such as the SOAP and binary formatters), yes, circular references are supported; but, for XML serialization they are not. SOAP and binary formatting for serialization (using the System.Runtime.Serialization namespace elements) uses IDREFs. XML serialization (using the System.Xml.Serialization namespace elements) uses simple nesting, so circular references are not supported. There is a vast difference between these two serialization technologies.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Oppps. And is possible to simply extend XML serialization with circular references ?
Wiizi
|
|
|
|