Click here to Skip to main content
15,913,610 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Hooking DB Exceptions Pin
22491717-Nov-08 19:39
22491717-Nov-08 19:39 
QuestionProgram startup delay in Vista Pin
LaHaHa17-Nov-08 15:17
LaHaHa17-Nov-08 15:17 
QuestionRe: Program startup delay in Vista Pin
David Crow17-Nov-08 16:51
David Crow17-Nov-08 16:51 
AnswerRe: Program startup delay in Vista Pin
LaHaHa17-Nov-08 21:45
LaHaHa17-Nov-08 21:45 
Questiondissertation coding...converting c++ to java...what does this line do? Pin
c#_keithy17-Nov-08 11:37
c#_keithy17-Nov-08 11:37 
AnswerRe: dissertation coding...converting c++ to java...what does this line do? Pin
PJ Arends17-Nov-08 11:52
professionalPJ Arends17-Nov-08 11:52 
GeneralRe: dissertation coding...converting c++ to java...what does this line do? Pin
c#_keithy17-Nov-08 12:01
c#_keithy17-Nov-08 12:01 
GeneralRe: dissertation coding...converting c++ to java...what does this line do? Pin
Dave Doknjas17-Nov-08 13:45
Dave Doknjas17-Nov-08 13:45 
I'm not sure what 'RAND_MAX' is, but other than that, the conversion produced by C++ to Java Converter follows (including a helper class that the converter outputs to help simulate C++ random number functionality in Java):

import java.util.*;

//C++ TO JAVA CONVERTER NOTE: The following #define macro was replaced in-line:
//#define rand01 (0.9999999*double(rand())/RAND_MAX)

private void test()
{
r = (int)(Math.floor(N*(0.9999999 *(double)(RandomNumbers.nextNumber())/RAND_MAX)));
}
//----------------------------------------------------------------------------------------
// Copyright © 2006 - 2008 Tangible Software Solutions Inc.
//
// This class provides the ability to simulate the behavior of the C/C++ functions for
// generating random numbers.
// 'rand' converts to the parameterless overload of NextNumber
// 'random' converts to the single-parameter overload of NextNumber
// 'randomize' converts to the parameterless overload of Seed
// 'srand' converts to the single-parameter overload of Seed
//----------------------------------------------------------------------------------------
final class RandomNumbers
{
private static Random r;

static int nextNumber()
{
if (r == null)
Seed();

return r.nextInt();
}

static int nextNumber(int ceiling)
{
if (r == null)
Seed();

return r.nextInt(ceiling);
}

static void seed()
{
r = new Random();
}

static void seed(int seed)
{
r = new Random(seed);
}
}

David Anton
http://www.tangiblesoftwaresolutions.com
C++ to C# Converter
C++ to VB Converter
C++ to Java Converter
VB & C# to Java Converter
Java to VB & C# Converter
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: convert VB, C#, or Java to C++/CLI
QuestionConv. VC++ 6.0 to VC++2008 Pin
Dale Bourne17-Nov-08 10:17
Dale Bourne17-Nov-08 10:17 
QuestionRe: Conv. VC++ 6.0 to VC++2008 Pin
David Crow17-Nov-08 10:58
David Crow17-Nov-08 10:58 
AnswerRe: Conv. VC++ 6.0 to VC++2008 Pin
PJ Arends17-Nov-08 11:45
professionalPJ Arends17-Nov-08 11:45 
QuestionHow to create a MFC Dll to use managed extensions?? Pin
materatsu17-Nov-08 8:53
materatsu17-Nov-08 8:53 
AnswerRe: How to create a MFC Dll to use managed extensions?? Pin
led mike17-Nov-08 9:21
led mike17-Nov-08 9:21 
Questionvc++ owner drawn button Pin
Rajesh Katalkar17-Nov-08 7:32
Rajesh Katalkar17-Nov-08 7:32 
AnswerRe: vc++ owner drawn button Pin
Hamid_RT17-Nov-08 7:42
Hamid_RT17-Nov-08 7:42 
QuestionEMail Pin
BobInNJ17-Nov-08 6:16
BobInNJ17-Nov-08 6:16 
AnswerRe: EMail Pin
Chris Losinger17-Nov-08 6:41
professionalChris Losinger17-Nov-08 6:41 
AnswerRe: EMail Pin
David Crow17-Nov-08 7:05
David Crow17-Nov-08 7:05 
QuestionSystem monitor? Pin
DarthKarnage17-Nov-08 5:57
DarthKarnage17-Nov-08 5:57 
AnswerRe: System monitor? Pin
Hamid_RT17-Nov-08 7:34
Hamid_RT17-Nov-08 7:34 
AnswerRe: System monitor? Pin
22491717-Nov-08 19:17
22491717-Nov-08 19:17 
QuestionDrawing with pixel coordinates Pin
emrahustun17-Nov-08 4:51
emrahustun17-Nov-08 4:51 
AnswerRe: Drawing with pixel coordinates Pin
Cedric Moonen17-Nov-08 5:02
Cedric Moonen17-Nov-08 5:02 
AnswerRe: Drawing with pixel coordinates Pin
pallaka17-Nov-08 6:42
pallaka17-Nov-08 6:42 
AnswerRe: Drawing with pixel coordinates Pin
Iain Clarke, Warrior Programmer18-Nov-08 2:21
Iain Clarke, Warrior Programmer18-Nov-08 2:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.