|
|
|
I have an application that is based on TabControl (CFormView), but for now, it appears as the dialog box that did, and I would like that it occupy the window into the framework.
How can I do it?
|
|
|
|
|
You'd call the SetWindowPos[^] member function.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Yes I know. This is the method that resize the tabControl
[code]
void CMyTabCtrl::SetRectangle()
{
CRect tabRect, itemRect;
int nX, nY, nXc, nYc;
GetClientRect(&tabRect);
GetItemRect(0, &itemRect);
nX=itemRect.left;
nY=itemRect.bottom+1;
nXc=tabRect.right-itemRect.left-1;
nYc=tabRect.bottom-nY-1;
m_tabPages[0]->SetWindowPos(&wndTop, nX, nY, nXc, nYc, SWP_SHOWWINDOW);
for(int nCount=1; nCount < m_nNumberOfPages; nCount++){
m_tabPages[nCount]->SetWindowPos(&wndTop, nX, nY, nXc, nYc, SWP_HIDEWINDOW);
}
}
[/code]
But I dont know how to get the size of the framework. What parameter I have to change?
|
|
|
|
|
What do you mean "the size of the framework"?
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
|
First, you're calling GetClientRect() in the wrong context. GetClientRect() gets "this" windows client rectangle, not the parents'. If you want to get the parents' client rectangle (the framework as you call it), in the context of the child, then call GetParent()->GetClientRect().
The way I would do what you're trying to do is the following:
1. Using the ClassWizard, add a WM_SIZE and WM_CREATE message handler to your View class, or
2. alternatively add ON_WM_SIZE() and ON_WM_CREATE() to your View class's message map and add the following overrides to your View class's header file:
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
4. add the following code (if you used the ClassWizard to add the WM_SIZE and WM_CREATE handlers, then cut and paste the code as appropriate).
void CMyTabExampleView::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
m_myTabs.MoveWindow(0, 0, cx, cy);
}
int CMyTabExampleView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
CRect rect;
GetClientRect(&rect);
m_myTabs.Create(0, rect, this, 9999);
m_myTabs.ShowWindow(SW_SHOW);
return 0;
}
Of course, the style and ID of the "m_myTabs" window needs to be what you need them to be. Adjust accordingly.
Hope this helps. Good luck. Call if you need more help.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Hi
How to load ICON file in Dialog application client area in VC8.
|
|
|
|
|
Hi,
Just use the LoadImage function[^] and cast the return HANDLE into a HBITMAP. Then you would just BitBlt[^] the bitmap onto the dialog.
Best Wishes,
-David Delaune
|
|
|
|
|
Or insert a PictureControl and change the "Type" property of PictureControl to "Icon", then assign an ICON resource to "Image" property of PictureControl.
|
|
|
|
|
Use the ICON [^] resource control.
|
|
|
|
|
I read the characters from local file compressed by gzip, and want to uncompress the characters into another bytes buffer, not into local file.
How can I get it.
|
|
|
|
|
Perhaps with the zLib library?.
It is what gzip used in the first place, after all. With the added advantage of not needing to load the file first, and the additional bonus of being able to seek/read from a compressed file as though it were a standard non-compressed file. zLib gzip file access functions[^]
|
|
|
|
|
Using managed GZipStream[^] class. For unmanaged apps check CGzip[^] class found in codeproject.
|
|
|
|
|
Back to my MimeMap Question, but with more focus on the issue
If I get the value of the key that doesn't exist, comm return an empty array in the format I need, (I think so) which is empty. Maybe I can create a new safearray in the exact format, or just add my values to the existing array.
What do you think?
mimeMap | safearray of VARIANT = [0]()
VARIANT mimeMap;
VariantInit(&mimeMap);
hr = pADs->GetEx(CComBSTR("MimeMap"), &mimeMap);
|
|
|
|
|
I could find your MimeMap question. But even so, I can't make heads or tails of what you're saying...
What are you on about????
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
I was brain dead when I posted the question, I read again and it didn't make sense to me either.
I'm frustrated with the mimemap and ADS. I get the error -2147463156. I decoded the error to my input data not being in the correct format of a safe array.When I examine &var in PutEx, it looks like a safe array to me, but putEx just rejects it. I've googled the subject, but it looks so complex, in which articles talk about a pointer in the package, that points to a record in the safe array, BSTR's, VT's. I found 1 vb example of a successful add to MimeMap, if I could just package my data correctly, I could add the data to the key. Just looking for help again.
LPWSTR pszMimes[] =
{
L".application, application/x-ms-application",
L".deploy, application/octet-stream",
L".flv, video/x-flv",
L".manifest, application/-x-ms-manifest",
L".msp, application/octet-stream",
L".msu, application/octet-stream",
};
DWORD dwNumber = sizeof(pszMimes)/sizeof(LPWSTR);
hr = ADsBuildVarArrayStr(pszMimes, dwNumber, &var);
if ( SUCCEEDED (hr )) {
hr = pADs->PutEx(ADS_PROPERTY_UPDATE, CComBSTR("MimeMap"), CComVariant(var) );
VariantClear(&var);
if ( SUCCEEDED (hr )) {
hr = pADs->SetInfo();
}
}
|
|
|
|
|
Well -2147463156 == 0x8000500C == E_ADS_CANT_CONVERT_DATATYPE (Generic ADSI Error Codes[^])
So there's something in the var that can't be converted.
Have you tried calling VariantInit(&var) before calling ADsBuildVarArrayStr[^]?
IADs::PutEx[^]
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Yes Sir.
I'm convinced that I have a safe array. it works on many other keys just fine. It's just the MimeMap Key, I really need to figure out how to decode the HRESULT numbers.
-2147463160, -2147463156
I give up. Going to put this on my ELance list and farm it out next week.
Thanks for the help, I got most of it written myself.
|
|
|
|
|
I am at a loss and I am hoping someone can lead me down the right path. I have a COM dll that is written in C++. If a user is on Windows7 (or higher), the user will have the option of invoking this new functionality. Otherwise, it will not be available. The problem is that this new functionality uses specific libraries that are only available with Windows7. I didn't think it was a problem until I went to register the DLL on a XP box, where the registration fails. I am certain it is because of these libraries (which are in the project settings). Is there any way to make the DLLS conditional? I have been looking for some different methods but I haven't located anything.
|
|
|
|
|
You can try using the "delay load" functionality of the linker for the dependent Win7 DLLs.
If that doesn't work, you will need to LoadLibrary()[^] them, and use GetProcAddress()[^]
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Ah, loadlibrary, it never even occurred to me. I have used it for DLLs but I have never tried it for libraries. I will give that a try.
|
|
|
|
|
If these are static libraries (.LIBs) you're linking to that refer to win7 dlls, then you'll need to put the code that refers to those static libraries into a DLL and then LoadLibrary() those.
Also you could detect the OS, and only LoadLibrary() when on Win7 or greater.
If your actions inspire others to dream more, learn more, do more and become more, you are a leader." - John Quincy Adams You must accept one of two basic premises: Either we are alone in the universe, or we are not alone in the universe. And either way, the implications are staggering” - Wernher von Braun
|
|
|
|
|
Hi,
When you compile your COM library you need to #define the appropriate WINVER, _WIN32_WINNT and _WIN32_IE. By setting these values the windows headers will #include or exclude specific functions/libraries. You may receive some compilation errors after setting these values. Do not panic... you will need to use LoadLibrary/GetProcAddress at runtime to determine if the functions are available. Some Win7 features may not be available on WinXP so you may need to re-implement some portions of your application for backwards compatibility.
Using the Windows Headers[^]
Best Wishes,
-David Delaune
|
|
|
|
|