|
Welcome
How to show dialog which allows user to choose data source befor open connection to database.
Using Visul C++ you can do:
conn.Open(NULL)
and what about C#
(I use SqlConnection class)
Tomiga
|
|
|
|
|
I had just read the article "Runtime C# Expression Evaluator" in codeproject.
It seems the compiler of C# or other .net language can be called by user program. Maybe it is possible to make new .net application customized by prepareing a interface to accept outside script (any language). Then user program call the comiler to compile the script as a plugin. Then we can have plugins by any language you like.
can it be realized?
|
|
|
|
|
If I understand you correctly, you're asking if it's possible to add scripting language capabilities to unmanaged application that accept .NET languages.
The answer is Absolutely! In order to implement this, you need to write a "CLR host" for the unmanaged application. In fact, Yukon - the next version of SQL Server - is still unmanaged, yet will allow users to program stored procedures with .NET languages (instead of being confined to using TSQL).
Cheers,
Tom Archer
Author, Inside C#
Author, Visual C++.NET Bible
A total abstainer is one who abstains from everything but abstention, and especially from inactivity in the af
|
|
|
|
|
Thank for your info.
My English is rather limited.
What i really mean is if we create a fairly large application, we will need some macro or plugin ability just like VBA in Word, or VBS in Visual Studio.
Now if the compiler is provided by language vender and we can call compiler in runtime and run the compiled result, then we have the capability to contain any language as a macro or plugin tool. So user will use C# or even Fortran to write plugin for NewWord.
Can it be realized?
|
|
|
|
|
nova chen wrote:
Now if the compiler is provided by language vender and we can call compiler in runtime and run the compiled result, then we have the capability to contain any language as a macro or plugin tool. So user will use C# or even Fortran to write plugin for NewWord.
Can it be realized?
Yes, but the Fortran.NET compiler would have to be on the users computer in order to use it.
You also need to expose an API/object model to the script writers so they can do something to interact with your program.
James
Simplicity Rules!
|
|
|
|
|
Is there any tools to analyse the performance of C# program? What i care about is the speed of procedures in an algorithm.
I use VS7, but can't find a tool like profiler in VC6.
Tried to write a profiler for C# like the QProfile in CodeGuru, but i find it impossible because C# doesn't accept static variable in procedure. Then measure the time cost of a single procedure is not easy, or will cost a lot (for example use a string name or a unique number as a hash key to show which procedure is the profiler reached). Any suggestion?
|
|
|
|
|
I have been using Compuware/Numega DevPartner Profiler (Community Edition). It's Free.
Still waiting for the sales rep to call back when the Studio suite is available for VS.NET, they said around june for the upgrade from version 6.6. It's not Free.
|
|
|
|
|
BTW, If you do decide to check out the afore mentioned tool, a word of warning.
The installer that I used did NOT suggest to reboot my machine after it was finished.
Reboot your machine after installing it and before you actually run it. Otherwise VS.NET might do it for you. It BSOD’d my machine.
Sorry if it already bit you, it’s just been a long time since I installed it, it slipped my mind.
Regards
|
|
|
|
|
Neil Van Note wrote:
It BSOD’d my machine.
What's "BSOD" ??
Maxwell Chen
People say "No news is good news". Then, no code is good code!?
|
|
|
|
|
Blue Screen of Death, in other words windows got messed up to the point it couldn't recover.
James
Simplicity Rules!
|
|
|
|
|
Like James said, It torked my machine bad enough that it decided it was time for a reboot. Although, Under XP I choose to call it the Black Screen of Death...
I thought is was cute how XP volunteers to phone home to MSFT after a crash though.
|
|
|
|
|
Ohh, a fairly good tool.
I download and run the 6.7 prerelease. It work smoothly and have not find any BSOD yet
But still some limits according to my usage, I wanna analyse some procedure not all. The later solution give too many data that confused my eyes. i will rather have a library like QProfile. You can manually write a static object in a procedure you focused. when in its contruction take a time mark and in its destruction take another. then have the subtration of them, we have a time span of one run. Finally have several run's spans summed, you have the time cost of this procedure in your application. But this design is difficult to apply on C# because it shorts of the feature of static variable in procedure(function).
|
|
|
|
|
It does have such features, plus an API, although I don't know if they are present in the community version.
|
|
|
|
|
Can someone give a a good explanation of what DoubleBuffering is. Also while I am making requests , since the String data type is immutable(Am I correct?) is there a mutable data type like StringBuffer available in C# like there is in other languages? Someone clear me up on this. Thanks.
Nick Parker
|
|
|
|
|
System.Text.StringBuilder
|
|
|
|
|
In short, double buffering is the act drawing to an off-screen graphics context and then blitting it to the screen in one action. Sorry No time for a good explanation.
|
|
|
|
|
DoubleBuffering is a common graphics drawing algorithm. Basically, you "draw" everything in a bitmap in memory. When a screen refresh occurs, you put your drawn bitmap on the video memory.
This way, you avoid partially drawn frames: they are ugly and kills action and animation on a game or multimedia app, for example. Even a common form on the screen can be improved with doublebuffering, because the app appears to be faster and more responsive. Movement with double buffering usually is very smooth.
But there is no free lunch. First, you have two writes and a performance hit: one write on main memory, second a data transfer to the video card (ok, normally very fast).
Second problem: because you only transfer the buffer to screen when it's drawn, performance falls at fractions of video refresh speed.
E.g: you make a simple animation and double buffer to a 60Hz video mode. So, you get 60 FPS (frames per second). So, you start adding more details to each frame and keeping 60FPS. Suddenly, you add a little more detail and animation falls to 30FPS. A little more and 15FPS. A little more and 7 FPS. So, your very responsive app can become a slow one.
I'm not sure (because of my english) if I was clear enough. There are (lots of) other animation algorithms and some workarounds to the problems I told you, but the basic issues are those.
Crivo
Automated Credit Assessment
|
|
|
|
|
Thanks that was a great explanation really, very well put.
Nick Parker
|
|
|
|
|
I have create a custom Windows form control and enabled the built in double buffering with:
this.SetStyle(ControlStyles.DoubleBuffer & ControlStyles.UserPaint & ControlStyles.AllPaintingInWmPaint, true);
but this does not help my flicker problem at all... From what I have read that will work in controls, Right?.?.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
this.SetStyle(ControlStyles.DoubleBuffer | ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint, true);
|
|
|
|
|
DOH! Well that was part of my problems, but even with that it still flickers like crazy. I have that enabled in my Windows Form control and the parent form. Any other suggestions?
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
Are you doing all your drawing during the Paint event?
Thats the only time that the double-buffering is actually used.
James
Simplicity Rules!
|
|
|
|
|
It's all in the Paint event. To make things worse. I copied and pasted all my code into a form and it works like a charm. I'll dig in more into the control but something isn't right with that.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
DOH! It was so stupid I won't even admit what I did.
Joshua Guy Sonork ID: 100.9944
ICQ: 519642
Hotmail: JoshuaJGuy@hotmail.com
|
|
|
|
|
But you must tell us, if not for us do it for the children; think of the children who may fall into the same trap you did.
James
Simplicity Rules!
|
|
|
|