|
I used this article:
http://codeguru.earthweb.com/listview/EmptyLV.shtml
Sorry, i meant CHeaderCtrl
if (pHC != NULL)
{
CRect rcH;
pHC->GetItemRect(0, &rcH);
rc.top += rcH.bottom;
}
and the following error i receive:
error C2039: 'GetItemRect' : is not a member of 'CHeaderCtrl'
and yes, it does not compile. The problem is i'm using VC5, VC6 it should compile ok.
But i'm currently working in a VC5 project and can't leave that project because the bought functions which connect to a dbaseIV database won't work on VC6.
Can i manually send a message for getting the getitemrect()?
Greetings
Jens
|
|
|
|
|
Try :
HDM_GETITEMRECT<br />
wParam = (WPARAM) (int) iIndex;<br />
lParam = (LPARAM) lpItemRect;
so something like
pHC->SendMessage(HDM_GETITEMRECT,0,&rcH);
~RaGE();
|
|
|
|
|
CRect rcH;
pHC->SendMessage(HDM_GETITEMRECT,0,&rcH);
//pHC->GetItemRect(0, &rcH);
rc.top += rcH.bottom;
I tried that already before and i have compilation errors:
SendMessageA' : cannot convert parameter 3 from 'class CRect *' to 'long'
|
|
|
|
|
Use a RECT instead of the CRect.
That way :
RECT rcH;
pHC->SendMessage(HDM_GETITEMRECT,(WPARAM)(int)0,(LPARAM)&rcH);
~RaGE();
|
|
|
|
|
ok this works good
Thanks alot
Just Edited
Now only need to find out how i center (vertically + horizontally) the message in the listview. That would be nice.
Greetings
Jens
|
|
|
|
|
JensB wrote:
how i center the message in the listview
What do you mean ? Which message ?
~RaGE();
|
|
|
|
|
I use this article to show a message when the listview is empty:
http://codeguru.earthweb.com/listview/EmptyLV.shtml
Would it be possible to center the message like 'No items in the list.' in the list view.
Like this:
The message 'test' is centered (horizontally & verticaly) within the list view.
- - - - - - -
| |
| test |
| |
-------------
Greetings
Jens
|
|
|
|
|
JensB wrote:
I use this article to show a message when the listview is empty:
http://codeguru.earthweb.com/listview/EmptyLV.shtml
Sorry, i had forgotten that
pDC->DrawText(strText, -1, rc, DT_CENTER | DT_VCENTER | DT_WORDBREAK | DT_NOPREFIX | DT_NOCLIP);
should do it.
~RaGE();
|
|
|
|
|
hi, on my PC, default language is English. I have selected russian as the second language. I selected ctrl + shift for switching between the languages in keyboard settings. i have a dialog based App in which i placed an edit box. when i run the App, its running and in the edit box iam typing english characters. Then i pressed Ctrl+shift, and pressed some keys. It was not russian letters in edit box, still iam getting english letters. Why is this happening. What should i do to get russian letters as input into edit box. I would be grateful if some one can help me. Thank you in advance.
|
|
|
|
|
The language used in your editbox depends on the language used to compile the project. (This is asked by the application wizard).
Search here on CP about internationalisation.
~RaGE();
|
|
|
|
|
Does anybody know of a good site for information on using templates. I've managed to knock up a template class for storing a variable number of structures (similar to CAtlArray) but I'm wondering if there is a better (more correct) way to do it. I'm basically looking for a kind of do's and don'ts list.
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Steve Thresher wrote:
but I'm wondering if there is a better (more correct) way to do it
Using the std::vector class would be portable and standard conform.
If you really must reinvent the wheel, you can always look at their implementation (preferably NOT at the implementation shipped with VC6). Maybe STLPort is better.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
Thanks for the info, the std::list class is probably what I'm looking for. Just out of interest, whats the problem with the implementation of std::vector shipped with VC6?
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
The implementation of the VC++6.0 STL is working just fine. (There are a few Bugfixes here[^].)
It is just that (in my eyes) it is overly complex, using some workarounds to get the templates running with the (very old) VC++6.0 compiler.
STLPort is more generic and easier to read.
I have not seen the new VC++.NET 2003 compiler, but from hearsay it has one of the best template supports of any existing compilers.
Maybe MS shipped a STL with it that uses these features.
My opinions may have changed, but not the fact that I am right.
|
|
|
|
|
I am trying unsuccessfully to back up a file from an application using ShellEcecute
IE ShellExecute(this->m_hWnd, NULL, "copy .\\xyz.mdb .\\z.mdb", NULL, NULL, SW_HIDE);
Any help appreciated
Bonnie
|
|
|
|
|
ShellExecute isnt really designed for that purpose. You are better off using something like CopyFile
|
|
|
|
|
Where/What is "CopyFile" - not in VC7++ nore internal/external of cmd.exe for Win2k.
|
|
|
|
|
MSDN :
BOOL CopyFile(
LPCTSTR lpExistingFileName,
LPCTSTR lpNewFileName,
BOOL bFailIfExists
);
Parameters
lpExistingFileName
Pointer to a null-terminated string that specifies the name of an existing file.
lpNewFileName
Pointer to a null-terminated string that specifies the name of the new file.
bFailIfExists
Specifies how this operation is to proceed if a file of the same name as that specified by lpNewFileName already exists. If this parameter is TRUE and the new file already exists, the function fails. If this parameter is FALSE and the new file already exists, the function overwrites the existing file and succeeds.
Return Values
If the function succeeds, the return value is nonzero.
If the function fails, the return value is zero. To get extended error information, call GetLastError .
I'm quite sure this will be in VC7++ also
~RaGE();
|
|
|
|
|
dear all,
how do i get the Handle of a window which is started due to CreateProcess(...)
also, can i get the handles to all the child windows of this window
thanx all
|
|
|
|
|
Retrieve the information from the LPPROCESS_INFORMATION used in Create_Process, and use them as parameter from OpenProcess, which retrieves a HANDLE.
To retrieve the child windows, you can use :
CWnd* GetWindow( UINT nCmd ) const;
~RaGE();
|
|
|
|
|
You can get the handle of the primary thread of the newly created process from the LPPROCESS_INFORMATION.
By using the handle of the Window, you can enumerate all the child windows by using the FindWindowEx() API.
[ It is possible to represent everything in this universe by using 0 and 1 ]
|
|
|
|
|
Hi Friends,
i have created an exe and a dll.. the dll will be loaded initially.. it's an MDi application.. i would like to update the main menu whenever a window is opened... let me know how o handle this situation..
regards,
naveen
|
|
|
|
|
The menu's displayed in the MDI are kept in the CDocTemplate::m_hMenuShared member var of the CDocTemplate objects you registered in the InitInstance of your application. If you want to modify these, you need to pass the HMENU in that variable to a function in the DLL which will modify the menu and add/remove the required menu options.
An article of mine may be of interest here:
Plug in architecture for MFC[^] This handles MDI apps and menu modifications etc.
Roger Allen
Sonork 100.10016
Were you different as a kid? Did you ever say "Ooohhh, shiny red" even once? - Paul Watson 11-February-2003
|
|
|
|
|
Hi,
I am developing with Visual C++.NET on XP, and want to build a version to run on Win98. The software crashes on startup in 98.
Does anyone know where I can look for information on this?
I am using the Setup utility and am not sure if I need to include different versions of the C Run Time libraries for the Win 98 install. At the moment I am installing MSCVR70D.dll and VC_CRT.msm because these are the detected dependencies.
Thanks,
Joanne
|
|
|
|
|
MSCVR70D.dll is a debug-build library, is this the intent? Do you install debug version of your application? You may send me the EXE and/or the installation package if you want me to resolve this problem.
Regards,
BB
|
|
|
|