|
Hi all
I am a newbie where programming with c# is concerned. One thing that seems to come up often when reading about it and .Net is that you can use different languages on a piece of code. Is that possible and how do you do it. I have written a simple application which has a page that has buttons (navigate with them). I also have a clock in the corner, but I would love to use <%@ Page Language ="VB" %> together with c#. This means that the language used in buttons is c# but the language used in the clock is VB. all of this in one page, one piece of code, is it possible?
Thanks in advance
Zee
|
|
|
|
|
In ASP.NET, this is easy. Use the syntax below, which is basically legacy supported from ASP:
<script runat="server" language="C#">
</script>
<script runat="server" language="VB">
'...
</script> With assemblies themselves, you actually have to compile modules in different languages, and then link them together into the same assembly (which includes a manifest of assembly attributes, dependency references, modules, and embedded resources).
There's a decent article over at my old stomping grounds, DevHood, here: http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=466[^]
-----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 guys,
I have a Mdi Container that can be minimized to tray. So when when I click minimized button I Hide the form and I show the notify icon.
The problem is that during the mdi parent is not visible, maybe I have to create new mdi child form. To create it:
Form f = new Form();
f.MdiParent = this;
f.Show();
but if the mdi parent is not visible the show method block the main process and I have to kill it.
Why?
Thanks
|
|
|
|
|
I have a 32x32 256 color cursor resource file in my C# executable application as an embedded resource.
If I load the cursor from there, using
this.Cursor = new Cursor( Assembly.GetExecutingAssembly().GetManifestResourceStream( "CursurTest.X.cur" ) );
...then the cursor appears all-black, but the shape is same.
However, if I construct the cursor using User32.DLL's LoadCursorFromFile, which returns a Handle, then it is OK.
How can I use an embedded cursor resource properly? I do not want to put the cursor as an external file.
|
|
|
|
|
I am writing a toobar for displaying the annotations on a page .I need to access the highlited section on the page in the browser .How do access an instance of a browser using C# . What are the classes/interfaces for this . Using those classes how do i get the highlited section on the page .
(ie if i make a text selection using the mouse how do i get this ).
How useful are the webbrowser class and the iwebbrowser2 interface .The webbrowser class is it used to access an instance of the browser or is the iwebbrowser2 interrface used to access the browser instance
Srikar Y
NITK Surathkal
|
|
|
|
|
In COM programming, you always access servers (those implementing the functionality, ex. WebBrowser control) via their interface. In C++, you are given the WebBrowser's IUnknown as a site, which you can QI for the IWebBrowser2 interface and use that to access the COM control. Since you're in the C# forum, I assume you're using .NET. In this case, you get an interface to the web browser however your implementation gives it to you.
Since I don't know what implementation you're using, I can't solve your problem but can at least give you some idea of what is wrong.
-----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 stylesheet XML structure, represented by a class with a dictionary of attributes in it. These attributes are all serializable in one way or another, but they are not always directly serializable to XML - sometimes they must be serialized as binary data.
If this stylesheet is saved as a file, I want it to be an XML file, in which case the bitmaps, etc, could be saved to individual files. If it is serialized (to a resource, etc), I don't care whether it's human-readable or not.
So I'm dealing with two different types of serialization of two different types of data. What do you think is the best choice? :
Serializing to a file:
<list>Serialize all non-XML data (bitmaps, etc) to separate filesStore the non-XML data as hex/Base64 directly in the XML nodesStore the non-XML data in separate nodes at the bottom of the XML fileStore the non-XML data in a single binary serialization fileBinary Stream/Resource:
<list>Serialize all non-XML data (bitmaps, etc) to separate streamsStore the non-XML data as hex/Base64 directly in the XML nodesStore the non-XML data in separate nodes at the bottom of the XML textStore the non-XML data in a single binary serialization stream and the XML data in anotherStore both the XML and the non-XML data in a single binary stream
|
|
|
|
|
OK, what I've decided to do is this: embedding of Base64 is allowed in both file and resource versions. If someone wants to use file bitmaps, they can just use a path instead of bitmap data.
Kinda obvious, huh?
|
|
|
|
|
Hi Friends,
I want to transfer the data across the Process , which is the least time consuming way? (Not for coding but for performance !)
VikramS
|
|
|
|
|
In .NET, two processes are bound by different contexts, namly AppDomains. To do this, you must either P/Invoke A LOT of code, or use .NET Remoting. There are several great sections about .NET Remoting in the .NET Framework SDK, and it is the recommend method for doing so (because it is the least time-consuming way, and is the "correct" way between two .NET 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-----
|
|
|
|
|
Actually I wrote the Mouse Hook inside a native Windwos DLL.But I want to route all these mouse messages through my C# application or DLL.Like
Hooked App->Native DLL->C# (App/DLL)
As these messages carry data and going to be very fast , .Net remoting will help better performance?
VikramS
|
|
|
|
|
No, .NET Remoting wouldn't be the answer. It's best for .NET<-(context)->.NET (that is, two .NET applications across different contexts).
What is loading and registering your hook now? The only two methods I know of is from the registry (although some hooks can't be loaded that way and I don't remember if systems hooks can) or some native app? You could, perhaps, you P/Invoke to load and register (or call a wrapper functions in your DLL that does that) from your .NET app. Then you could either use IMessageFilter and Application.AddMessageFilter to watch for the messages that your DLL would route to it's calling app (not sure about the feasibility of that one) or register a Delegate (function pointer, i.e. callback) via it's handle (as an IntPtr , by calling myDelegate.Method.MethodHandle.GetFunctionPointer() . I should warn you, though, that this is untested but seems like it should work.
Otherwise, if the apps need to be disjoint, you may have to use IPC.
-----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
How can I request a web page using POST while passing some variables? Like I want to access
http://www.localhost.com/info.aspx
with POST and with variables info=0 and set=1 ?
thanks in advance;
mE
---------------------
A gasp of breath,
A sudden death:
The tale begun.
A rustled page
Passes an age:
The tale is done.
|
|
|
|
|
The easy way is with the System.Net.WebClient class, which has an OpenWrite method that you can pass a URL and "POST" (as the second param). Then you just write your &-delimited name/values pairs to the stream.
This is just a wrapper for doing the same thing - in concept - using the WebRequest and WebResponse classes. All these things have good examples to show you (especially the WebClient.OpenWrite method overload list page).
-----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-----
|
|
|
|
|
Can you install CLR with Windows Installer? Including .NET as part of the installation package on a CD? Thanks.
|
|
|
|
|
Yes, but first you have to nullify the code for the render engine. After that it is a simple process of byte relay to byte relay. Astro Physics 101.
/\ |_ E X E GG
|
|
|
|
|
I have this hellish class, "logging.cs" with an equally hellish method deep inside it's bowels, "populate.cs".
public void populate()
{
logForm.Show();
}
Now I as it has came to pass, this method is running on a thread.
Now, as the method, and/or class ends, the thread apparently is killed by garbage collection.
So, as you can see the method would run and the form "logForm" will 'show' but for only as long as it takes for the computer to finish the method, and consecuently kill the thread, which closes my form.
This here, is my problem.
Now, here is my question.... How can I keep the thread running, or at least the form???
Is this annoying?
/\ |_ E X E GG
|
|
|
|
|
Run populate on another thread and then show the form as modal with ShowDialog() instead of Show(). The form will stay open even if your original thread ends and this new thread won't end until the form is closed.
|
|
|
|
|
Oh, my god.... oh my god. it's so simple...
So, now here's the question.
How much money do you want?
/\ |_ E X E GG
|
|
|
|
|
eggie5 wrote:
Oh, my god.... oh my god. it's so simple...
Simple, yes....but I'll admit it recently had me stumped for a while!
|
|
|
|
|
How do i use them and what i can use them for?
Thanks
Da Intern
|
|
|
|
|
Q: What is API?
A: Application Protocol Interface, it's a system of functions/methods usually provided by a 3rd party used in your code.
Q: What are they for?
A: Depends, too general of a question.
|
|
|
|
|
Daniel M. Edwards wrote:
Protocol
Programming
|
|
|
|
|
I wonder how long it would take to become a Senior Software Engineer asking this broad, general questions and hoping for an answer in a forum like this.
I think that if you are at the level where you don't even know what API stands for, buying entry level books would be so much helpful on the road to become a professional programmer.
Regards,
Carlos H. Perez.
|
|
|
|
|
Very good advice, and very nicely put, too.
Christian
I have drunk the cool-aid and found it wan and bitter. - Chris Maunder
|
|
|
|