|
JMOdom wrote: int firstNum, secondNum;
DetermineNumberSum(firstNum, secondNum);
No, this cannot work. You need to assign values to firstNum and secondNum, OR use them as out parameters. You try to use them BEFORE using them as out parameters, and you didn't give them values to start with, which is always bad programming. You should also create one variable per line, for readability.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Using pdflib library in C# I have created a pdf file which is
protected using owner password .Different options are disallowed like
print, copy contents etc. Things were working very fine untill i came
to know about some password crackers which could easily crack the
file , eliminating the password , thus making it possible for
operations like printing, copy etc .
The study showed that using user password as well will make the file
strong enough to be decrypted ,but "user password" is not a solution
in my case .
The code which actually creates a pdf file using pdflib is as under :
PDFLib obj = new PDFLib();
obj.begin_document(FileName, "masterpassword=23wdlm3ldjwld4w
permission={noprint}");
Now i wonder even that the file is encrypted using 128-bit
encryption , how a password cracker can retrieve that stored password
form the encrypted file .What operation is performed by the cracker to
remove the password and making the file accessible for all options .
Can any one please help me in this ....
Regards,
Madni
Madni
|
|
|
|
|
Please don't cross post.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
hi there,
I use LPT for printing my documents because i want to control my pages and lines,but when i want to print an image it takes too long to convert the image into monochrome bitmap for black/white printers and also there is a puase between each line of printing.I want to know how Windows prints images so fast...
thanks
|
|
|
|
|
Converting an image to greyscale shouldn't take very long.
I imagine that Windows really just passes the images to the print driver, and the driver does the rest.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
it is so,but the point is when we are using windows to print,there is no control over pages and lines of printing which causes so many trouble in continuos papers.
|
|
|
|
|
How do you mean by 'using windows to print' ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
i mean when we are using .net to print
|
|
|
|
|
OK, that's kind of the opposite of what you said
I find it difficult to believe that .NET does not support those things.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
ofcourse .Net does not suppport line control because when you want to print by .Net it just prints the page and you can not for example force the print to advance one line not one page,this is my problem...
|
|
|
|
|
I was just wondering if there was anyway of getting some HTML to display in a column of a DataGridView? For example the following string is displayed in the column but instead of the word 'keypads' appearing in cyan, like they do in this post, the actual html tags are displayed.
C:\Documents and Settings\mrp\My Documents\Documents_html\New\REF_Keypads\qhm_about_master_keypads.htm
Any help is greatly appreciated.
|
|
|
|
|
It can be done, but it's a beast to do. Learn to do custom cells for the DataGridView. Once you know how that's done, you need to have a custom HTML data grid view cell. To do that, you need to be able to render HTML to a cell: you can do this using the mshtml control and its IHTMLElementRenderer interface, which has a DrawToDC method that you can use to render HTML to some graphics surface. See here [^]for more info.
|
|
|
|
|
i have to validate values on client side...
after all the validations i need the entered the value by the user...
that has to be carried to cs file
i can validate using javascript and html tags..
how can i get input which i have evaluted with html controls and javascript to cs file...
asp.net controls doesnot support java script
|
|
|
|
|
kalyan_2416 wrote: asp.net controls doesnot support java script
That's not really true. ASP.NET controls ARE HTML and javascript.
The easiest way to pass values back to the server is to put a HiddenField control on your page, write some javascript which passes the control's Id to a variable, then you can grab the control and put values in there, they will then be available on the server side on postback.
I'm still not sure what you mean tho, how is validation significant here ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hi,
I need to detect a particular USB device connected to the computer. To do this I use the SetupAPI to enum all usb devices and retrieve the vendor ID. However, I know that the device is a Mass Storage device so I need to retrieve the device path from the DISKDRIVE/USBSTOR class to be openned with CreateFile for SCSI Pass Through. How can I relate a raw usb device to its usbstor class.
It happens that if I open Device Manager and view the properties under the
Universal Serial Bus controllers->USB Mass Storage Device
for the device in question, under Details, Bus Relations, this string correspond to the device in question under
Disk drives->Properties->Details->Device Instance ID.
|
|
|
|
|
I'm working on a serializer and I've run into an issue with private field access. When I emit and run the IL code to access the private field of a class, it results in a FieldAccessException. I've gone looking for information on this but found very little. One of the suggestions was that the class I emit, that has the code that accesses the private fields must be have a special permissions attribute.
So I added the following to my type builder for the class:
Type[] ctorParams = new Type[] { typeof(SecurityAction) };<br />
<br />
ConstructorInfo ci = typeof(ReflectionPermissionAttribute).GetConstructor(ctorParams);<br />
PropertyInfo pi = typeof(ReflectionPermissionAttribute).GetProperty("Unrestricted");<br />
<br />
CustomAttributeBuilder cab = new CustomAttributeBuilder(ci, new object[] { SecurityAction.Assert }, new PropertyInfo[] { pi }, new object[] { true });<br />
<br />
typeBuilder.SetCustomAttribute(cab);
However, this still results in the same FieldAccessException. Does anyone have any experience with private field access via the ILGenerator, and could shed some light on this for me, I would be very happy.
I've also tried:
typeBuilder.AddDeclarativeSecurity(SecurityAction.Demand, new PermissionSet(PermissionState.Unrestricted));
With the same result.
|
|
|
|
|
Hi to all!
What is the worlds biggest .NET open source project?
is it NASAs World Wind project?
Regards,
cyberjoe
|
|
|
|
|
I don't think Guiness Book of World Records keeps track of developer specific projects. Would this be better suited in one of the more general forums, considering this is not a C# question that needs assitance?
Regards,
Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
Visit my homepage Oracle Studios[ ^]
|
|
|
|
|
Here are two different code approaches I have used, but neither works.
int i = thisForm.GetChildIndex(textBox);
thisForm.Controls[index].Text = "Something";
thisForm.Controls[index].Invalidate();
and
Control controlTest = thisForm.textBox;
controlTest.Text = "Something";
controlTest.Invalidate();
The reason I'm trying to do this is that I would like to be able to "map" controls to fields in a database (I'd like to do it myself rather than do data-binding), so I need a way to be able to create a list (or other collection) of controls and the data field to put in that control. It is rather like UpdateData in VC++. But I can't seem to update the screen with code like what I've shown above.
How do I go about this? I hope the question makes sense because I'm sure one of you guys knows how to do it if I can just figure the right way to ask the question.
Thanks.
|
|
|
|
|
I wonder if you need to cast it to be a textbox first ?
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thanks for the suggestion, but it turns out the problem was something totally different.
The textbox in question is part of a CustomControl, and when I declared the public Attribute for Text I accidentally used the "new" keyword instead of "override". So, when I set .Text for the control, it was not actually setting the .Text for the TextBox part of the CustomControl like it was supposed to.
Turns out the code snippet I put in my original message DOES work just fine.
Thanks anyway for the response.
|
|
|
|
|
I want to create a program to relay stuff trough full screen applications,
Like multi media keyboard volume displays.
But i have no idea where to start could anyone point me in the right direction please.
|
|
|
|
|
Every C# application i make takes an excessive amount of RAM, like, the program I'm working on right now is about 500kb in size, but it takes almost 20MB ram.
I release every resource i use by flushing\closing\disposing\making it null and then calling the garbage collector but the app still takes like 17mb RAM...how can i make my program use less memory?
and another question: how can i use an exterior icon in my application, as in not compiling the program with it, but making the program use an exterior ICO file (thereby making it smaller)?.
|
|
|
|
|
It doesn't matter whether or not you load/unload resources. You could have a program that wrote Console.WriteLine and then Console.ReadLine and do nothing else, and the memory will still be taken up - the reason is because you still need to load the Runtime into memory.
the last thing I want to see is some pasty-faced geek with skin so pale that it's almost translucent trying to bump parts with a partner - John Simmons / outlaw programmer
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
If you're judging by the "Memory" column in task manager, that isn't the amount of memory your app is using. To prove it to yourself, minimize your application and see how much "memory" your app is using. (Hint: the "memory" tab is how much Windows has allotted to your process, not how much your process is actually using)
p.s. you don't need to null references; the garbage collector will free them when there are no more references to the object, regardless of whether it's null.
|
|
|
|