comp.os.mswindows.programmer.win32
  Home FAQ Contact Sign in
comp.os.mswindows.programmer.win32 only
 
Advanced search
April 2008
motuwethfrsasuw
 123456 14
78910111213 15
14151617181920 16
21222324252627 17
282930     18
2008
 Jan   Feb   Mar   Apr 
 May   Jun   Jul   Aug 
 Sep   Oct   Nov   Dec 
2008 2007    
total
comp.os ... win32 Profile…
RELATED GROUPS

POPULAR GROUPS

more...

 Up
  How do I add components in Visual Studio Express C#?         


Author: James Davis
Date: Apr 14, 2008 11:07

I am studying for an MCSD exam so learning to program in C#. Here's
the problem. The book I have wants me to add a component (separate
from the main form) and then put a timer on that component. I was
able to do that in my 60 day evaluation version Microsoft Visual
Studio .NET 2003, but this version has somehow crashed after I
installed some Server 2003 updates and I have thrown away the CD.

So I installed the free Visual Studio Express C#, but this doesn't
offer the choice to add a component. You are probably saying I should
just add a class. But here is the problem. I can't get the timer to
be in the same scope as the class it is supposed to act on, because I
can only drop the timer on the main Form instead of creating a
component for my DoghnutMachien class and dropping the timer in
there.
Show full article (1.67Kb)
no comments
  How do I add components in Visual Studio Express C#?         


Author: James Davis
Date: Apr 14, 2008 11:07

I am studying for an MCSD exam so learning to program in C#. Here's
the problem. The book I have wants me to add a component (separate
from the main form) and then put a timer on that component. I was
able to do that in my 60 day evaluation version Microsoft Visual
Studio .NET 2003, but this version has somehow crashed after I
installed some Server 2003 updates and I have thrown away the CD.

So I installed the free Visual Studio Express C#, but this doesn't
offer the choice to add a component. You are probably saying I should
just add a class. But here is the problem. I can't get the timer to
be in the same scope as the class it is supposed to act on, because I
can only drop the timer on the main Form instead of creating a
component for my DoghnutMachien class and dropping the timer in
there.
Show full article (1.67Kb)
no comments
  GetCommState failed with error 87         


Author: uvbaz
Date: Apr 14, 2008 07:12

Hi,

i'm trying to set the serial port.(XP SP2, Visual Studio 2005). I use
the example code from MSDN "configuring a communications resource".

CreateFile pass through, however GetCommState return 0.With
GetLastError(), i get the error number 87, which means
"ERROR_INVALID_PARAMETER The parameter is incorrect. "
I'm sure the serial port works, because i can use another program to
read/write through it.

thx
Cheng
no comments
  MFC app crashing in release: what I found         


Author: Bruce Varley
Date: Apr 14, 2008 06:24

> Hi, My MFC application is bombproof in Debug, but crashes in release. The
> Windows error message states that a specified memory location could not be
> read.
>
> In release the program starts up OK and does quite a lot. The crash occurs
> when a key is pressed, ie. the first keyboard message is sent (WM_CHAR).
> Any suggestions on an area to look in? TIA

I managed to shrink the problem back to essentially an MFC Hello world, with
only a null keyboard handler to manifest the problem. Then, purely as a
guess, I removed one of the arguments from the handler, ie. changed the
prototype to ...(UINT, UINT), and the problem went away. I'm confused, all
the documentation I have on CDC::OnChar, the prototype is at the end. But
that standard form causes a crash.

It seems that these internal handler functions aren't type checked by the
compiler, I was able to set the args so that hte application was obviously
beset with a major problem (which was difficult to find) and there were no
errors reported. Is there some technique or settings that enable this sort
of nasty problem to be flagged? Or is this just something that the MFC
structure can't see?
Show full article (1.27Kb)
2 Comments
  InterlockedExchange implementation         


Author: Oleh Derevenko
Date: Apr 14, 2008 01:13

Hi All,

Does anybody know why InterlockedExchange is implemented as

mov ecx,[esp+4]
mov edx,[esp+8]
mov eax,[ecx]
@retry:
lock cmpxchg [ecx],edx
jne @retry
ret 8

Instead of simply
mov ecx,[esp+4]
mov eax,[esp+8]
xchg [ecx], eax
ret 8

?

xchg automatically assets LOCK# signal and is atomic. What to make loops
for?

Oleh Derevenko
39 Comments