|
Hello!
I found that the inline code documentation defined on the classes and methods does not get compiled into assembly! When looking into object browser, the documentation is only visible for the items found under project node. When coding in the project referencing the library containing the documentation, I only get class/method/argument names but no single word in addition.
The MSDN documentation says that the /doc compiler option should be used to produce xml file which could be used by IntelliSense - the file should have the same name as the assembly produced. I tried it but with no the effect.
What do I do wrong?
Thanks for any suggestions.
Vasek
VB6, C#, MS DNA, MS.NET
Software Developer
|
|
|
|
|
using: /doc:file
The file should have the same name as the assembly but with xml extension:
MyLib.dll
MyLib.xml
These should be kept together in the same folder.
|
|
|
|
|
Hi, this exactly I made but I made it using IDE, I did not run compiler from the command line. There is /doc configuration option int the project setting. The file was created but the documentation was not inserted to the compiled file.
Could you tell me, whether the /doc: dicrective works for you?
Thanks
Vasek
VB6, C#, MS DNA, MS.NET
Software Developer
|
|
|
|
|
Yes, I also do it using the IDE "XML Documentation File" setting and the documentation is put in the specified .xml documentation file. It is not supposed to be put in the compiled file.
|
|
|
|
|
Hello,
I'm trying to use the Microsoft.Win32.Registry namespace for getting owner information from the registry. I found that this namespace isn't supported by .net compact framework and that i have to use Win Api functions and to import coredll .dll
But I don't know how can I fix my problem:
I have to
[DllImport("coredll.dll")]
and then to use RegCreateKeyEx(..) and RegCreateKeyEx(..)
LONG RegCreateKeyEx ( HKEY hKey, LPCWSTR lpSubKey, DWORD Reserved, LPWSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes,
PHKEY phkResult, LPDWORD lpdwDisposition );
LONG RegQueryValueEx( HKEY hKey, LPCWSTR lpValueName,
LPDWORD lpReserved, LPDWORD lpType, LPBYTE lpData, LPDWORD lpcbData );
but I don't know how to transform types of parameters for using this functions in c# and to use the macro like HKEY_CURRENT_USER
thank you for your time.
Ramona
|
|
|
|
|
Look at the System.Runtime.InteropServices.MarshalAsAttribute for some interformation. This should be pretty easy, though, and you should understand before proceeding. Basically, any handles become IntPtr , any strings become string (and in the DllImportAttribute you should specify the CharSet that's appropriate), DWORDs (and the like) become int , and structures must also be defined with appropriate attributes like StructLayoutAttribute . You should gain a good understanding of these. You also need to use the ref and out keywords appropriate based on the parameter type and the Platform SDK (PSDK) documentation ([in/out] translates to a ref , while [out] translates to an out ).
As far as macros, you need to download and install the PSDK (if you didn't install it with VS.NET) and find it in the headers (the PSDK usually tells you what header it's in, otherwise search) and see what it's defined as.
Also, you could download a good decompiler like .NET Reflector[^] and look at the code for the Microsoft.Win32.Registry classes, structs, etc. This will give you some good idea of how Microsoft does it.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
I need to 'associate' a Server Event to a Button via code. I built a Form, a Table, and a Button and I need to get a server event attached to the 'click' method for that button see code snippet below...
HtmlForm frmROPtbl = new HtmlForm();
frmROPtbl.Attributes.Add("runat", "server");
Table maintable = new Table();
maintable.Width = Unit.Percentage(100);
TableRow hdrRow = new TableRow();
TableCell hdrCell0 = new TableCell();
TableCell hdrCell1 = new TableCell();
hdrRow.Width = Unit.Percentage(100);
hdrCell0.Width = Unit.Percentage(50);
hdrCell1.Width = Unit.Percentage(50);
Label hdrLabel = new Label();
hdrLabel.ID = "lblCustomerDesc".ToString();
hdrLabel.Width = Unit.Pixel(360);
Button btnToExcel = new Button();
btnToExcel.ID = "btnToExcel";
btnToExcel.CssClass ="Button".ToString();
btnToExcel.Text = "To Excel";
btnToExcel.Click += new System.EventHandler(this.btnToExcel_Click);
btnToExcel.Attributes.Add("runat", "server");
//* Attach a Server Event to this Button
hdrCell0.Controls.Add(hdrLabel);
hdrCell1.Controls.Add(btnToExcel);
hdrRow.Cells.Add (hdrCell0);
hdrRow.Cells.Add (hdrCell1);
...
Thanks
Andy
(Andrew.Kirin@verizon.net)
|
|
|
|
|
What do you mean by "server" event? Adding the Click event handler automatically renders the correct HTML. If you want the server to watch for something to happen, you can't for so many reasons:- HTTP is by nature non-stateful.
- ASP.NET runs server-side and generates client-side code (HTML, Javascript, images, etc.) that the browser downloads to the user's machine.
- These two do not maintain persistent communications.
- The only way the client can alert the server of a change is by making a new request to get the file (without the use of ActiveX, Java Applets, or using javascript with special automation objects that are different from browser to browser and sometimes not available at all).
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
http://www.china-vips.com/bbs/dispbbs.asp?BoardID=12&id=12866&replyID=82911&star=1&skin=
village in my fatherland.
my broken heart
|
|
|
|
|
Hello,
I would like to know if there is some way to use a static library (a .LIB developed using C++) from C#.
Any idea?
Regards
Severino
|
|
|
|
|
Isn't possible. .NET uses assemblies that contain dependency references, assembly attributes, modules (what actually contain the code), embedded resources, and a manifest that lists it all.
This does imply, however, that you could write a library and compile it as a module (only possible with the command-line compiler, csc.exe (C# compiler) using the /t:module parameter. You can then compile an assembly that contains your code plus this module. It's not quite the same thing, but the result is pretty much the same. Again, this is only available with the command-line compiler. VS.NET doesn't support this.
Doing things this way will result in an assembly with two different modules. There is an article at an old hang-out that describes writing assemblies with modules in different languages. The principal is the same even if you use the same language, though: http://www.devhood.com/tutorials/tutorial_details.aspx?tutorial_id=466[^].
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Two options:
1) Compile it into a DLL.
2) Write a wrapper using Managed C++.
|
|
|
|
|
I have created a worker thread. Now I would like to create a separate window (form) to watch the progress of the thread. I specifically do NOT want to use an invoke back to the main form because I'm starting several such threads and wish to monitor them independantly. Obviously I would like the worker thread to directly create and show its own form.
Well I can easily create and show a form from the worker thread, however the form is not receiving window events and consequently nothing much happens.
What do I need to do in order to get this form to respond to windows messages?
Any advice people? Thanks Alastair
Only change is constant unless it isn't
|
|
|
|
|
Are there any Application.DoEvents(); calls in the worker thread? Otherwise the form gets no time to process the window messages.
|
|
|
|
|
Ohmygod. Do I feel stupid or what? Thank you John. I have no idea what I was thinking. Anyhow of course I didn't so the poor thread couldn't service events. In partial mitigation it is 11.47pm here and I have flu.
Problem solved. Thanks again!
Only change is constant
|
|
|
|
|
Or is that Corinna? I can never figure out first from last names...
Only change is constant
|
|
|
|
|
Corinna: First Name, usually abbreviated (Coco)
John: Ugly Last Name. (One day I'll marry someone just to get a better name.)
|
|
|
|
|
How do you display User Options in a Windows Service.
I know you can stop/start/pause/restart a service.
The is a way to add options to start a windows service. Is there anyway to display these options with out starting the service.
John Ingram
|
|
|
|
|
As you said, you can provide command line arguments in the Services control panel / snap-in.
If you need to configure the options in a different way, you could use a Windows Forms application that either uses registry settings or writes on a .config file (or other configuration file) for the service. You can use the ServiceController class to start, stop, or pause the service programmatically then.
If you want to configure the options while the service is running, you need to use the ServiceController.ExecuteCommand to pass a command identifier. If you need to change more complex options, you can use .NET Remoting over a TCP or HTTP channel.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Hello,
I want to add a footer to a datagrid in a windows forms (like the datagrid for asp.net).. How do I go about doing this???
For example I want to display the totals of a columns in the footer..
any help is appreciated!!
|
|
|
|
|
Put a Label control or something similar under the DataGrid . You can update the Label.Text property by aggregating the values in a particular column of your DataGrid . We do that in our app in several cases.
Note that System.Windows.Forms.DataGrid and System.Web.UI.WebControls.DataGrid are very different, both in terms of presentation and logic. The former is a Windows Control that binds differently than the latter, and the latter generates an HTML <table> , which makes having a footer template trivial (since it just uses the <tfoot> tag and adds your rows and columns). They are very different beasts and, IMO, should not be compared.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
|
My applications use a large number of components (DLLs and EXEs) which previously (using VC6.0) we built using a big build script, and then at the end we ran a program over all the modules which stamped them all with exactly the same version. This made it very easy to tell if a customer has a consistent version of all the components.
Recently I've just created a .NET component that will be released with the rest of the applications. My question is: Is there any way to set the assembly version of an assembly that has already been generated? With the normal Win32 modules I can load then and then modify the resources using the appropriate APIs - but will this work for a .NET component - particularly since the version is part of the strong name of the component?
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
You can use the Win32 resource editing trick for the version of the executable, but not the assembly. Doing this will also invalidate signature if you use signed assemblies (and you should be, especially since it makes versioning easier via config files and policy assemblies, which must be in the GAC and assemblies in the GAC must be signed).
Even if you did change the version and resign the assembly, it still wouldn't be an easy task. You would have to emit an assembly based on a template (the existing assembly).
Frankly, IMO, just implement a policy whereby your developers put the appropriate assembly version into the [assembly: AssembyVersionAttribute] when compiling for the last time. Or, if you have a build master, he or she could either do it (or use a macro to change the AssemblyInfo.cs file (or wherever you put it) to make it quick) and then compile under a release build.
Just remember that the version number in the VersionInfo block of the executable's .rsrc section has little to no bearing on the assembly itself. The AssemblyVersion attribute is what matters, and that's in the MANIFEST for the assembly.
One example: Infragistics commonly updates their assemblies while leaving the AssemblyVersionAttribute with the same value, but changes the executable image's VersionInfo block so that the FileVersion is different. While this makes updating your applications without recompiling easier, it totally screws-over touchless deployment over the Internet because Fusion (the assembly binder) caches assemblies based on their strong name in the temporary assembly cache. Since the assembly version didn't change, the new code isn't always downloaded! (The cases where it is depends on Internet Explorer's cache settings.)
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
hi i have just added this auto complete feature in my combo box .. When the user leaves the focus from the combobox .. it fires the leave event ... in this event i do this ...
listView.Items[index].Selected = true;
And in the list view selected event i have added some code that get the data from the listview and put them into the appropraite textBoxs or Combox... my problem is this code works just fine only 1 time... the second time it does execute the leave focus event but dosnt set the selected index ... i have no idea why is it doing that
Thanks
DaIn
|
|
|
|