|
Use multiple render targets. Remember a render target does not have to be a form object. PictureBox works well. Its been a while since I worked with DirectX9 but I can dig up some from work if need be.
|
|
|
|
|
Hi everyone,
Well i have a little problem. I have recieved some source code written in java that performs some xml parsing. I need to design a front end in C# and allow to call the java app. I'm currently doing that through a bat file which i call through System.Diagnostics.Process class. However, this "hangs" my c# program and i want the user to be able to see the output of a program in large text box (with scroll bars) within the form, in real time. Also, i have an animated gif that should continue to loop without being interupted. As soon as i execute process.start(), the program "hangs" while the java app runs in the background. The gif stops animating... the form looks funny with some control's dissapearing .. etc. What is the best way to do this?
Thanks.
I have read up on multi threaded applications on using them to update UI controls while processing in the backgroudn.. however the stuff was a little over my head.. any help would be appreciated.
|
|
|
|
|
|
Build an enterprise application for a customer with aprox. 100 Clients ???
HI!!!
If you would happen to get the chance to build an enterprise application
for a customer with aprox. 100 Clients (…and increasing) which technology
and architecture would you choose. The security policy is pretty strong
so we would have actually only port 80 available. Besides that no deployment
effort on client side is desirable. There is a 100Mbit LAN and this new
application would be deployed on the intranet (internal network).
The GUI of this application should be very rich and fast like win32 applications.
What would you propose in order to fulfil those requirements.
It is an enterprise app… so inputing data, printing invoices,
packing lists, reporting, etc
Clients are win xp machines It processes data on the server mainly,
the presentation is on the clients Data is stored in a database
100Mbit has to do with the access speed to the backbone resources
from clients.(only port 80)
Any hints, links and ideas will be highly appreciated
Regards,
gicio
|
|
|
|
|
Is smart client applications THE SOLUTION????
gicio
|
|
|
|
|
|
This application rockz!!!!!!!!!!!
regards,
gicio
|
|
|
|
|
Hi,
I have a datagrid filled with a table having 15-20 columns.At a time only 4-6 are visible without scrolling in a datagrid.Now I want to select a particular column header for my application.So I want to keep a check box on each column header and so that I can select the check box in the header.How do I keep this?
Karteek
|
|
|
|
|
Hi all,
I need to call a constructor from an unmanaged C++ dll and then call some functions based upon it. The header for the dll is this:
#define SIMPLE_PLAYBACK_EXPORTS
#ifdef SIMPLE_PLAYBACK_EXPORTS
#define SIMPLE_PLAYBACK __declspec(dllexport)
#else
#define SIMPLE_PLAYBACK __declspec(dllimport)
#endif
#ifndef CONSOLE_ELEMENT_H
#define CONSOLE_ELEMENT_H
#include "simple_playback.h"
#include "pa_synth.h"
class SIMPLE_PLAYBACK console_element {
public:
int active,ready;
pa_synth *ce_synth;
simple_playback *ce_simpleplay;
console_element::console_element() {
this->active=-1;
this->ready =-1;
};
/*
* Constructor
* file: the file that contains a monophonic 16 bit wav file
* rep is a flag telling whether you want to repeat (1) or play once (0)
* if you choose to repeat then rep_per_sec are the repeats per second
* After Calling the constructor playback starts automatically
*/
console_element::console_element(char *file,int rep,int rep_per_sec) {
ce_simpleplay=new simple_playback(file,rep,rep_per_sec);
ce_synth =new pa_synth(ce_simpleplay);
};
console_element::~console_element() {
delete ce_synth;
if (ce_simpleplay) delete ce_simpleplay;
};
};
#endif
From other readings i'm guessing that I have to use DllImport, but I'm not quite sure how to go about it. Can anyone provide an example?
Many thanks, G
|
|
|
|
|
You'll be much better off using a C-style class factory to create and destroy your class instances, and then declare your extern methods using CallingConvention.ThisCall . So, in your unmanaged C/C++ DLL, define something like this:
#ifdef __cplusplus
extern "C" {
#endif
__declspec(dllexport) LPVOID CreateClass();
__declspec(dllexport) void DestroyClass(LPVOID lpBuf);
#ifdef _cpluscplus
}
#endif Later in your code, define those declarations so that they new and delete the class. This is because DllImportAttribute cannot be used to instantiate classes. For your methods, you declare those two functions using IntPtr and then define all your class's methods using the CallingConvention.ThisCall like so:
[DllImport("mylib.dll")]
private static extern IntPtr CreateClass();
[DllImport("mylib.dll")]
private static extern void DestroyClass(IntPtr inst);
[DllImport("mylib.dll", CallingConvention=CallingConvention.ThisCall)]
private static extern int Add(IntPtr inst, int a, int b); To use it, create your instance and call the method with the pointer from CreateClass :
IntPtr inst = CreateClass();
int total = Add(inst, 1, 1);
DestroyClass(inst); If you need to pass parameters to your constructor, modify (or overload) the CreateClass function both in your unmanaged and managed code and pass the necessary parameters.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Nice use of design patterns, Heath!
I tend to agree. Trying to "new" an object in an unmanaged DLL would be ugly, if it were even possible.
Jeremy Kimball
|
|
|
|
|
Hi,
Can anyone tell me how to add intellisence descriptions to an object, function, and or property? I think it has something to do with adding text in [] above a object, function, or property but that's just a guess.
Thanks
|
|
|
|
|
XML Comments are your friend.
"You can have everything in life you want if you will just help enough other people get what they want." --Zig Ziglar
|
|
|
|
|
You must document your source (or go through the pain-staking process of writing an XML document that conforms to the standards, which is difficult and your source should be documented anyway) and generate an XML document from it. For instance, do something like this:
public class MyClass
{
public MyClass()
{
}
public int SomeMethod(int param1)
{
return param1 + 1;
}
} In VS.NET, right-click on your project and select Properties. Set the configuration to "All Configurations" (recommended) and find the Configuration Properties/Build section. Specify a name in the "XML Documentation File". If you don't specify a path (so just a filename), the filename is written to the build directory (like bin\Debug or bin\Release depending on the build configuration at the time of compiling). This is the same as the /doc option for the csc.exe command-line compiler.
See Recommended Tags for Documentation Comments[^] for more information. You can use any tags, but you should at least use these (like many documentation compilers like NDoc[^] that I help with will also recognize <b> tags, <p> tags, etc.).
When you deploy your assembly, make sure the generated XML document has the SAME name as the assembly, only that is has a .xml extension instead of .dll. VS.NET (and other editors of any decent value) will query for this file and use it to display comments for your assembly in the source editor.
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hi,
I looking for using a modem in c#.
I generate a tone signal in function the quality of a signal that I want to ear from a GSM for pointing an antenna.
If anyone have a link or sample to using a modem with c# is great.
Best Regards
youssef
|
|
|
|
|
There is no class in the FCL for serial modem comm. You can use a 3rd party .DLL to get to a modem and control it over a COM port.
Try http://www.marshallsoft.com/wsc4vb.htm[^] for a shareware version with examples.
RageInTheMachine9532
|
|
|
|
|
There was an article and base class in an issue of msdn magazine for RS232 communications in .Net. I am currently using this class with great success however no for modems but multiple serial devices. There is modem specific functionality within it though.
http://msdn.microsoft.com/msdnmag/issues/02/10/NETSerialComm/default.aspx
Should be fine with licencing issues as well.
|
|
|
|
|
I have a C# web service that runs fine until after some number of calls have been made. After this every attempt to call any method generates the following SOAP exception
[thread 0x6a4] Unhandled exception generated: (0x04ab6e7c) <System.Web.Services.
Protocols.SoapException>
code=(0x04ab6068) <System.Xml.XmlQualifiedName>
actor=<null>
role=<null>
detail=(0x04ab6d54) <System.Xml.XmlElement>
subcode=<null>
_className=<null>
_exceptionMethod=<null>
_exceptionMethodString=<null>
_message=(0x04ab645c) "Server was unable to process request. --> Timeout expir
ed. The timeout period elapsed prior to obtaining a connection from the pool.
This may have occurred because all pooled connections were in use and max pool s
ize was reached. " If I restart the server or restart IIS, things get cleaned up and functioning again. Until some number of calls occurs again and I'm back to the restarts. I suspect that some pool needs cleaning up, but I'm not sure how to cause this to happen automagically. Any ideas? Thanks.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
Make sure that if you're using database connections, you're closing all connections (returning them to the pool, if pooled) when done. You can use the using keyword in C# to automatically dispose (and close) these, or manually code to what the using keyword would compile:
SqlConnection conn = null;
try
{
conn = new SqlConnection("...");
}
finally
{
if (conn != null) conn.Close();
} If you're not manipulating databases, could you provide a few more details about your implementation?
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hit the nail on the head. The class that implements the web service methods establishes a database connection in it's ctor. I haven't included a dtor to close the connection.
Thanks for the advice.
Chris Meech
We're more like a hobbiest in a Home Depot drooling at all the shiny power tools, rather than a craftsman that makes the chair to an exacting level of comfort by measuring the customer's butt. Marc Clifton
VB is like a toolbox, in the hands of a craftsman, you can end up with some amazing stuff, but without the skills to use it right you end up with Homer Simpson's attempt at building a barbeque or his attempt at a Spice rack. Michael P. Butler
|
|
|
|
|
If I want to delete a contact in XML using C# I can do this:
XmlNode deleteContact = contactDoc.SelectSingleNode("descendant::Contact[FirstName='Sanddy']");
contactDoc.DocumentElement.RemoveChild(deleteContact);
But I want to make a textbox where I give in the name and then that person is deleted, but I can't find how to do it.
Thx in advance
|
|
|
|
|
Same way your doing it.
<br />
string strXPath = "descendant::Contact[FirstName='{0}']", txtBox.Text;<br />
XmlNode deleteContact = contactDoc.SelectSingleNode(strXPath);<br />
contactDoc.DocumentElement.RemoveChild(deleteContact);<br />
|
|
|
|
|
How is ulong ulong (64 bit c int) marshaled? Do i just put them in a sequential structure? Or is it more complicated than this?
I'm currently trying to marshal it like this:
[StructLayout(LayoutKind.Sequential)]<br />
public struct cLargeInt<br />
{<br />
public int low;<br />
public int high;<br />
}
But i get a lot of funny results.
Cheers
Cata
|
|
|
|
|
Just marshal it as a long (Int64 ) or ulong (UInt64 , and not CLS-compliant).
Microsoft MVP, Visual C#
My Articles
|
|
|
|
|
Hello,
I need to build an MDI application. After opening forms as MDI Child if I need to open further form from those MDIChild form it don't follow MDI Application. So how can i make a form as MDI child of the form which is already an MDI child.
Thanks for ur support
Inpreet Singh
|
|
|
|