|
Yes.Here is the code part using IDataObject:
LPDATAOBJECT pDO;
//FORMATETC definition
FORMATETC fmtetc = {0};
fmtetc.cfFormat = CF_TEXT;
fmtetc.dwAspect = DVASPECT_CONTENT;
fmtetc.lindex = -1;
fmtetc.tymed = TYMED_ISTREAM;
fmtetc.ptd = NULL;
//STGMEDIUM definition
STGMEDIUM medium ;
medium.tymed =TYMED_ISTREAM;
medium.pstm = lpStream;
lpStream->AddRef();
medium.pUnkForRelease = NULL;
pDO->SetData(&fmtetc,&medium,TRUE);
Is there any thing i have to add before setdata()?
Saravana Kumar
|
|
|
|
|
I can't see anything obviously wrong here. Can you send the machine code around the instruction that is causing the crash and a stack trace?
Steve
|
|
|
|
|
i have to give a presentation on any rescent trends in IT... can anyone suggest a good title... thanks-V.G
|
|
|
|
|
"Beauty & the Beast" (lucrative but dangerous)
"Earn like kings & live like Queens" (more salary, posh living)
"Respected Career" (b4 only docs & engrs were respected, now IT guys also)
Best Regards,
Bobby
|
|
|
|
|
Hi,
I'm running this package at http://www.codeproject.com/audio/featuretracking.asp in visual studio.net and encountering the following problem:
c:\featuretracking_src\Tracker.rc(436): fatal error RC1015: cannot open include file 'res\Tracker.rc2'.
Please help.
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
Look for the file "c:\featuretracking_src\res\Tracker.rc2". Is it present?
Steve
|
|
|
|
|
Hi Steve,
Thanks for your response.
When I downloaded this package it did not have any 'res\Tracker.rc2'.
But when I try to run this package it certainly asks for it.
Is the file missing from the package?
<<if you="" want="" can="" have="" a="" lok="" at="" the="" package="" "http:="" www.codeproject.com="" audio="" featuretracking.asp"="">>
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
|
Hi Steve,
Thanks for your help. I too think that a file is missing from the package. But there is no such comment on the page where this package is released. There are only +ve comments.
Please help.
Thanks & Regards
Anish chowdhri.
|
|
|
|
|
Is there a way to make an output such as
<code>Cout << "your message here" << endl;</code>
look as if it were being slowly typed out instead of just poping up instantly? like perhaps putting a pause between each letter? I know my post is a little grey,Thanks for your time!
Fresh picked coder
-- modified at 18:18 Friday 27th January, 2006
|
|
|
|
|
Output one letter at a time with a call to Sleep() inbetween each leter.
cout << 'y';
Sleep(50);
cout << 'o';
Sleep(50);
...
cout << endl;<pre>
<hr>
"You're obviously a superstar." - <small> Christian Graus about me - 12 Feb '03</small>
"Obviously ??? You're definitely a superstar!!!" - <small>mYkel - 21 Jun '04</small>
"There's not enough blatant self-congratulatory backslapping in the world today..." - <small>HumblePie - 21 Jun '05</small>
Within you lies the power for good - Use it!
|
|
|
|
|
|
If you want this behaviour on more places, you should create a new output stream that accepts strings like your example and internally pauses between outputting each letter. The basic idea is the following:
class StdOutWithPause
{
public:
StdOutWithPause& operator << (const char* pszArg)
{
for( int i = 0; i < strlen(pszArg); i++ )
{ std::cout << pszArg[i]; Sleep(100); }
return *this;
}
};
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
We have a need to change the title bar of our SDI application. I have successfully used the Dundas Ultimate Toolbox 9 COXCaptionPainter and COXCaptionInfo classes to achieve this. I have resolved issues I faced with title bar changing back to Windows style look when the application window loses focus or is partially covered by another window etc. The one problem I am now wrestling with is while displaying modal windows such as the "About box" or "File Open". In these situations, the parent SDI window title goes back to its native Windows style look! Since the parent message loop does not execute when a modal window is displayed, how can I ensure the parent title bar is painted correctly? Any help will be appreciated.
Thanks,
Ganesh
|
|
|
|
|
hiho@ll
what i'm interested in:
zonealarm opens a window if a "unkown" app wants to access the internet and asks if this app is allowed to do this
spybot does the same for the registry. if a app wants change the registry a window is opened to ask the user if this is allowed
btw: i'm not only interested in how do zonealarm and spybot know such stuff (that a app wants to change something), how can zonealarm or spybot can decide if the app is allowed or not? how can zonealarm control what the other apps are allowed to do?
how does such stuff work?
does it work for everything? (control of hardware and every software e.g. check if a specific function of a dll should be called?) is it a hook? if yes, how do they work? (a hint should do it)
thx@ll
-- modified at 14:58 Friday 27th January, 2006
|
|
|
|
|
Not exactly what you want, but I think it will show you how to control process creation system-wide, using hooks. Clickety
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
-- modified at 5:38 Saturday 28th January, 2006
|
|
|
|
|
ThinkingPrometheus wrote: if a app wants change the registry a window is opened to ask the user if this is allowed
btw: i'm not only interested in how do...spybot know such stuff...
RegNotifyChangeKeyValue() is one possibility.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I would think large parts of such programs (ZoneAlarm) would run in ring 0 - essentially a driver. Programs like FileMon and RegMon from SysInternals[^] work like this.
Steve
|
|
|
|
|
thx guys
seems like a lot of work
but i think driver programming is a good hint
|
|
|
|
|
Hello,
I'm developing under Visual Studio 2005. I read that Unicode support has been made the default in Visual Studio 2005. And I can't compile anything.
All usual API functions I use, expect char* pointer. When I pass them a wchar_t* pointer, i get a compiler error.
When I try to cast from wchar_t* to char* I get an error all the same.
Please, can somebody help?
Thanks
-- modified at 14:00 Friday 27th January, 2006
|
|
|
|
|
check the size of the wchar_t value (i.e. check what sizeof(wchar_t) returns. In the past it was the same as an unsigned short. But I have heard that it is now no longer that by default. There should be some setting to turn that back on somewhere in the project C++ settings.
¡El diablo está en mis pantalones! ¡Mire, mire!
Real Mentats use only 100% pure, unfooled around with Sapho Juice(tm)!
SELECT * FROM User WHERE Clue > 0
0 rows returned
Save an Orange - Use the VCF!
|
|
|
|
|
If you're using MFC, a simple way to do it is by using CStringA:
<br />
wchar_t* pBlah = L"blah";<br />
CStringA strAnsi(pBlah);<br />
CallAPI(strAnsi);<br />
If you're not using MFC, there's a handful of ways of doing it. The common Win32 routine is WideCharToMultiByte.
BTW, which APIs are you calling that expect a char*?
"My dog worries about the economy. Alpo is up to 99 cents a can. That's almost seven dollars in dog money" - Wacky humour found in a business magazine
-- modified at 14:49 Friday 27th January, 2006
|
|
|
|
|
Actually I'm using MFC and your trick is very clever.
Thanks for replying.
Cheers,
Allad
|
|
|
|
|
If you're using MFC8, there's a better trick: CW2A() (there's actually a bunch of conversion classes, which you'll find the MSDN help)
|
|
|
|
|
These were introduced with VS 2002 IIRC - they are certainly in VS 2003.
|
|
|
|