|
For example : I want to implement such feaures :
User copy some objects from a C# WinForm application and paste into a Word Document. When user double click the object in the Word Document, the application is started to show the object in application and user can manipulate that object.
How to do it in .NET world? Thanks!
|
|
|
|
|
Nothing built-in. You'll have to implement the neccessary interfaces via P/invoke.
mav
|
|
|
|
|
Hi,
One of my friend has problem in dotnet version 2002.
Problems:
1. Load report failed:
When we import Seagate Crystal 8.0 version report first time in the .net
2002 Project, it displayed but as we perform any modification in the
report, the load report failed error generated. The modification of any
type it may be of formatting or changing in the fields or in database.
If the report is generated after updating the database (MS SQL Server
2000 personal edition) with new records, the previous report is generated
whereas updated report is shown in the segate crystal report successflly
but this is not performed in .net.
2. Logon Failed:
When we use inbuilt crystal reports of .Net, with our own Sql database
the logon failed error generated but if we use inbuilt database such as
xtreme sample database, the report generated successfully.
Hoping for your help.
Thanks.
|
|
|
|
|
I ran the following (same) 2 small programs in C#.NET and then in C (Bloodshed Dev C/C++). The latter took more time than the former (4.7s vs 3.8s) - I thought this was counter-intuitive, and that a code written in C should run faster... Any Ideas?
C#:
---
public static void Main()
{
// variables
int i, i1=0;
int[] ar=new int[1000];
long l1, l2;
// first for loop - 1Billion iterations
for (i=0;i<1000000000;i++)
{
ar[i1]=i;
i1++;
if (i1==1000) i1=0;
}
// measure time
l1=DateTime.Now.Ticks;
i1=0;
// second for loop - 1Billion iterations
for (i=0;i<1000000000;i++)
{
ar[i1]=i;
i1++;
if (i1==1000) i1=0;
}
// measure time
l2=DateTime.Now.Ticks;
// print results
Console.WriteLine("Time befre: {0}",l1);
Console.WriteLine("Time after: {0}",l2);
l2-=l1;
Console.WriteLine("Time taken in seconds: {0}",(double)l2/10000000);
Console.ReadLine();
}
C:
--
#include <time.h>
main() {
// variables
int i, i1=0;
int ar[1000];
clock_t c1, c2;
// first for loop - 1Billion iterations
for (i=0;i<1000000000;i++) {
ar[i1]=i;
i1++;
if (i1==1000) i1=0;
}
// measure time
c1=clock();
i1=0;
// second for loop - 1Billion iterations
for (i=0;i<1000000000;i++) {
ar[i1]=i;
i1++;
if (i1==1000) i1=0;
}
// measure time
c2=clock();
// print results
printf("Time befre: %d\n",c1);
printf("Time after: %d\n",c2);
c2-=c1;
printf("Time taken in seconds: %f",(float)c2/1000);
getchar();
}
|
|
|
|
|
This ought to mess with you a little bit - NEITHER is faster than the other. Actually, it depends entirely on the code you write and environment it's running under. C++ will be faster for some things, while C# for others.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
maybe, but in case you make the same action, C will be faster as it doesn't use the .NET framework, and so, don't need to be reinterpreted from MSIL to assembly...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
toxcct wrote:
C will be faster as it doesn't use the .NET framework
Don't count it! The JIT compiler compiles code method-by-method on the first call only. After that, it doesn't need to be recompiled every time it's called. Plus, the JIT is very fast at it's job and has an advantage that the C++ compiler can never have. It knows at runtime exactly which processor its running on and it capabilities and can generate optimized native code specifically for that processor. This code has the possibility of exceeding the performance of the C++-based native code that is generated for a more general range of processors.
Also, every C/C++ program out there has its own runtime also. It's just built into the app. Depending on what features your using in Windows, it also can have the MFC libraries.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Here's my situation:
I have written a routine in .NET which uses repeated interations of integer arrays approximately 1000x1000 elements... The total time taken in .NET is around 2s, which is slightly greater than acceptable (I have explored all avenues for code optimization in .NET)..
I was hoping I'd be able to improve the time using C, and compiling the method into a dll..
Any suggestions?
|
|
|
|
|
Dave Kreskowiak wrote:
Plus, the JIT is very fast at it's job and has an advantage that the C++ compiler can never have. It knows at runtime exactly which processor its running on and it capabilities and can generate optimized native code specifically for that processor. This code has the possibility of exceeding the performance of the C++-based native code that is generated for a more general range of processors.
right...except that i did never realize this in my 'real world' programs.
are you able to proove this? can you give me any example where .NET is faster?
i can give you a lot of code where c++ is faster. exactly the same algorithm, exactly
the same implementation and c++ is at least 2 times faster.
i'm not bothered by c# beeing slower at all, it has its advantages, too. but i just
don't like everybody saying c# is not slower if it IS slower.
plz show me an example. i'll change my mind and shut up as soon as i can see with my
own eyes that c# is faster (or even equal) in general.
daniel.
|
|
|
|
|
I've got nothing to prove to you. All I said was that the JIT has the possibility of exceeding the performace of C++ based code. I, in no way, said that is was faster.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'll add that in this case your use of different development environments could potentially be a larger factor than c vs c#. While the relative performance will depend on what you're trying to do, a more meaningful comparison would be achieved by comparing c#s results with your C code ran using vc.
PS sharing benchmarks apparently violates the .net eula. Don't you feel horrible now. **rolls eyes**
|
|
|
|
|
These contrived examples will never accurately reflect speed of real world apps, and real world apps will differ in performance based on how well they are written. A well designed C# app will probably out perform a poorly written C++ app, although I'd tend to say that C++ will be faster than C# overall.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
It also depends on what the compiler does to optimize the code. The loop might actually be compiled into something that looks more like this:
i=0;<br />
while (i<1000000000) {<br />
ar[i1++]=i++;<br />
if (i1==1000) i1=0;<br />
}
---
b { font-weight: normal; }
|
|
|
|
|
Here's my situation:
I have written a routine in .NET which uses repeated interations of integer arrays approximately 1000x1000 elements... The total time taken in .NET is around 2s, which is slightly greater than acceptable (I have explored all avenues for code optimization in .NET)..
I was hoping I'd be able to improve the time using C, and compiling the method into a dll..
Any suggestions?
|
|
|
|
|
i'd recommend to do so and am quite sure it will be faster. just my experience...
please let us know the results if you're really checking this out.
|
|
|
|
|
Hi
I have an applet writen in C# that work with SQL Server 2000.
How can I transfare data from SQL to the applet without the WebService becouse it is very slow or how can i make the webservice work faseter?
Thx Alex
|
|
|
|
|
That is a very open and vague question with many potential answers. In order to help you it would be helpful to know: What are the constraints of your system? Where is your "applet" with relation to the SQL Server? Why are you using (or why do you think you need to use) a web service?
My: Blog | Photos
WDevs.com - Open Source Code Hosting, Blogs, FTP, Mail and More
|
|
|
|
|
For those of us interested in writing Internet Explorer plug-ins that can manipulate the surface of a user-selected web page, can anyone suggest resources with informatin on how to do this in C#?
I am trying to write an IE plug-in that overlays user-defined shapes on top of a web page, and am new to C# and COM. Any help would be greatly appreciated!
Thanks!
|
|
|
|
|
Hello,
I made a Pop up calendar that opens in a new window [win2] (with a calendar control) and puts the selected date in a text box on the original window [win1]. The window opening and passing the data back is done via Javascript.
I would very much like some way of making a specific function on the originating page [win1] to fire or to force the page to refresh. I have a crystal report that loads date dependant information and I use the popup to change the date on the form, but it won't refresh the crystal report right away. Something has to make the CR reload, and that is what I'm not sure of how to do.
Any advice, pointers, pages, code snippits would be very greatly appreciated.
NijaMunki
The wisest of the wise may err. - Aeschylus
|
|
|
|
|
You can call a function in the page from the popup window in much the same way as you pass the data back.
window.opener.yourFunction();
---
b { font-weight: normal; }
|
|
|
|
|
I had a simple .NET application successfully developed and deployed to a production environment.
Out client required another application, which is slightly different from the first application.
So I basically use the first application to develop the second application. I have successfully deployed the second application in my development PC, and it works absolutely fine. So I decided to deploy the application in the production.
First I deployed the application, in a PC that the login user has the administrative rights, The application was successfully deployed and it worked perfectly.
Then I try to install the application in the work stations that the login users do not have administrative rights to their PCs. When I double click my MSI, I ended up with the following error message.
“This advertised application would not be installed because it might be Unsafe. Contact your administrator to change the installation user interface option of the package to basic.”
I tried the following options
-------------------------------
- Change the Group Policies UI option to basic.
- Tried login as an administrator that PC, and tried deploying it.
- Workstations use the Active directory, and I changed the active directory UI option to basic.
I still have the same error. Please help me this pretty urgent.
|
|
|
|
|
You might want to check the .NET Code Access Security policies on the production server.
|
|
|
|
|
Hi,
I am developing application where in i need to fetch all mails from my external mailbox(POP3) without using any third party component, and than delete those mail from external mailbox.Can any body help me out in coding using C#/VB.net/ASP.net
Warm Regards,
Nirav Sarvaiya
|
|
|
|
|
OK... here's the problem... I have a .NET library compiled as a dll.
I include this dll in my web page using the <object> tag like so:
<object id="myObject" classid="http://somehost/somelibrary.dll#Naemspace.Class" viewastext="">
I can then access the methods/properties of this class from javascript like so:
function DoSomething()
{
var myObject = document.getElementById('myObject');
myObject.AnyMethod();
}
This all works fine, the problem is, I could really do with my embedded object 'contacting' javascript, you know, like with a javascript callback or something. I don't even know if this is possible, it was with ActiveX, but from a .NET embedded component can you execute javascript on the page you're embedded within?????
|
|
|
|
|
Hi all,
I've successfully managed to add some satellite assemblies to a project for multi language functionality. I'm trying to add a default resource to my project but it just throws up an exception. My dir structure is as follows,
MyApp
myApp
myResource.txt
myResource.resources
de-DE (dir)
...
myResource.de-DE.dll
...
...
where each culture is held in its own directory. As I said the different languages work fine but if I try to use the default resources file ( if no language is available ) I get this,
Additional information: Could not find any resources appropriate for the specified culture (or the neutral culture) in the given assembly. Make sure "myResource.resources" was correctly embedded or linked into assembly "MyApp".
baseName: myResource locationInfo: <null> resource file name: myResource.resources assembly: MyApp, Version=1.0.2001.19569, Culture=neutral, PublicKeyToken=null
Do I need to add anything the my projects build settings for my resource file. I've added it to the project and tried using al.exe to link to my project.
Thanks in advance.
Rich
|
|
|
|