|
Try null ?
Might not work but it's a clue.
Paul
|
|
|
|
|
string s = @"c:\mydoc.doc";
object so = (object) s;
object o = null;
Word.Document doc = word.Documents.Open(ref so,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o,ref o);
(the ref stuff is because the tlbimporter is stupid, and prefers to assume nothing, even when the type-library brings everything top-to-bottom and left-to-right).
Have fun!!
MS quote (http://www.microsoft.com/ddk) : As of September 30, 2002, the Microsoft® Windows® 2000 DDK, the Microsoft Windows 98 DDK, and the Microsoft Windows NT® 4.0 DDK will no longer be available for purchase or download on this site.
|
|
|
|
|
object isVisible = false;
object missing = System.Reflection.Missing.Value;
Word.ApplicationClass WordApp = new Word.ApplicationClass();
WordApp.Visible = false;
WordApp.ScreenUpdating = false;
WordApp.DisplayAlerts = Word.WdAlertLevel.wdAlertsNone;
Word.Document aDoc = WordApp.Documents.Add(ref fileName, ref missing, ref missing, ref isVisible);
aDoc.Activate();
WordApp.ActivePrinter = _DeviceName;
// Office 2000 format
WordApp.ActiveDocument.PrintOut(ref bool_true, ref bool_false, ref missing, ref newFileName,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,
ref bool_true, ref missing, ref missing, ref missing, ref missing, ref missing,
ref missing, ref missing);
|
|
|
|
|
Hi.
If I want to connect a printer to a computer port, how do I accomplish that in .NET? Is there something corresponding to the functionality of WNetAdd/CancelConnection?
Still not friends with the .NET documentation
Any help will be most appreciated!
/EnkelIk
|
|
|
|
|
Has anyone had any experience or seen any articles about using AppDomains and the CodeDOM classes in the .NET framework in a similar way to ASP.NET? I would like to be able to compile extension code for my app that provides user specific customisation. Hopefully the extension code will have full access to the object model of my app including instances of objects hosted inside the main AppDomain.
I guess it's the efficiency of marshalling calls between AppDomains that i want to understand so i can make best use of them.
Thanks
Matt
|
|
|
|
|
I am trying to set tags for individual Combobox items. In looking through the Combobox doc, I cannot find the equivalent of SetItemData/GetItemData. The tag property is set at the Combobox level, and not at the item level. Can someone point me to an example, or how to set the tags for invidual combobox items. I would like to store database record ids as tags in the combobox.
Gaulles
Gaulles Technologies, Inc
http://www.gaulles.com
|
|
|
|
|
Unfortunately there isn't. However, if you considered switching to a ListView instead of a ListBox, then you would be able to use the ListItem.Tag property. And, it functions almost like a listbox...kind of.
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
|
Aloha everyone...I have a question:
How can I implement auto-updating to my app? I have created a simple TCP/IP application and I would like the client to be able to get the newest version from the server and overwrite itself with the new version.
Obviously this will create problems with trying to overwrite a file in use, so how do you do it?
- Does .NET provide built in "shadow copying"? (I know ASP.NET does)
- Does Windows provide a service to auto-copy a file once an application closes?
- Is there some black-book trick I am unaware of???
Any help would be really appreciated!
|
|
|
|
|
.NET has several capabilities that you could possibly try. My companies application is Internet-distributed and actually launched from the web and downloaded automatically into the Temporary Assembly Cache (TAC, kept safe from other applications). Based on the .config file on the server that the application uses, we can easily update a DLL, modify the <runtime> section of the .config file and change the binding to the new version, for which the application will automatically grab the new one and download it, inserting it into the AppDomain.
As far as automatically updating files that are in use, you don't really want to overwrite files. This is not necessary and not recommend in .NET. You could install the assemblies in the GAC, for which each one gets a separate directory (for which you don't see) and you can have several versions of assemblies in there. Then, using the application's configuration file, you can use a <bindingredirect> to tell the application (which is bound to a previous version of an assembly) to now use the new one. See the <bindingredirect> element in the .NET Framework docs for more information.
I hope that gives you some insight for ways to keep your application up-to-date on client machines.
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
I'm sure I read an article on gotdotnet.com about tricklefeeding a .NET app.
Try this.
"Update applications and distribute their pieces automatically using application domains and assemblies."
Quite a few hits on Google too.
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)
|
|
|
|
|
|
if i want to creat my own service.
1-it can communicate on the network using socket programming while the system is logoff.
2-it can automaticall login after half an hour?
any body could provide the releted link.
i have done socket programming but i did not know how to creat such a service because when system is logoff all runing service are also destroy.
r00d0034@yahoo.com
|
|
|
|
|
|
thanks for reply
you are right.i want to creat my own service can you give me releted links that who to creat service i will be very thank full to you.
r00d0034@yahoo.com
|
|
|
|
|
Take a look at my N-Track article. One of the programs covered there is a Managed C++ service.
http://www.codeproject.com/managedcpp/ntrack.asp
If you want Win32 services take a look at my intro article on Win32 services:-
http://www.codeproject.com/system/serviceskeleton.asp
Regards,
Nish
Author of the romantic comedy
Summer Love and Some more Cricket [New Win]
Review by Shog9
Click here for review[NW]
|
|
|
|
|
is there any difference between IntPtr.Zero
and AfxGetInstanceHandle( )
r00d0034@yahoo.com
|
|
|
|
|
|
you mean both return HINSTANCE of the current application.
you want to say that there is no difference between these two
r00d0034@yahoo.com
|
|
|
|
|
I created a .NET web service that was to be consumed by a .NET web application.
Now I have a problem. I made a session variable in the Web Service and stored the instance of the Web Service in a session variable in the Web application.
I have two problems
1. The session variable in the Web service is lost in subsequent calls.
2. The WebService object in the Web app session is NULL in every submit from the browser.
Have anyone implemented something like this? Is this the correct way to implement a state-ful Web Service?
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Did you set the EnableSession property in your WebMethod attributes?
"Well, I wouldn't say I've been missing it, Bob." - Peter Gibbons
|
|
|
|
|
I actually figured out the existence of that property yesterday .
Thank you very much.
Note:
Also I found that to use the WebService from a Web Application, the WebService object in the .NET app has to be assigned a cookie container so that it can maintain the ASP.NET cookie that maintains sessions
Thomas
modified 29-Aug-18 21:01pm.
|
|
|
|
|
Hi,
Can you help ?
I don't know how to phrase my question so I have written it out in serveral different ways. They all make sense to me
but that is because I know what I want!
And the question ? .......
If I inherit from a System.Windows.Forms.ContainerControl I can use the inherited control as a container type control within the IDE, and drag-drop toolbox items into it. However if I inherit from a UserControl, the the ability to drag-drop controls
into it seems to be disabled.
What I am attempting to do is create a container control that can be drag-dropped onto a form and be used as any normal container control (eg. Panel). To do this I can inherit from the ContainerControl and all is well. As an extension to
this I would also like to be able to inherit directly from the control and use it as a designer base.
If I inherit from a UserControl, then I can use the default usercontrol designer, but I cannot then use the created control
on a Form, and drag-drop toolbox items into it.
Is there anyway of creating a container control, which is based on a UserControl, and use the created control within the
IDE in the sameway as all the built-in container controls.
Gary Ranson.
|
|
|
|
|
You can get a start by adding a reference to System.Design.dll and adding the following attribute to your UserControl
[Designer(typeof(System.Windows.Forms.Design.ParentControlDesigner))]
You may want to put some code into the Paint event so that you draw a border around the control if DesignMode is true; otherwise the control will blend into the form with the default values.
James
"And we are all men; apart from the females." - Colin Davies
|
|
|
|
|
Hi,
I am trying to capture rendering time of a webcontrol/aspx.page and capture it to a database for performance evaluations. Enabling Trace option shows these information but didn't understand how to capture these information. Is there any other way of capturing these information in a more generalized way.
Thanx
tkc
|
|
|
|