|
Hello
Recently I have been disturbed by the window message "WM_GETTEXT" and the function GetWindowText(). By sending message "WM_GETTEXT" I can get the content of the edit control in the other process while failed by using "GetWindowText".
I can not find any difference between sending "WM_GETTEXT" and using "GetWindowText()".
Can you tell me why
wanglei
|
|
|
|
|
MFC objects (at least CWnd objects) cannot be used across separate threads, that's why it doesn't work.
|
|
|
|
|
While GetWindowText() does send a WM_GETTEXT message, it does so only if the window belongs to the current process. If the window belongs to a different process and has a caption, GetWindowText() retrieves the window caption text. If the window does not have a caption, the return value is a null string. This is all spelled out in the documentation.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Consider a MFC MDI prog,
when you maximize a childframe,you will see three icons(minimize,maximize and close) on the right side of the menu.I Want to know,how to draw icon on the right side of menu except menu bar?
besides,how can I make the three icon not visiable?
|
|
|
|
|
WillTian wrote: how can I make the three icon not visiable?
Change the style in
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
or
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
Es:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)<br />
{<br />
if( !CMDIFrameWnd::PreCreateWindow(cs) )<br />
return FALSE;<br />
cs.style = WS_OVERLAPPED | WS_CAPTION | FWS_ADDTOTITLE<br />
| WS_THICKFRAME | WS_SYSMENU;<br />
<br />
return TRUE;<br />
}
cuts minimize and maximize buttons.
Sorry but I don't know how to add more buttons or how cut the close button.
|
|
|
|
|
thanks,reset cs.style WS_CAPTION cut the close button
drawing a button is also an easy job,use CWnd::Create() to do so,but I don't know how to draw on the right side of menu,I can't retrive the RECT position.
Neither MainFrame nor ChildFrame contains the menu area.
CMenu is derived from CObject but CWnd.
|
|
|
|
|
how to know the app's name which is sending or receiving data packages in the network.
i know using the DDK can work,but i do not know how to use it
who can give me some idea.
Thanks
hi
|
|
|
|
|
Hi,
With the available video(avi) i want to display text at the bottom(like subtitles). Can some one gimme a good start up by suggesting the interfaces to be used or if any sample code available.
JK
|
|
|
|
|
Look at the DirectShow samples from the latest Platform SDK (The project files are missing though - so if you want them get the DirectX Feb 2005 SDK Extras). There are a few ways to go about doing this depending on what sort of flexibility that you need. You could create your own subtitle filter and connect it to a VMR7/9 filter (with another connection to your video), you could connect to the overlay filter with the old video renderer. Your subtitle filter could perform the mixing itself (VSFilter does this) but that means you'd have to support a variety of input/output colorspaces.
|
|
|
|
|
Hi,
Hope someone can help me with this.
I want to identify a specific OLE DB error and display an error message that my users can understand.
The way it is displayed right now is like this:
Source:"Microsoft OLE DB Provider for SQL Server"
Description:"Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)."
hr = 0x80040e14
The hr should be equal to DB_E_ERRORSINCOMMAND, but this error code is used for other errors as well.
How can I identify that it is the "Maximum stored procedure, function, trigger, or view nesting level exceeded (limit 32)" message that is displyed? I'd really like to change it to something that my users can understand. But I can't find anything to go on, please help me.
I've included my error messaging function.
void DisplayOLEDBErrorRecords(HRESULT hrErr) {
CDBErrorInfo ErrorInfo;
ULONG cRecords;
HRESULT hr;
ULONG i;
CComBSTR bstrDesc, bstrHelpFile, bstrSource;
GUID guid;
DWORD dwHelpContext;
WCHAR wszGuid[40];
USES_CONVERSION;
LCID lcLocale = GetSystemDefaultLCID();
hr = ErrorInfo.GetErrorRecords(&cRecords);
if (FAILED(hr) && ErrorInfo.m_spErrorInfo == NULL) {
OLEDBErrorMessageBox( "No OLE DB Error Information found: hr = 0x%x\n", hr);
return;
}
for (i = 0; i < cRecords; i++) {
hr = ErrorInfo.GetAllErrorInfo(i, lcLocale, &bstrDesc, &bstrSource, &guid, &dwHelpContext, &bstrHelpFile);
if (FAILED(hr)) {
OLEDBErrorMessageBox("OLE DB Error Record dump retrieval failed: hr = 0x%x\n", hr);
return;
}
StringFromGUID2(guid, wszGuid, sizeof(wszGuid) / sizeof(WCHAR));
OLEDBErrorMessageBox( "Source:\"%s\"\nDescription:\"%s\"\nhr = 0x%x\n\n", OLE2T(bstrSource), OLE2T(bstrDesc), hrErr);
bstrSource.Empty();
bstrDesc.Empty();
bstrHelpFile.Empty();
}
}
|
|
|
|
|
Hi again and thank you all for the great help that you are giving me
Do you know if there is any built in function to convert a hexadecimal number to decimal. I store the hex number into a string
string hex="EE1000" and i want to convert it to decimal
Thanks again
|
|
|
|
|
C++ faqs[^]
Nibu thomas
Software Developer
|
|
|
|
|
sscanf( str, "%x" , &num ) is enough.
- NS -
|
|
|
|
|
Hey NS17 thanks a lot thats all i need
appresiate the help
|
|
|
|
|
Welcome...
- NS -
|
|
|
|
|
But what if the hex value with me is in string format?
|
|
|
|
|
Can you clarify a little more?
- NS -
|
|
|
|
|
I have tried the following code which is not working.
char str[100]="ff";
char newstr[100];
sscanf(newstr, "%x", &str);
AfxMessageBox(str);
can you please tell me what is the problem here. (
|
|
|
|
|
"%x" is used to read a hexadecimal number from a string to an integer variable.
In your code your are trying to read it to char array, not to an int or long.
If you want to show the read number then try like this:
char str[100]="ff";
char newstr[100];
int num;
sscanf(str, "%x", &num);
sprintf(newstr,"decimal = %d",num);
AfxMessageBox(newstr);
It will display 255.
- NS -
|
|
|
|
|
Thank you. Its working fine.
|
|
|
|
|
I think it's funny how everyone forgets about the easiest way to do this:
strtol()[^], that is a part of the C runtime library.
--
Roger
It's suppose to be hard, otherwise anybody could do it!
|
|
|
|
|
antonaras_marcou wrote: Do you know if there is any built in function to convert a hexadecimal number to decimal.
Just use strtol() .
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"We will be known forever by the tracks we leave." - Native American Proverb
|
|
|
|
|
Hi all
i want a graph control that has Linear,Quadratic,Power and Exponential Curve fitting features in MFC.
Any Links or info would be appreciated....
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
Hi all,
How to make an MDI child window top most among all other children?
Thanks in advance,
Sarvan AL
|
|
|
|
|
MDIActivate(...)
Nibu thomas
Software Developer
|
|
|
|