|
|
Hi,
Not sure where the best place for this question would be, but hopefully someone might be able to help.
I have developed a .Net 2.0 windows service that utilises the MS Office Excel 12.0 PIA. I am looking into the implementation of this service onto a number of production web servers and ideally would like to not have to install the full version of Office 2007 onto each server. It is possible to download the Office 2007 PIA redistributable package, but Office 2007 must be installed as a prerequisite.
Is there anyway I can utilise the Office Interop's on a server that does not have Office installed?
Thanx, and apologise if this is posted in the wrong forum...
Clean code is the key to happiness.
|
|
|
|
|
The Office Primary Interop Assemblies do nothing by themselves. They simply provide a way to call the Office programs to do something on your program's behalf.
Even if they're not visible, the Office apps have to run when you call the methods in the PIAs. If you check Task Manager, you will see that (in this case) EXCEL.EXE is running.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Had a feeling that was the case.
Thanx for the quick response...
Clean code is the key to happiness.
|
|
|
|
|
Hi!
I have an application that has a keyboard-listener (system-hook).
It is being notified on any keyboad-event, even if the app-windows is not active.
As far as that it works as designed.
My problem is, that it is possible, that someone pushed the space-bar or the cursor-buttons, what effects on the GUI, e.g. to buttons, list-views, etc... So if someone presses the curser-buttons a highlight wanders around my gui. And if the spacebar is hit and a button was highlighted this button will be pressed. This is what i´d like to avoid.
What i´d like to have is to make the gui ignore these keyboard inputs (except textboxes, where you need the keyboard).
Is there a way of making the GUI-elements not react on keyboard-actions?
Thanx
J.
|
|
|
|
|
Dear All,
We have two (ASP.net) web applications running on Windows Server 2003. First application runs on Framework 2.0 and the second one runs on Framework 3.5.
Most of the client machines are having Vista and we are facing a strange problem, i.e. IE7 restarts very frequently. There is no error logged or displayed and the pattern is also not consistant. IE gets restarted at any page and next time it works well at the same page.
This problem occurs on Vista + IE7 environment only.
Please guide.
|
|
|
|
|
sachinkalse,
I dont think anyone is going to be able to help you as you are being too vague.
What is your app doing when it crashes? Have you stepped through your code to see if you are causing exceptions? Are you trying to access something that the user account doesn't have privileges for?
Regards,
Gareth.
(FKA gareth111)
|
|
|
|
|
Sorry for being vague.
It crrashes at any moment at any page before debug (stepped through).
As I have written in first message, there is no error at all. In all cases it just reboots IE.
More over all users have access permission.
|
|
|
|
|
Try running IE in No Add-Ons mode, which you can find at Start, All Programs, Accessories, System Tools, Internet Explorer (No Add-ons). If this then works, narrow down the add-on that causes the problem.
I would start by ensuring that Adobe Flash Player and Sun Java are up-to-date. The current Flash version[^] is 9.0.124.0 and Java is identified as "J2SE Runtime Environment 6 Update 6".
IE is highly extensible and many of the common extensions are pretty buggy. You might also want to check whether your anti-virus package is causing the problem - some try to second-guess Internet Explorer's security model but instead crash the browser.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi,
We have one GUI application and used with some user controls.
In this i need to write a pgm to "indicate this application when
a USB drive detect", So i written a sample appln with,
protected override void WndProc(ref Message m)
{
const int DBT_DEVICEARRIVAL = 0x8000;
base.WndProc(ref m);
switch (m.WParam.ToInt32())
{
case DBT_DEVICEARRIVAL:
MessageBox.Show("Found");
break;
}
}
And it is working fine, But i tried to write in my application, it is not working.
I dont have much idea about WndProc and windows messaging.
Is there any loop hole to skip the windows message ( ie 0x8000 ) coz of some where in the appln
to override again the WndProc(...) , Coz i have in this appln so many User controls used,
so couldnt able to look the source code.
If any one can help regarding this ,it will be very greatful help for me.
This is my orginal application which i add the code in the existing windproc() method. ( commened my code with Me Added ")
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
switch (m.WParam.ToInt32())
{
case WM_DEVICEARRIVAL://Me Added
MessageBox.Show("Found");//Me Added
break;//Me Added
}
switch( m.Msg )
{
case WM_PARENTNOTIFY:
if( m.WParam.ToInt32().Equals( WM_RBUTTONDOWN ) )
{
this.SelectedItems.Clear();
this.ContextMenu=null;
}
if (m.Msg == 20)
{
if (this.Items.Count == 0)
{
m_bRedraw = true;
Graphics g = this.CreateGraphics();
int w = 0;
w = this.Width;
w -= g.MeasureString(DISPLAY_MESSAGE, this.Font).ToSize().Width;
w = w/2;
g.DrawString(DISPLAY_MESSAGE, this.Font, SystemBrushes.ControlText, w, 30);
}
else
{
if (m_bRedraw)
{
this.Invalidate();
m_bRedraw = false;
}
}
}
if (m.Msg == 4127)
{
this.Invalidate();
}
}
|
|
|
|
|
How can I copy or move file from one directory to another.
|
|
|
|
|
|
Lets copy file in asynchronously
FileStream sourceFile = new FileStream(.....);
FileStream destinationFile = new FileStream(....);
byte[] buffer = new byte[BUFFER_LENGTH];
AsyncCallback readCallback = null;
readCallback = delegate(IAsyncResult readResult)
{
int byteRead = sourceFile.EndRead(readResult);
destination.BeginWrite(buffer,0,byteRead,new AsyncCallback(delegate(IAsyncResult writeResult)
{
desitnationFile.EndWrite(writeResult);
destinationFile.Flush();
sourceFile.BeginRead(buffer,0,buffer.Length,readCallback,null);
}),null);
};
sourceFile.BeginRead(buffer,0,buffer.Length,readCallback,null);
|
|
|
|
|
Sytem.IO.File.Copy("Try reading the books","or use Google, lazy")
Bob
Ashfield Consultants Ltd
|
|
|
|
|
I know that C# doesn't directly implement it, though I found an article that describes a way to kludge around it, but I was just wondering whether anyone is still pursuing it. Back when I was doing Turbo Pascal semi-OOP programming it was the hot topic, but things have got a bit quiet since then. Does any language still support it?
Yeah, I know it's not directly relevant here, but I'm fiddling with a model for an electrical substation and looking at C# as an possible implementation language. Substations contain transformers, regulators, reclosers and breakers, and some transformers have the regulators built in, so it seemed a natural fit for MI. On closer inspection, it's not worth the trouble, but I'm still curious whether anyone is still trying to make it work.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
C# and Java don't, and it's unlikely they will in the future either. You can use interfaces instead.
Maybe VB.NET does support MI, I have no idea. Not sure if you want to go down that road....
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
The CLR does not support MI, so no language that runs directly in the CLR will be able to use MI.
(Well it is possible to generate interfaces and implement those at compiletime, but the actual code would not be true MI)
|
|
|
|
|
Thanks, Roger.
Cheers,
Vikram.
The hands that help are holier than the lips that pray.
|
|
|
|
|
If the state of the art hasn't improved significantly since 1994, I'd guess MI is more hassle than it's worth.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Roger Wright wrote: Does any language still support it?
Many OO languages support it. C++ for example.
Roger Wright wrote: transformers have the regulators built in, so it seemed a natural fit for MI.
Would a composite object (i.e. it has as member variables a Transformer and a Regulator) be better? You could create an ITransformer interface and an IRegulator interface and have the composite implement both interfaces which just passes it down to the relevant object.
You may be interested in a blog post I wrote a while ago on Mixins (a type of MI) and how to implement it in C#: Mixins in C#3.0[^]
|
|
|
|
|
Thanks - that might be a good approach!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Multiple inheritance is dead. If you want to do real programming, you have to stick with a real language.
I actually used multiple inheritance in MFC apps. In my particular case, I had to extend a base class, but I didn't want to actually change that class (I forget the specifics, but that's the gist of it). I simply added some data members and methods in a new class that was NOT derived from CObject, and changed the prototype for the derived class to inherit from it as well as the original base class. It work a treat and was the object of may ooohs/aaahs among the rest of the programming team because it was the first time they'd seen multiple inheritance used outside the classroom.
I guess what I'm trying to say that it wasn't widely used in C++, and Microsoft probably realized that. You're going to have to more carefully design your classes as a result, though.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
John Simmons / outlaw programmer wrote: Multiple inheritance is dead
If it isn't, it probably should be. I remember playing with it in a 'real' language (pascal) and it really was a royal PITA to get right.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
Multiple-inheritance is a problem in C++ when more than one base class share a common base class. For example, your class E derives from B1 and B2, and B1 and B2 both derive from A. Should your class E have one or two copies of A? The C++ answer is two, unless B1 and B2 declared A as a virtual base class, in which case they share a common set of A's members. My recollection is that this causes some other problems, though I can't recall what they are now. Something to do with construction, perhaps?
For more on this and how some other languages solve the problem, see Diamond problem[^] on Wikipedia.
Anyway, due to C++'s problems in this area, the designers of Java and then C# decided to explicitly separate out interface inheritance from base class inheritance, and only allow a single base class. C# allows explicit interface implementation in case of method name conflicts.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
It sounds like C# is equipped to solve the problem, but MI is not the way to go. I'll look more closely at the C# approach using interfaces. Thanks!
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|