|
Any help here?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi,
I need to get notification when ever a Db exception is occuring in my application.
Is there a way to hook the DBException when it occus anywhere in the application?
Thanks
|
|
|
|
|
See if SetUnhandledExceptionFilter() helps
-Suhredayan
|
|
|
|
|
My program is only 3XX KBytes size.
It start very fast (1 to 2sec) in XP, but very slow (about 13sec) in Vista. What's problem? How to make it faster?
Please help!!
|
|
|
|
|
LaHaHa wrote: What's problem?
At this point, it could be most anything. Do all of your programs behave in this fashion? Are the slow ones connecting to a database or a remote machine? Could it be a security issue?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
How to solve it if it is the security issue?
Please help!
|
|
|
|
|
#define rand01 (0.9999999*double(rand())/RAND_MAX)
....
used later in the line
r = int(floor(N*rand01));
N is an integer with a value of 1000...
what does rand01 produce?
please help
many thanks
Give me strength, give me caffeine
|
|
|
|
|
a random number between 0.0 and 0.9999999
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
cool thanks for that...any idea of how to get that functionality into java?
thanks again
Give me strength, give me caffeine
|
|
|
|
|
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
|
|
|
|
|
I have been assigned the task of updating a Visual C++ 6 software package to Visual C++ 2008. VS2008 did a bang up job during the conversion, leaving but a couple of dozen items to repair my self. One in particular has me against the wall.
Here is the reported error;
error C2678: binary '||' : no operator found which takes a left-hand operand of type '_bstr_t' (or there is no acceptable conversion)
The line it refers to is;
ASSERT(m_bstrDataSource);
Here is the ASSERT definition in AFX.H;
#define ASSERT(f) DEBUG_ONLY((void) ((f) || !::AfxAssertFailedLine(THIS_FILE, __LINE__) || (AfxDebugBreak(), 0)))
I would greatly appreciate some guidance.
|
|
|
|
|
Dale Bourne wrote: I would greatly appreciate some guidance.
Do you have comdef.h included?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
try ASSERT(NULL != m_bstrDataSource);
The ASSERT macro needs to passed a boolean expression so that (f) in the macro will evaluate to either true or false .
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Hi dudes!
I am currently facing this problem, i am creating a new MFC static Dll but when i add the CLR support i get weird errors like:
->Command line error D8016 : '/MTd' and '/clr' command-line options are incompatible cl
i "fixed" this by changing Runtime Library to '/MDd' option
And then it throws me:
->fatal error C1189: #error : Building MFC application with /MD[d] (CRT dll version) requires MFC shared dll version. Please #define _AFXDLL or do not use /MD[d] C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\include\afx.h 24
I change my Dll to MFC shared dll version
Next it compiles but it gives me this warnings:
->warning LNK4099: PDB 'mfcm80ud.i386.pdb' was not found with 'C:\Program Files\Microsoft Visual Studio 8\VC\atlmfc\lib\mfcm80ud.lib' or at 'c:\XXX\npwyncs_dll\debug\mfcm80ud.i386.pdb'; linking object as if no debug info
My question is what is the correct or best way of doing an MFC dll support CLR, cause i am not too comfortable doing all this ?
Thx
|
|
|
|
|
materatsu wrote: Hi dudes!
materatsu wrote: My question is what is the correct or best way of doing an MFC dll support CLR, cause i am not too comfortable doing all this ?
Dude! Since you asked for the "best" way, it's the same as always, reading the freaking documentation is the best way. See how simple it is to find?[^]
led mike
|
|
|
|
|
i have created a owner drawn button which works in debug version
but if i build my project in release version it does not work.
|
|
|
|
|
|
I am writing an application using C++ and MFC under Windows. I would like the application to be able to send email to me regarding its status. Is there an MFC class library that could help me do this? Is there a windows system call to send email?
Thanks
Bob
|
|
|
|
|
|
See the mail-related articles here.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
I'm working on a program that basically sits and acts as a system monitor. Two of the primary things that I want it to do are monitor system memory and display when the last time a virus scan was made. Any suggestions on how I might go about this?
Thanks in advance
|
|
|
|
|
What do you want to know of memory?
|
|
|
|
|
DarthKarnage wrote: want it to do are monitor system memory
Can you explain what you mean by system memory? In windows everything is in terms of virtual memory, on 32 bit windows an application can technically can have 4GB(2^32) of memory, however normally your application have only 2GB unless you use boot parameter or Address Windowing Extensions to get more.
DarthKarnage wrote: display when the last time a virus scan was made.
There are different types of virus scanning: you can choose a file and run a scan only on that, or you can scan a drive or all the drives, or can always monitor the filesystem and scan only any new files getting created. This all depends on the settings you do on the antivirus you have on your machine. If you are expecting windows provide any APIs to get this information, I don't think there would be any.
-Suhredayan
|
|
|
|
|
Hello friends.
I have comma seperated x and y coordinates. I need to draw these. Do you have advices? How can i do this?
I've heard Visual C++ has a OnDraw() function. Or can I use OpenCV? Or something else?
Thank you all.
|
|
|
|
|
You mean you need to have some kind of graph ?
If that's the case, take a look at my sig, I developped a chart control that could be usefull for you. If not, there a section on code project with different charting controls.
|
|
|
|