|
str = L"This is an aple";
str+=L"\n";
str+=L"This is a bat";
str+=L"\n";
str+=L"This is a cat";
str+=L"\n";
fputws((wchar_t*)str.c_str(), outFile) ;
Did u get it or i need to be more clear.
|
|
|
|
|
I just tried this using VS 2008 and it is working fine. I am not sure what is the problem, is str used at some other place.
-Saurabh
|
|
|
|
|
Your code works fine with VS6.
"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
|
|
|
|
|
Hi,
Id like to be able to intercept the output of some of the basic
windows drawing functions and record it somewhere. In particular drawtext.
Ive read that this can be achived by CBT hooking.
Despite reading several articals including the ones on this site im totally confused.
In my mind I image the process should work like this ...
I write a function call mydrawtext which takes in the same parameters as drawtext.
Writes the incomming info to a file and then calles the real drawtext.
I store it in mydrawtext.dll file and then compile it into a mydrawtext.lib
Next ...
I write a small .exe which when exectued figues out where the real drawtext function lives in memory
places a copy of mydrawtext.lib into the same address space
and then writes a few intructions to the location of the real drawtext fuction so that all calls to it are diverted to mydrawtext.
All the examples ive seen are totally confusing. Injecting insructions are inside the .dll. I cant work out whats going on ?
What would be really great is dead simple abc example of something like how to capture the input/output of the windows drawtext function.
Thanks,
Mark.
|
|
|
|
|
Hi Experts,
How can I create a entry for spacific file on right click in context menu of windows. Like if we create entry for all files, we create entry under
"*\\shellex\\ContextMenuHandlers\\OurKey" but what to do only for .txt file or .pst file?
|
|
|
|
|
|
i have a simple dialog project with a button and multiline edit control.
button click runs a worker thread which updates edit control data.
and i have also mapped the ON_WM_CTLCOLOR() to change colors of controls
and dialog.
if i run the thread 2-3 times my program crashes.but if i comment all
my coloring code from ON_WM_CTLCOLOR() it runs fine without any problem..
|
|
|
|
|
You should not update UI from workerthread.
Regards,
Sandip.
|
|
|
|
|
Hi,
I'm trying to create a manifest file in order to set the setting for UAC in Vista.
I already refer to msdn document. If I want to develop codes that need to be run in Vista and XP, I need to use the notes for-Building and Embedding a Manisfest with Microsoft Visual Studio 2005 for Windows Xp and Windows Vista Applications.
This is my manifest file.
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestversion="1.0">
<ms_asmv2:trustinfo xmlns:ms_asmv2="urn:schemas-microsoft-com:asm.v2">
<ms_asmv2:security>
<ms_asmv2:requestedprivileges>
<ms_asmv2:requestedexecutionlevel level="asInvoker">
But when I run, I got this error message:
general error c1010070:failed to load and parse the manifest.
FYI, I already go to Project Properties-Linker-Generate Manifest - NO.
Beside that, I also change at Project Properties-Manifest Tool-Input and Output-Additional Manifest File (i type the manifest file name).
Any ideas about this?
Thanks
|
|
|
|
|
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.
|
|
|
|