|
|
Okay, leppie, not so cryptic.
So are you saying that this can only be done in VS and is not an option exposed in the managed compiler?
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
|
Hi There !
I have downloaded the file printtemplates.exe from the VS.Net.
I want to use it, but would like to make some changes.
Does anyone knows how to get the source code ?
Is there another similar open source application ?
|
|
|
|
|
I have 2 sevices, they should be started at startup, but second must be started only after first one. For this reason I should use (I think) service depencies, but I cannot find how shoud I do it. Help me please.
|
|
|
|
|
In installer class:
[RunInstallerAttribute(true)]
public class ProjectInstaller: Installer
{
private ServiceInstaller serviceInstaller1;
private ServiceInstaller serviceInstaller2;
private ServiceProcessInstaller processInstaller;
public ProjectInstaller()
{
processInstaller = new ServiceProcessInstaller();
serviceInstaller1 = new ServiceInstaller();
serviceInstaller2 = new ServiceInstaller();
serviceInstaller1.ServiceName = NAME_OF_FIRST_SERVICE;
serviceInstaller2.ServiceName = NAME_OF_SECOND_SERVICE;
string[] a = { NAME_OF_FIRST_SERVICE};
serviceInstaller2.ServicesDependedOn = a;
...
}
|
|
|
|
|
Hi,
Does anyone know how to launch a script/exe on bulding a project within the IDE?
Thanks
Rich
|
|
|
|
|
You could write a macro that handles the build event. The macros in VS.NET are VB.NET so you have the full power of the .NET Framework to help build scripts for handling events in the IDE. Look up macros and the DTE object in the MSDN.
[Edit] Also, if you just want to call an exe or a batch file. Look at the properties of the Project. Right-Click on Project -> Properties -> Common Properties -> Build Events -> Edit these commandlines [/Edit]
Hope this helps,
Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
Thank for the reply. 'Build Events' is just what I am looking for, but it seems to be missing in the IDE - I am running Visual Studio 2002. Btw Can you save macros into A project.
Thanks Again
Richard
|
|
|
|
|
Yeah, sorry about that. The 'Build Events' must be part of VS.NET 2003. I just checked my copy of 2002 and they aren't there.
Anyway, you could still look into the macro stuff, but unfortunately I don't believe you can embed or save a macro inside of a particular project. From what I know and how I use them they are outside of projects as more utility type stuff. If anyone out there knows for sure, please tell me.
-Nathan
---------------------------
Hmmm... what's a signature?
|
|
|
|
|
I'm trying to make a static ListView like this in VS.NET:
internal static System.Windows.Forms.ListView ListView1;
and changed all the "this.ListView1" into just "ListView1"
It compiles and runs fine, but every time i try to change something (like add a new button or change the property of the listview), VS.NET will remove the static keyword and replace "ListView1" with "this.ListView1" in InitializeComponent.
Is there a way around this apart from separating the listview code from initializecomponent as i may need to make changes to the listview directly at times.
|
|
|
|
|
As I see the Visual Studio recreates the code in the InitializeComponents Function every time it shows/changes the form. So I think you have to put it in a special function that you call in the Constructor after the InitializeComponents call.
I had to do this also, because i moved some eventhandler to another class and all changes in the InitializeComponents got lost when VisualStudio showed the Form the next Time an said it don't know the Class...
Also if you put a code line out with comments, VS.NET removes this line from the File...
Greets
Roland
|
|
|
|
|
okay im lost..............okay i have 8 images that i want to display in another form that pops up after you select an image from a listbox on the parent form. the 8 images are selectable from the parent and i want them to be viewable in the child.
please help me out.........im kinda lost
Da Intern
|
|
|
|
|
|
Anybody know how to use the Marshal.GetObjectsForNativeVariants function.I want to transfer the data from Unmanaged Win32 DLL to C# DLL.but the restriction is that I can only use IntPtr as passing param.
Like
Win32 DLL
I created One SafeArray
SAFEARRAY *pSA;
//Some code
pSA = SafeArrayCreate(VT_BSTR...);
SafeArrayPutElement(pSA...,String here );//safearray is full of BSTR Strings
then I called the C# DLL function
pData->ISetIntData((long)pSA);
And in C# DLL
public void ISetIntData(IntPtr Val)
{
Object[] MyObj=Marshal.GetObjectsForNativeVariants(Val,2);
String str=(String)MyObj[0];
MessageBox.Show(str);
//Here It is crashing...
}
Is this a right way Or I am doing some crazy Stuff?
Vikram
|
|
|
|
|
If I want to create a Dialog like as C++ Dialog ( or C#' OpenFileDialog ) , in other words , I don't want to do a dialog inheritance Form , how can I do ? Can I inheritance CommonDialog ? but , how should I do ? thank you very much !
|
|
|
|
|
If I understand your question correctly, it should be pretty simple. Just add a new form to your app and make sure the new form is derived from System.Windows.Forms.Form. This would be like adding a new dialog which is derived from CDialog in C++.
Hope this helps.
|
|
|
|
|
Thank everybody!! But, I mean I don't want to appear a form handle "button" on tne operation system (ex WindowsXP)' toolBar !( usually appear on tne bottom of screen, if you create a application program!), If I create a Dialog inheritance Form, what kind of method can I use ?? or I should inheritance other something ??
|
|
|
|
|
I have constructed many dialogs in my apps where I would do the following:
Build the dialog as a form within the project
Fill out the dialog box with everything I wanted to collect form the user.
Expose those items with public accessors
Add an Okay button which sets DialogResult = DialogResult.OK; etc.
(example: AskForFiles has englishDict frenchDict and germanDict exposed as public accessors. The user can click buttons to browse for the dictionary files in the dialog)
In my main program I then add this code:
AskForFiles newDialog = new AskForFiles();
if (some file names already defined)
{
newDialog.englishDict = value;
newDialog.frenchDict = value;
newDialog.germanDict = value;
}
newDialog.ShowDialog(this);
if (newDialog.DialogResults == DialogResults.OK)
newFileName1 = newDialog.englishDict;
...
This way you can issue a dialog, get the results from that dialog, with OK indicating they set all the values and Cancel indicating they changed their minds. You need to make sure you never issue a return without a this.Close() and setting this.DialogResult.
I also make the form properties for Abort and Accept set to the corresponding buttons on the form so any key input creates the desired results as well. For example: the user enters all dictionary names and hits enter is the same as clicking the Okay button. the user hits Esc is the same as clicking the Cancel button. etc...
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
...on the other hand...
If you want to issue an OpenFileDialog then that is simpler:
add OpenFileDialog from the toolbox to your form
then in your code your issue:
OpenFileDialog1.ShowDialog(this);
which is much easier if that is all you want to do.
_____________________________________________
The world is a dangerous place. Not because of those that do evil, but because of those who look on and do nothing.
|
|
|
|
|
Hi all,
I'm trying to learn C#. I know C. Are there any links where I can get some tutorials / info.
names of a couple of good books would also help?
thanks
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
Inside C#, Second Edition
by Tom Archer
is a very good book for learning and understanding C#
Michael
'War is at best barbarism...Its glory is all moonshine. It is only those who have neither fired a shot nor heard the shrieks and groans of the wounded who cry aloud for blood, more vengeance, more desolation. War is hell.' - General William Sherman, 1879
|
|
|
|
|
parths,
C# Essentials from O'Reilly for $25 bucks is well worth it. It's thorough for a small book, provides concise descriptions, and has lots of small examples.
-- James --
|
|
|
|
|
Thanks Micheal, James,
I'll go get one of those books. Thanks a lot.
"It was when I found out I could make mistakes that I knew I was on to something."
-Ornette Coleman
|
|
|
|
|
hello,
here is a little problem that i am facing at now.
on getting the html of a web page, i am getting some strange characters in place of space.
this is what i have in the text box (on web page).
Xavor Corp.
Katharine Yau
and this is what i get in the html source.
"Xavor%2520Corp%252e%02Katharine%2520Yau"
how can i remove these %2520 sort of characters.
LOOKING FOR HELP
ASIM
Asim
|
|
|
|