|
From MSDN Q169498:
// Obtain the error message for a given HRESULT
CString LogCrackHR( HRESULT hr )
{
LPVOID lpMsgBuf;
CString strTmp;
::FormatMessage( FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
hr,
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT),
(LPTSTR) &lpMsgBuf,
0,
NULL );
// STR_TMP is defined within LOG.CPP to provide safe format string
// for both ANSI and UNICODE
strTmp.Format( "%s", (char *) lpMsgBuf );
// Free the buffer.
::LocalFree( lpMsgBuf );
return strTmp;
}
Brandon
The WTL newsgroup: over 1400 members! Be a part of it. http://groups.yahoo.com/group/wtl
|
|
|
|
|
I'm subclassing a static control. I would like to get the mouse click messages but they don't seem to get generated. I get them if I subclass from a button.
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
Mamke sure the static control resource on the dialog has the Notify style set to be able to get mouse messages.
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
That did it. Thanks!
Cathy
Life's uncertain, have dessert first!
|
|
|
|
|
I created an ATL DLL server project and inserted a new ATL object as a simple one, named Inter. Next, i added a new BSTR-type property named Str.
I wrote:
STDMETHODIMP CInter::get_Str(BSTR *pVal)
{
_bstr_t x(*pVal, FALSE);
m_str=x.copy();
return S_OK;
}
This code links perfectly on debug versions but generates this error:
LIBCMT.lib(crt0.obj) : error LNK2001: unresolved external symbol _main
on release versions.
Do you know how to handle it?
rechi
|
|
|
|
|
|
This is straight from MSDN, help topic _ATL_MIN_CRT :
Note When building a Release version of a project, you can get the following link error:
LIBCMT.LIB(crt0.obj) : error LNK2001: unresolved external symbol _main
This error occurs if you are using CRT functions that require CRT startup code. The Release configurations define _ATL_MIN_CRT, which excludes CRT startup code from your EXE or DLL. To avoid this error, do one of the following:
Remove _ATL_MIN_CRT from the list of preprocessor defines to allow CRT startup code to be included. On the Project menu, click Settings. In the Settings For: drop-down list, choose Multiple Configurations. In the Select project configuration(s) to modify dialog box that appears, click the check boxes for all Release versions, and then click OK. On the C/C++ tab, choose the General category, then remove _ATL_MIN_CRT from the Preprocessor definitions edit box.
If possible, remove calls to CRT functions that require CRT startup code and use their Win32 equivalents. For example, use lstrcmp instead of strcmp. Known functions that require CRT startup code are some of the string and floating point functions.
Roger Stewart
"I Owe, I Owe, it's off to work I go..."
|
|
|
|
|
Thanx!
That was it.
rechi
|
|
|
|
|
I have written an MDI application and its almost finished. I just need to display a help file written in Compiled HTML.
What's the easiest / quickest way to do this?
Thanks
Ali
|
|
|
|
|
Just use shellexecute to execute the compiled .chm file.
Simon
I need your clothes, your boots, and your copy of VS.NET.
Sonork ID 100.10024
Recent bug fixes to Walton's pr0n organiser v1.2b
- fixed a bug where the user's FAT table would be wiped for no reason
- fixed a bug where the user's computer would explode, killing everyone within a 5 foot radius
|
|
|
|
|
yeah, the line of code is
HINSTANCE nRet = ShellExecute(this->m_hWnd, "open", szBuff, NULL, NULL, SW_SHOWNORMAL);
where szBuff is a string variable which contains the full path of the file name and the file name itself.
Thanks!
|
|
|
|
|
Great, I just tried it exactly as you typed it lucy, and it worked straight away, just what I needed.
Thanks.
Ali
|
|
|
|
|
In win2K, it's no problem, but in win98, it's difficult to do.
I try to alphablend by myself, but i can't refresh my dlg when something behide the dialog changed , then i try to set timer to notify me refresh the dialog every a short time, but when the dialog is showwing, i can't get the bitmap behide the dialog from the desktop DC.
anyone could help me?!!
|
|
|
|
|
Maybe you could try to start by specifying WS_EX_TRANSPARENT sty;e when creating your windows. That ways, Windows will paint Windows behing yours first...
But it will not works as smootly as it does in Windows 2000 for few reasons:
- I'm not sure that it apply to non-client area.
- It will causes blinking
- It will probably be slower (particulary when movig full window)
- It's probably a bit bugged and/or limited.
You may also try to enumerated windows behind you and cause them to be paint in a memory DC. It will probably works for some kind of windows and not for others...
Philippe Mori
|
|
|
|
|
Thanks a lot!
Let me try...
|
|
|
|
|
See samples 'DC Utilities' on this site (use search). If you will complete your code successfully, please, mail me result, I want to see it!
|
|
|
|
|
|
How to set single system cursor for ALL System? Required selecting of a fragment of screen.
|
|
|
|
|
Do you want to set the system cursor?
SetSystemCursor
|
|
|
|
|
Yeah, I use it, but it change only one curosor (arow, for ex.). I need SINGLE cursor ALWAYS.
|
|
|
|
|
Alexander Kourov wrote:
Yeah, I use it, but it change only one curosor (arow, for ex.). I need SINGLE cursor ALWAYS.
Call SetSystemCursor multiple times, one for each cursor.
Nish
Regards,
Nish
Native CPian.
Born and brought up on CP.
With the CP blood in him.
|
|
|
|
|
Are you sure, that programs, which allow to select screen areas, doing it similar? May be there is another way?
|
|
|
|
|
Ahhh, now I see what you're getting at (and you should see what you should have told us when you first asked your question ).
There was a project put up here a CP not too many moons ago that displayd how to magnify a portion of the screen in a few different ways. IIRC it just created a top-level WS_INVISIBLE window. That way your client-area is the only thing you'd have to care about. I.e. you just respond to the WM_SETCURSOR message to your window with whatever you want to display.
|
|
|
|
|
I am using MFC dialog application and want to use something other than messageBox to instruct the user what to do. I was thinking something like a note pad that someone can't modify. Can someone help me?
www.nucleus.com/~grant.cooper
|
|
|
|
|
Create a dialog with a read-only editbox....maybe?
/Magnus
|
|
|
|