|
Hello
You need to set Allow Unsafe Code Blocks in Configuration Properties of your project.
And of course use
unsafe
{
}
Andrew
|
|
|
|
|
hi
i have written a program before .but when i run that now this error was appeared:
An unhandled exception of type 'System.ArithmeticException' occurred in system.drawing.dll
Additional information: Overflow or underflow in the arithmetic operation.
please help
thanks
|
|
|
|
|
Without seeing your code and the line on which it breaks, it's impossible to tell you whats wrong. What is your code doing when it breaks?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello to everybody!
I've been programming in c# for a couple of months and got a problem in an application i'm creating for a little company.
my application lets you control a little transponder reader, linked to the pc by a serial cable. this application should also let you update the firmware, using an external executable thet was created by another software house.
this external program shows a little form with an "update!" button. users should click on this button to start firmware updating.
the problem is, my boss doesn't want this little form to appear and wants instead the firmware to be updated without users have to click on this external form.
i found the code of an old c++ program they used to do this. it used the function setTimer to give the little form a value corresponding to "enter" key, immediately starting the firmware update.
is there any way to do this in c#?
please understand i am relatively new to the world of programming. i studied a little java at the university and a little c# by myself.
i'd really appreciate any help on this, because i can't really cope with this.
oh and by the way sorry for my bad english.
thanks in advance, Rey9999
|
|
|
|
|
Hi,
1. Checkout if the external program allows to you to have command line options for updates. like /u etc, to find out use <appln.exe> /? or /help
2. Otherwise, use process ProcessInfo to call the application and use Process.Showwindow = false (dont remember the exact function name) and use Sendkeys "{SPACE}" if you still wish to do the old C++ way.
3. The otherway would be to use Win32API to execute commands and get hold of the window.
|
|
|
|
|
thanks for your fast reply!
i tried solution no. 1 but this application takes no parameters.
so i tried solution no. 2 but i noticed the "keystroke" is sent to my form, not to the external application; i think it's because my form is seen as the active application, not the external executable.
i'd like to try solution no. 3 but i don't really know how to do it.
i know i may sound annoying but can you give me a hint on using this Win32API stuff?
i wish i knew more about programming but you know italian universities...
thanks alot, Rey9999
|
|
|
|
|
Hi,
maybe somebody use CSTA in C#? where i can find some sample? etc.
Greetings
|
|
|
|
|
What do you mean with CSTA?
Canadian Sport Tourism Alliance?
California Science Teachers Association?
(These were among the first results from Google for CSTA)
Or Computer Supported Telecommunications Application?
Or something else?
With just a TLA or FLA it's hard to find what you want.
mav
(TLA: Three Letter Acronym, FLA: Four Letter Acronym)
|
|
|
|
|
Heh....
just Computer Supported Telecommunications Application
Greetings
|
|
|
|
|
I try to build a Form template in VB.Net so later on i can inherit the form template.
in VB.NET i can use
<br />
Public SearchForm As Object;<br />
<br />
'Without instance the real SearchForm Class object<br />
'The real SearchForm will be instance in the inherit form. <br />
'in the init. method<br />
<br />
SearchForm.Show();<br />
the base class sucessfully Compile.
But in C#
<br />
public object SearchForm<br />
'Without instance the real SearchForm Class object<br />
'The real SearchForm will be instance in the inherit form. <br />
'in the init. method<br />
<br />
SearchForm.Show()<br />
but in C# i can't compile it.. an error message come out :
'object' does not contain a definition for 'Show'
:(Please help ... urgent ...
|
|
|
|
|
That's obvious: "'object' does not contain a definition for 'Show'". The type object does not provide a method called Show. Your variable SearchForm must be of type Form, which provides this method.
|
|
|
|
|
Thanks. You are right, at the base class the 'object' don't have "Show" method. The "SearchFrom" only instance in the inheritted form but not in the class.
|
|
|
|
|
Now I want to merge column header of datagrid with C# but I don't know how to do this. Please help me. Thanks.
|
|
|
|
|
Hi,
I am new in C#,i want to scan pixels of spline curve from a bitmap image ,and want to store them in linked list.How Please Help me!!!!!!!!!!!!!!!!!.i will be very thankfull to you.
|
|
|
|
|
So you want to work out which pixels are on the curve ? The curve is on the image and you're trying to find it, or you're defining the curve yourself ?
The List class represents a linked list. You don't need random access then ? I'd have thought an array would be best, seeing as you're not likely to want to insert a pixel in the middle after you work it all out. ArrayList is an array.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I need a month year textbox or a monthyear selection control for an application in c# that displays only months and years and no date similiar to credit card expiry date style selection .Can anyone help from where can i get such a control or any alternative solution
|
|
|
|
|
Please, please, please don't post the same question to every forum on this site.
I answered this question on another forum earlier today.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I am working on a desktop application (Windows based). It has a MDI form and a child form. At a time there will be maximum two child forms. Application has Wizard kind of structure, so has multiple steps.
Some of the times when user working on the application, it
stops responding to any click event though it shows the focus. User can click only on title bar and that works, all other control including menu bar, toolbar does not respond to click. In addition, I noticed there is one extra window you can see when you press Alt+TAB. The name of the window is WindowsFormsParkingWindow. Whenever this window is there, this problem arises.
Can anyone assist how to get rid of this problem
I able to figureout that it happenes when a control which does not have parent and get placed on WindowsFormsParkingWindow and have focus.
|
|
|
|
|
Controls by default are associated with WindowsFormsParkingWindow before they are part of control collection.
This problem occur when the control which is there in WindowsFormsParkingWindow have focus.
http://dotnet.org.za/johannds/archive/2004/03/08/650.aspx
- ashish
|
|
|
|
|
I've write a button base class. In the click even't i put code below:
this.Enabled = false;
this.Clicked(); //is a public virtual method in the class.
this.Enabled = true;
So next time when i when i use the button control i just need to put all my code in the Clicked() method in the custom button control. But the proplem is how do i put the in the Clicked() method ? In VFP i just need to override the Clicked() method with mu on code. But in C# it seen like quit confusing for me. Please advice. Thanks.
Below is the complete class code.
public class stdTextBox:System.Windows.Forms.Button<br />
{<br />
protected override void OnClick(EventArgs e)<br />
{<br />
this.Enabled = false;<br />
this.clicked();<br />
this.Enabled = true;<br />
}<br />
private void clicked()<br />
{<br />
}<br />
}<br />
|
|
|
|
|
What is VFP ?
Clicked is not a method, it's an event. You need to add an OnClicked handler, either by overriding the method, or writing a handler and adding it to the Click method.
Here[^] is some info on the topic.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
VFP = Visual FoxPro. Thanks you very much.
|
|
|
|
|
Hy!
My DragDrop event doesn't work, but the DragEnter and DragLeave events work OK.
I've added EventHandlers to the events. I tried debuging, and i saw that the DragDrop event wasn't called.
What can causes it?
|
|
|
|
|
|
Hi all,
if anyone can help me it would be greatly appreciated...
I created an Excel model in my C# code and now need to send it to the client (on a button click) for download (with the standard Open, Save, Cancel dialog box)
I could save it to the server first as an .xls file and then send it as a file to the client but I would prefer not to do this since the actual file is not even needed on the server side
schoudhr@hotmail.com
|
|
|
|