|
you are making fun to yourself.
next time, read post first before writing down your funny reply.
|
|
|
|
|
I remember that most your replys got low vote like here[^] do you know why?
|
|
|
|
|
includeh10 wrote: but how to hold the infinite value db1 in a string...
Use gcvt() .
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Why the following piece of code that simply reads the current pos & size of the CEdit control makes the control to change its size regardless that no changes of top,left,bottom,right values are made ?
pEditSearch = (CEdit*) pPage->GetDlgItem(IDC_EDITSEARCH);
pEditSearch->GetClientRect (&rectChild);
pEditSearch->SetWindowPos (NULL,rectChild.top, rectChild.left, rectChild.right, rectChild.bottom ,SWP_NOMOVE | SWP_NOZORDER | SWP_SHOWWINDOW);
This piece of code is used in a left pane view (using a CSplitterWnd class) and my goal is to change the right border of the CEdit control accordingly of the pane size (just like a .CHM help file with am index).
Regards,
sdancer75
|
|
|
|
|
sdancer75 wrote: ...regardless that no changes of top,left,bottom,right values are made ?
The "change" comes in the form of client vs. screen coordinates.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Maybe try this (changes in red):
pEditSearch = (CEdit*) pPage->GetDlgItem(IDC_EDITSEARCH);
pEditSearch->GetWindow Rect (&rectChild);
ScreenToClient(&rectChild);
pEditSearch->SetWindowPos (NULL,rectChild.left, rectChild.top, rectChild.Width(), rectChild.Height() ,SWP_NOMOVE | SWP_NOZORDER | SWP_SHOWWINDOW);
Note SetWindowPos takes x,y,cx,cy - not y1,x1,x2,y2, like you were passing!
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Ok I traced the error with your help Mark.
1. Totaly wrong parameters to SetWindowPost
2. It worked only with the GetWindowRect & ScreenToClient and not with GetClientRect ( I am curious why not???).
The combination of GetWindowRect / ScreenToClient should give the GetClientRect position, Am I wrong ?
Regards,
sdancer75
|
|
|
|
|
Did you use of ScreenToClient on your code it converts screen coordinates to client coordinates.
|
|
|
|
|
Hi everyone,
Can anyone tell me, how to check whether entered text is RTL (for example: Arabic or Hebrew) or LTR(for example:English) text?
I am using Uniscribe in my application. If i don't use ETO_RTLREADING in ExtTextOut(), can i get correct output based on English or Arabic language entered?
Thank you,
|
|
|
|
|
|
hi everyone,
i'm working on a project which includes a DLL and a separate UserBroker (both written in ATL) object which is used for getting/setting registry keys and reading/writing to user directories. (the object will be used in Vista, so this is needed)
i want to read some binary data from registry and i have written this function properly:
STDMETHODIMP CUserBroker::QueryBinaryValue(BSTR bstrKeyName, BSTR bstrValueName, BYTE **pValue, ULONG *pnBytes)
the function body is simple. it just opens the registry key (using a CRegKey ) and uses its QueryBinaryValue method. the problem is somehow i just can't pass a BYTE array to the other process (which calls the CUserBroker 's method). the call to the method is this:
arr = (BYTE *)malloc(1 * sizeof(BYTE));
pub->QueryBinaryValue(ATL::CComBSTR(s_bstrToolBarRegistryKey), ATL::CComBSTR("hop"), &arr, &dwSize);
arr = (BYTE *)realloc(&arr[0], (dwSize) * sizeof(BYTE));
pub->QueryBinaryValue(ATL::CComBSTR(s_bstrToolBarRegistryKey), ATL::CComBSTR("hop"), &arr, &dwSize);
delete arr;
everything works fine until the first line of CUserBroker::QueryBinaryValue method, where the BYTE** pointer points to BadPtr (0x00000000) immediately.
the question: how can i pass a BYTE array (or any other array) among processes?
|
|
|
|
|
|
|
thanks, the article was really helpful. i used BSTR to pass the array safely among processes. i thought i needed some structure like BSTR for this, but couldn't imagine the solution would be BSTR itself
WM_COPYDATA is useful too, but since my UserBroker does not have a window, i can't send the message to anywhere else.
thanks again
|
|
|
|
|
how to get the VARIANT type URL as a CString from OnDocumentComplete in webbrowser2
void MyDialog::OnDocumentCompleteExplorer1(LPDISPATCH pDisp, VARIANT FAR* URL) <br />
{<br />
<br />
}
"URL" here contains the url that has been completed. but it is a variant type. i want to as a CString type so that i can check it. i tried casting but it doesnt work. does anyone knows how to do it?
- MFC style
- winxp
- vc6.0
thanks in advance!
|
|
|
|
|
you can use the V_BSTR macro to get it done. the macro returns a BSTR that you can use to obtain a CString . something like this may help/work:
BSTR bstrUrl = V_BSTR(URL);
CString cstrUrl(bstrUrl);
|
|
|
|
|
awah wrote: "URL" here contains the url that has been completed. but it is a variant type.
A variant type has many different subtypes, one of which is a BSTR. For example:
COleVariant vtURL(URL, VT_BSTRT);
CString strURL = V_BSTRT(&vtURL); Or:
CString strURL(V_BSTR(URL));
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
|
Hello all,
I was wondering if I can use the new CString class that came with VC++2005 but in VC++6...
If this is possible, how should it be done?
As always thank you in advance...
|
|
|
|
|
Joan Murt wrote: I was wondering if I can use the new CString class that came with VC++2005 but in VC++6...
If this is possible, how should it be done?
No, but you could possibly derive your own class from CString , and add methods to it that are similar to those in the VS2005 version.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Just curious - what new features do you want to use?
|
|
|
|
|
CString.tokenize...
I wanted to use that and not a custom made tokenizer...
I'm sure that there are plenty of them here in CP, but well, I have an old app that deserve a little of maintenance... and I've got used to use that tokenizer...
|
|
|
|
|
You can use AfxExtractSubString() in VC6
|
|
|
|
|
Thank you, I'll give it a try...
|
|
|
|
|
Hi....
I want to create dsn at runtime using mfc..
Is there any solution
plz help me!!!!!!
Thanks in advance
|
|
|
|