|
how can i change/rename an existing regestry key/value (in c/c++ code).
|
|
|
|
|
Bwhaahahahahahaaaa - this is great. The first and only question on the C# board is about straight C !!!!
Sorry, I don't mean to laugh at your question, I just find it amusing that it's the first question on the board for C#.
Some pointers for you in future.
1/ Put something meaningful in your header. C ? What does that mean ?
2/ Post to the right board. There is a lively board on C/C++, where you'll find questions answered a lot faster than in this barren place.
There is a registry class or two here at CP which I would expect would do what you want. Just search for registry and see what comes up.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
CRegKey class have no rename func
|
|
|
|
|
The CRegistry class has a rename function.
Christian
Secrets of a happy marriage #27:
Never go to bed if you are mad at each other. It's more fun to stay up and fight.
|
|
|
|
|
Do u have any example code 4 me
|
|
|
|
|
Hi, on my app, i've 2 forms (form1 and form2).
On form2 i've dropped a combobox (named cb1) and declared it has public( public System.Windows.Forms.ComboBox cb1;).
Now, i want to access it from form1 (whit a statment like this one:
Form f2 = new form2();
f2.cb1.size.With = 30;)
, but i do not have access to it...????
What do i need to do to see my form2 combobox from form1, i thought that it would bee enough to declare it public, but looks like i'm wrong...
Thanks
Carlos Lopes
|
|
|
|
|
You'll have to make that combobox a property (read-only).
|
|
|
|
|
Where can I find a website that has a reference to all the API's in C#? I want all the methods in System.net.*, etc....I want to know what I can call! Like what's in the headers of C/C++, if you're confused. Thanks!
|
|
|
|
|
You have two choices:
1) Use MSDN online, at http://msdn.microsoft.com
2) Get VisualStudio.NET, and use MSDN locally.
|
|
|
|
|
I've tried to use MeasureString function and noticed that it almost always returns size that is noticeably wider then the actual string. So, I was wondering if any one can comment on this behavior. Is it a bug or a feature Also, does anybody else thinks that support for text output in .NET SDK is totally inadequate? How is one can change kerning or get character glyph?…
|
|
|
|
|
Well, MeasureString have been broken in Beta 1 (it returned invalid result for some fonts). They fixed this problem in Beta 2. Still this function might be inadequate for precise measurement. I agree that .NET does not have enough power as far as text output goes (fonts, measurements). E.g. writing fully managed text editor with support for variety of fonts is an uphill battle (I would even say it is impossible). The only solution is to use P-Invoke to call into Windows SDK functions. I suspect that due to the fact that .NET is supposed to be appealing for cross-platform development they couldn't include any "Windows specific" functionality.
Regards,
Andrei Zenkovitch
|
|
|
|
|
Thanks for the info Andrei! I did figure as much myself. Unfortunately I was trying to create text editor with extra features not found in RichEdit and for now I had to abandon it. I hope Microsoft reconsiders their decision about text output support (or lack of it) in .NET. As for Windows SDK, if I have to use it I'd rather use it from C++.
Cheers.
P.S. I am using Beta2 VS.NET
|
|
|
|
|
Hi,
I have recently produced some C# tutorials for my company. I was wondering if anybody would look through them and let me know what you think.
The web address for the introduction to the tutorials is http://www.softsteel.co.uk/tutorials/cSharp/cIndex.html
Cheers,
Andy
Andrew Sampson
Director
Softsteel Solutions Limited.
Registered in England No.4092969
Registered Office: 81 Freedom Road, Sheffield S6 2XA.
Telephone 0114 233 8136
http://www.softsteel.co.uk/
|
|
|
|
|
Hey Andy,
Why not post them and let the viewers let you know? Seriously it would be great if you put them up.
David
|
|
|
|
|
Hello,
I have the follwing code:
public static void SendNewsletter ( string Address, StringCollection
scPictures, string Text )
{
MailMessage mm = new MailMessage();
mm.To = Address;
mm.Body = Text;
mm.From = "XXX@XXX.coml";
mm.Subject = "Your weekly newsletter";
mm.BodyFormat = MailFormat.Html;
foreach ( string s in scPictures )
mm.Attachments.Add ( new MailAttachment (s));
SmtpMail.Send ( mm );
}
In outlook and outlook express the images appear just in the HTML and the recipent gets to see perfect HTML page, but the images also appear as seperate attachements!!! When I get newsletters in HTML hte attachmetns are never visible! What am I doing wrong?
Any help appreciated
Henk
|
|
|
|
|
Well from your code, you are attaching the images as attachments. Outlook Express will preview a picture attachment for you, that is why you are seeing it in the message.
Typically what html newsleters do is have a full html page that is sent and the images are not in the mail message, but usually they refer to a web server. This keeps the email messages small.
Steve Maier, MCSD
|
|
|
|
|
ResourceManager rm=new ResourceManager("Images",this.GetType().Assambly);
I don't know what's the meaning of the two parameters("Images",this.GetType().Assambly).
thanks.
Nothing!?@#
|
|
|
|
|
I have made a Jave Applet that can draw vector graph. I use it in HTML page
at Internet. I know that another way is I can developed a OCX control to do
this task. But the later's size is larger than Java Applet. Here has .NET,
extra choice. I want know if I write the control by C#(It is a .NET control),
what advantage I can get and what I lost?
Thank you.
|
|
|
|
|
It is my understanding that C#, being a garbage collected language as Java is, does not have destructors.
What's funny about this is the not so commonly acknowledged fact that destructors are a programmer's friend cause they assure proper releasing of resources acquired during construction, regardless of the flow of control (exceptions included). So, not having to worry about memory leaks (which is what garbage collection is for, and what forces the absence of destructors) imply having to worry too much to avoid other types of leaks. Have you ever seen a robust snippet of code in Java (C# should look alike) managing with say SQL connections dealing with proper shutdown of those connections? Man, you got to put all the closing code on a finally statement, and moreover every closing statement wrapped by try{...}catch(Exception e){} things.
Lacking destructors often results in classes with open/close methods with which the programmer has to mimick what a compiler could achieve with constructor/destructors (and not forgetting to invoke a destructor method as a programmer is likely to).
In C++ nothing of this type happens, provided you are reasonably disciplined (or use properly destroyed classes) and stick to the Stroustrup's motto resource acquisiton is initialization (RAII).
Just wanted to know your opinions on this subject of C# lacking destructors because of the alleged merits of garbage collection. Also, as I'm no expert in this language some of you might know of additional techniques in C# to achieve the effects of RAII.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
C# does provide finalizers, which are run before an object is collected. This means that cleanup is a matter of timing (ie is the cleanup done early enough), not whether it gets done at all.
C# does provide the using statement, which wraps usage of a resource that implements IDisposable (the design pattern for classes that hold onto non-memory resources) in a try-finally for you. This works well for short-lived resources, but for longer-lived ones, you are going to have to track the lifetime yourself, just as you do in C++.
|
|
|
|
|
Regarding your statement about "using" and "IDisposable": I search through all MSDN-documentation that comes with Beta 2 and found nearly nothing about that topic.
Would you be so kind to provide a link or a short example?
--
See me: www.magerquark.de
Want a job? www.zeta-software.de/jobs
|
|
|
|
|
I'd try this post.
http://discuss.develop.com/archives/wa.exe?A2=ind0010A&L=DOTNET&P=R28572
|
|
|
|
|
Well, it is not really a problem, I think that in c# also exist something
like System.gc() ( the garbage colector calling function), You can call it
any time you want.
|
|
|
|
|
(This is a one time announcement in the hope that it will be of interest to the folks in this discussion group.)
I am pleased to announce that my newest book, Programming C# (O'Reilly & Associates, 2001) is now available. You can read the Table of Contents, Index and a sample chapter, and you can purchase the book through Amazon Affiliates, on my web site: http://www.LibertyAssociates.com where I also provide the source code, errata sheet and FAQ.
Thank you.
-j
-------------------------------
Jesse Liberty
Liberty Associates, Inc.
.NET Training & Development
http://www.LibertyAssociates.com
|
|
|
|
|
I read part of this book on the way to a Microsoft conference about .Net. Since then we have purchased another copy of the book to share around the office. Pretty good book.
Its always nice to get started in a printed document then hit the ground running with online examples and tutorials. Microsoft has included some great tools in .Net, the WinCV program is my fav.
Nice book Mr. Liberty. I suggest ppl start with this book, its very solid.
|
|
|
|