blah blah blah is here! blah blah » Close

0
votes
1 answers

Optimized algorithm runs slower than original

I'm writing a fractal explorer app. The original mandelbrot test func is: [code] public static Complex MandelbrotTest(Complex C) { int iter = 0; double CI = C.Imag; double tr; ...

1
votes
1 answers

double-precision numbers being miscalculated

I've wasted too much time trying to chase down this very strange bug. Simply put, if I say, for example, double a = 1.3; double b = 4.5; double c = a - b; then the result for c will be -3.2. We all know that despite whatever bla ...

0
votes
2 answers

Help with simple dynamicmethod and ilgenerator

I'm just learning how to generate IL code but I keep getting the error "operation could destabilize the runtime." when I call my dynamicmethod. I thought I was doing something wrong with the code, so I generated a sample method ...

0
votes
1 answers

Problem with overriding properties in custom control

I'm working on my first custom control and I want it to redraw the control when the forecolor/backcolor properties are changed. Currently my code looks like: [code] public override Color ForeColor { get { re ...

0
votes
1 answers

Delegate invocation wrapped in object faster than the delegate itself? Why?

I have a simple method used for benchmarking: [code] double Ceil(double p) { return Math.Ceil(p); } [/code] and two ways of indirectly accessing it. For the following code, let's assume that "method" is a MethodInfo po ...

0
votes
0 answers

how to get bounding rectangle of a region

I'm trying to find the smallest rectangle that can contain a GDI+ region. But when I say: Graphics WinGrx = Graphics.FromHdc(WinDC); RgnBox = WinRgn.GetBounds(WinGrx); The rectangle it returns is always the rectangle that defines th ...

1
votes
1 answers

multithreading issues with pointers

I have a program that processes a big chunk of data and I want to make use of multiple cores so it tells one core to process one half and the other to process the other half. I couldn't figure out how to pass the data back after processing ...

0
votes
1 answers

Why does my form refuse to move?

I have a form and when I say Form1.Top = x; it's not moving. There isn't an error or anything, it just doesn't move. The form is borderless and maximized, but that's never cause problems before. Stepping through the code, I call Form1. ...

0
votes
0 answers

Persistent graphics being erased after redraw (C#)

So I have a custom control (ok, a class with a picturebox) and I'm drawing to a bufferedgraphics, which is then rendered in the Paint event, or after I draw to it. The issue I'm having is that it works fine when I interact with it, but whe ...

0
votes
0 answers

DWM stops/slows down rendering my window after it goes idle

My app relies on a direct3d window which spends most of its time hidden in the background. If I leave it in the background long enough (say, 3 minutes) dwm seems to decide it's not important anymore. Because when I show the window, I noti ...

0
votes
1 answers

Best way to create a form on a new thread and access it?

Threads! They are so frustrating. They are like spoiled children. Especially in VS 2008 where the compiler, like a wicked stepmother, keeps you locked in your thread and doesn't let you play with any of the other threads. My app has got ...

0
votes
1 answers

Creating an array of instances of a derived class not known until run time.

I'm sure my subject line sounded pretty vague. What I'm trying to do is create variables of a type not known until run time. I have an abstract class... <pre> public abstract Class BaseClass { public abstract void Method1(Base ...

0
votes
1 answers

Simpler code takes longer to execute?

This function: <pre> public static Complex operator /(Complex LVal, Complex RVal) { double mod = RVal.Real * RVal.Real + RVal.Imag * RVal.Imag; //(ac + bd) / mod, (bc - ad) / mod ...

0
votes
1 answers

REALLY weird stuff going on with threads...

My thread is modifying a variable it doesn't have access to before it even starts, and breaking with an error even though it's created inside a try/catch block! But it doesn't do it when I step through the program! Simply put, I have an a ...

0
votes
1 answers

Direct3D stutters after being idle for a minute or so...?

So my direct3d app goes invisible when not in use. It pops up on command, shows its graphics and they are nice and smooth, then goes away when you're done. But if you wait more than a minute or so between calls, it will be real jittery fo ...

Feedback