|
Many developers have made fine games using VB, thus using C# should be more or less the same.
Of course there are bottlenecks. For instance a .Net application needs at least 4 seconds before it starts (time required for the CLR to compile IL code into assembly code). So don't expect much about time response.
You have at least two options :
- use plenty of ActiveX, for instance the one from Macromedia
- use the System.Drawing assembly, even though you'll end up as with Java 1.0 back 4 years ago : in other words, 1. anything you do requires you to manage your own double buffers, and optimized drawing so the screen does not flicker. 2. the object model is primitive : for instance you cannot draw an arrow. 3. Transparency API ? play with caution, some features will work only on W2K/XP systems. 4. DirectX ? never assume that what works fine on your computer will work on someoneelse's computer. That's the conclusion I made after 2 years of DirectX struggle (where the so-called hardware abstraction at the basis of the whole stuff, is in fact a complete lie). Besides that, manipulating all interface versions will require a full-time job just for it.
And I swallow a small raisin.
|
|
|
|
|
You mite want to consider DirectDraw as it will provide wit an overlay layer if available allowing the CPU to be freed up alot. But its only really worth it if you are using alot of drawing.
Alternative is what is said above, using the Shockwave Flash ActiveX control in you application. Search the forum for FLASH , i put some code in a post a while back on how to use the ActiceX control.
Hope this helps
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
To all interested, I have updated nBASS to have WMA Streaming support as well WMA encoding to file and network.
Here the link to the source (251kb)[^].
Naturally , you will need bass.dll and basswma.dll from the BASS home page[^].
Here's the changes:
nBASS 0.9.3 (1 September 2002)
- Added WMA streaming support, needs basswma.dll (duh!)
- Added WMAStreamTest with visuals.
- Added FX Parameters property. FX can now be tuned.
- Added GetData(byte[] buffer, int length) to AdvancedChannel.
- Added Stereo FFT flags.
- Added WMA Encoding, woohoo, net radio!
- Added WMAEncoderTest.
nBASS 0.9.2 (29 August 2002)
- Add ProgressInterval property to ChannelBase
- added AdvancedChannel.GetData()
- added StreamTest with visualizers (same as VB.Net) with stereo
- all Debug projects now outputs to a single bin dir in the root. Copy bass.dll & basswma.dll there.
- Increased Progress event to fire even quicker. From 100ms to 20ms.
The source is also nice for seeing a variety of marshalling problems I encountered along the way. You can compare with the docs provided with bass.dll.
To all who finds this usefull, enjoy
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
So when can we expect an article detailing what you had to do to expose BASS to .NET?
A link to the BASS homepage in your post would be great as well
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
James T. Johnson wrote:
A link to the BASS homepage in your post would be great as well
Done
James T. Johnson wrote:
So when can we expect an article detailing what you had to do to expose BASS to .NET?
I'm just recovering from what i feel was some scary marshalling, i'm not sure if everything is even 100%. I will do some testing to see, but I really want to finish the Record part first. I have a very nice a idea for a Voice over IP app doing 2 way encoding from live sources. I would also like to included more documentation, but you know how it goes
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
Hi
I have tried to insert an image into a RichTextBox component but with no result. I have tried with CreateGraphics and drawn an image into it but when I type over the image, it dissapears.
If I load a rtf file containing an image it works just fine but how can I include an image programmaticaly?
I included a Com object RichTextBox6.0 and it has an array of ole objects with the add method but I don`t know what to give it as parameters.
Add(object index,object key,object source,object objclass);
Can anyone help me?
|
|
|
|
|
You have to do it in Paint event I guess.Maybe you can subclass it and handle Paint yourself.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Yes but if I handle the Paint event then I have to do all the implementation of the text formatting and location and everything else.
|
|
|
|
|
Try this ....
//load the image
System.Drawing.Image myimage = System.Drawing.Image.FromFile("Sample.jpg");
//create a picture box
PictureBox mypb = new PictureBox();
mypb.Image = myimage;
//adjust the size
mypb.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.richTextBox1.Controls.Add(mypb);
|
|
|
|
|
It works but the text I write is written under the picture.
|
|
|
|
|
I write simple web services and add this method to it:
[WebMethod]
public string ReverseString(string message)
{
char[] arr = message.ToCharArray();
Array.Reverse(arr);
message = new string(arr);
return message;
}
When I want to test it in my browser and press Invoke button in new browser his error happend:
System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'E:\WINDOWS\TEMP\p3tapjny.0.cs' could not be found
error CS2008: No inputs specified
at System.Xml.Serialization.Compiler.Compile()
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
at System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type, LogicalMethodInfo[] methodInfos)
at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Hey, Maz
I've just run this and it works fine.
Mazdak wrote:
error CS2001: Source file 'E:\WINDOWS\TEMP\p3tapjny.0.cs' could not be found
What's the name of your class?
Cheers,
Simon
"Sign up for a chance to be among the first to experience the wrath of the gods.", Microsoft's home page (24/06/2002)
|
|
|
|
|
Hi all
How does one do this. I have a component that needs a handle to a window on construction, but how can I get the Handle of my Form in design mode??
Thanx all
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
|
Hi
U mean the Open Folder Dialog? I'm sure ther is example in the article section.
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|
|
You've got an OpenFile control in the Toolbox Window waiting for you,
And I swallow a small raisin.
|
|
|
|
|
There are some component in CP.Check C# section.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
How is it done? Does anyone have any examples of a C++ app calling a C# DLL?
Can the code in the below zip be converted straight to C#?
http://girlpower2.dhs.org/downloads/shodan_plugin_sdk.zip
|
|
|
|
|
I just gave a look in MSDN to make sure there was no solution, and I have found that if your managed code exposes COM public interfaces and methods, then yes, it is possible to do it. This does not look easy, and the C# DLL must be rewritten to expose interfaces, and stuff. Just give a look here.
And I swallow a small raisin.
|
|
|
|
|
Problem:
During develpoing my application I have changed name of namespace for my main form app.
My app namespace is Analyzer my MainForm namespace is Analyzer.View
Now I am trying to add some ImageList to my MainForm. During running application MissingManifestException is thrown. I have chacked Manifest using Ildasm and there is an entry
<br />
.mresource public Analyzer.MainForm.resources<br />
In my opinion shoud be
<br />
.mresource public Analyzer.View.MainForm.resources<br />
Recompiling doesn't help. Is this mean that MainForm.resX is in wrong (old) namespace? If yes how to change this namespace?
|
|
|
|
|
Hi,
Well, I guess it's a design quesiton.
I try to write a layout engine with two classes in it. The LayoutPanel class acts as a container for either LayoutPanel or LayoutItem, where LayoutItem is simply an object that stores the width and height of a visible item. and here is my solution:
class LayoutPanel: Component, IContainer
class LayoutItem: Component
is this ok? or better to have an abstract class on top of both (because both of them have widths and heights as attributes).
Thanks
|
|
|
|
|
Hey what's up coders...
I guess my question is pretty much the subject but the software I am interested in selling includes a few of the shell32.dll icons! Is this software still sellable or is microsoft gonna get me?
If anyone knows it would be much appreciated if they could get back to me.
Thanks so much.
|
|
|
|
|
I think you should modify them by a few pixels each to be safe.
Regardz
Colin J Davies
Sonork ID 100.9197:Colin
You are the intrepid one, always willing to leap into the fray! A serious character flaw, I might add, but entertaining.
Said by Roger Wright about me.
|
|
|
|
|
Initially, I want to fetch or get a file from another machine either through local net or network share, and "win32_find_data" seems to be a good package for this task. But if I want to use it in C# or VB.NET, how should I do it? Or is there any other package I can use? Thanks a lot!
|
|
|
|
|
Hi
You will need to define 2 structures in C# first namely, FILETIME and WIN32_FIND_DATA. As:
struct FILETIME {
int dwLowDateTime;
int dwHighDateTime;
}
struct WIN32_FIND_DATA {
int dwFileAttributes;
FILETIME ftCreationTime;
FILETIME ftLastAccessTime;
FILETIME ftLastWriteTime;
int nFileSizeHigh;
int nFileSizeLow;
int dwReserved0;
int dwReserved1;
string cFileName;
string cAlternateFileName;
}
[DllImport("kernel32.dll")]
static extern IntPtr FindFirstFile( IntPtr lpfilename, ref WIN32_FIND_DATA findfiledata);
[DllImport("kernel32.dll")]
static extern IntPtr FindClose( IntPtr pff);
public static WIN32_FIND_DATA FindFile(string filename)
{
WIN32_FIND_DATA fd;
IntPtr pff = FindFirstFile(Marshal.StringToHGlobalAuto(filename), ref fd);
if (ppf == IntPtr.Zero) throw new FileNotFoundException();
FindClose(ppf);
return fd;
}
Thats should do it, didnt check. Perhaps the TCHAR in the structs, but this should set u well on your way. Obviously, you can Add the other FindFile functions as well.
Maybe there is something in .Net doing the same already???
MYrc : A .NET IRC client with C# Plugin Capabilities. See
http://sourceforge.net/projects/myrc for more info.
|
|
|
|