|
Are you wanting to know which items in the list control are selected? If so, use the GetSelectedCount() and GetNextItem(..., LVNI_SELECTED) methods.
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
if you are using a CListBox , have a look at GetSelItems , but your list but be set to use multiselect (and/or extended select) style.
if you are using a CListCtrl use CListCtrl::GetSelectedCount and CListCtrl::GetNextItem ( see this[^] )
|
|
|
|
|
I have gotten all the code page identifiers using the function EnumSystemCodePages...but i can't seem to find any function that returns the descriptive name of a particular code page...like the names shown in the 'Advanced' tab of Regional and Language Options...anyone know how to get the descriptions?
|
|
|
|
|
Haroon Sarwar wrote: ...but i can't seem to find any function that returns the descriptive name of a particular code page...like the names shown in the 'Advanced' tab of Regional and Language Options...anyone know how to get the descriptions?
I just googled with EnumSystemCodePages and the third entry in the list was this --> http://www.codeproject.com/KB/system/codepage.aspx[^]
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http:\\nibuthomas.wordpress.com
|
|
|
|
|
thanks....don't know how i managed to miss it!
|
|
|
|
|
How to copy a file from pocket PC to destktop PC.I want to get the best method.Please help me.Thank you!The follow is my code,but I need the better measure.Which fuction can do it?
CString strFileNamePC=_T("d:\\nini.txt");
CString strFileNamePPC=_T("\\nini.txt");
CFile oldFile;
oldFile.Open(strFileNamePC, CFile::modeWrite|CFile::modeCreate|CFile::typeBinary);
BSTR bstr = strFileNamePPC.AllocSysString();
SysFreeString(bstr);
CeRapiInit();
HANDLE h;
h = CeCreateFile(bstr, GENERIC_READ, 0/*cannot be shared*/, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
char cTemp[BUFFER_SIZE];
DWORD nbytes;
CString s;
int iTotBytes = 0;
DWORD n=CeGetFileSize(h,NULL);
if(h!=INVALID_HANDLE_VALUE)
{
//AfxMessageBox("??");
while(CeReadFile(h, cTemp, (DWORD)n,&nbytes,NULL) && (nbytes>=1) )
{
oldFile.Write(cTemp,n);
}
}
CeCloseHandle(h);
oldFile.Close();
CeRapiUninit();
Yunasheng Ni
ni_yuansheng
|
|
|
|
|
Why not just use CopyFile() ?
"Normal is getting dressed in clothes that you buy for work and driving through traffic in a car that you are still paying for, in order to get to the job you need to pay for the clothes and the car and the house you leave vacant all day so you can afford to live in it." - Ellen Goodman
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi,
for my one of application, i installed diffrent printer model through printer Drivers INF file, My application works fine.
Now i needed that when i'm parsing INF file through my program, how can i sure that pertincular printer model is PnP capable or not. is there any standerd way to decide this when reading a INF file. for example for an INF file the [ModelSection] defined as:
/////////////////////////////////////////////////////////////
; Model sections
;
; Each section here corresponds with an entry listed in the
; [Manufacturer] section, above. The models will be displayed in the order
; that they appear in the INF file.
[HP]
; HP Color LaserJet 4700
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\Hewlett-PackardHP_CoF1B4,DOT4PRT\Hewlett-PackardHP_CoF1B4&PRINT_HPZ,DOT4PRT\Hewlett-PackardHP_CoF1B4&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6217,DOT4PRT\vid_03f0&pid_6217&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6217&DOT4&PRINT_HPZ,DOT4PRT\VID_03F0&PID_6217&Rev_0100,DOT4PRT\VID_03F0&PID_6217&Rev_0100&DOT4&PRINT_HPZ,DOT4PRT\VID_03F0&PID_6217&Rev_0100&PRINT_HPZ
; HP Color LaserJet 4730
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\Hewlett-PackardHP_Co2FFA,DOT4PRT\Hewlett-PackardHP_Co2FFA&PRINT_HPZ,DOT4PRT\Hewlett-PackardHP_Co2FFA&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6317,DOT4PRT\vid_03f0&pid_6317&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6317&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6317&Rev_0100,DOT4PRT\vid_03f0&pid_6317&Rev_0100&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6317&Rev_0100&DOT4&PRINT_HPZ
; HP LaserJet 3050
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\vid_03f0&pid_3217&mi_00&PRINT_HPZ,DOT4PRT\Vid_03f0&Pid_3217&mi_00&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3217&Rev_0100&mi_00&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3217&Rev_0100&mi_00&DOT4&PRINT_HPZ
; HP LaserJet 3052
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\vid_03f0&pid_3317&mi_00&PRINT_HPZ,DOT4PRT\Vid_03f0&Pid_3317&mi_00&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3317&Rev_0100&mi_00&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3317&Rev_0100&mi_00&DOT4&PRINT_HPZ
; HP LaserJet 3055
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\vid_03f0&pid_3417&mi_00&PRINT_HPZ,DOT4PRT\Vid_03f0&Pid_3417&mi_00&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3417&Rev_0100&mi_00&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3417&Rev_0100&mi_00&DOT4&PRINT_HPZ
; HP LaserJet 3390/3392
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\vid_03f0&pid_3517&mi_00&PRINT_HPZ,DOT4PRT\Vid_03f0&Pid_3517&mi_00&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3517&Rev_0100&mi_00&PRINT_HPZ,DOT4PRT\vid_03f0&pid_3517&Rev_0100&mi_00&DOT4&PRINT_HPZ
; HP LaserJet 5200
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\vid_03f0&pid_6417,DOT4PRT\vid_03f0&pid_6417&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6417&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6417&Rev_0100,DOT4PRT\vid_03f0&pid_6417&Rev_0100&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6417&Rev_0100&DOT4&PRINT_HPZ
; HP LaserJet 5200L
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\vid_03f0&pid_6617,DOT4PRT\vid_03f0&pid_6617&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6617&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6617&Rev_0100,DOT4PRT\vid_03f0&pid_6617&Rev_0100&PRINT_HPZ,DOT4PRT\vid_03f0&pid_6617&Rev_0100&DOT4&PRINT_HPZ
; HP LaserJet 3005
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\Hewlett-PackardHP_La023A,DOT4PRT\Hewlett-PackardHP_La023A&PRINT_HPZ,DOT4PRT\Hewlett-PackardHP_La023A&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7317,DOT4PRT\vid_03f0&pid_7317&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7317&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7317&Rev_0100,DOT4PRT\vid_03f0&pid_7317&Rev_0100&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7317&Rev_0100&DOT4&PRINT_HPZ
; HP LaserJet 3004
%HP_Mombi_Driver_Name% = hpmcpdp6.gpd,LPTENUM\HPUPD_PCL6,DOT4PRT\Hewlett-PackardHP_LaC2FB,DOT4PRT\Hewlett-PackardHP_LaC2FB&PRINT_HPZ,DOT4PRT\Hewlett-PackardHP_LaC2FB&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7617,DOT4PRT\vid_03f0&pid_7617&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7617&DOT4&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7617&Rev_0100,DOT4PRT\vid_03f0&pid_7617&Rev_0100&PRINT_HPZ,DOT4PRT\vid_03f0&pid_7617&Rev_0100&DOT4&PRINT_HPZ
////////////////////////////////////////////////////////////////////
But i'm not getting how to decide which model is Pnp capable or not.plz help me.
Thanks in advance
Ashish
|
|
|
|
|
Hi,
I need to get a handle to the "Save As" Dialog of another
application once the user Clicks "Save As" Option in that
application.So as to kill the dialog Immediately.
I used FindWindowEx and EnumChildWindows but no use.
Using Spy++ I tried to get the class name of the "Save As"
Dialog it shows "#32770 (Dialog)" as is for any dialog box.
HWND hWnd = ::FindWindowEx(st_hwnd,NULL,
(LPCWSTR)"#32770 (Dialog)",(LPCWSTR)"Save As");
Even if "Save As" Dialog is not the immediate child window
for FindWindowEx to work,it should work with
EnumChildWindows,but doesn't.
HWND hWndChild = NULL;
EnumChildWindows(pWndWmp->m_hWnd, EnumAppearanceChildProc, (LPARAM)&hWndChild);
BOOL CALLBACK EnumAppearanceChildProc(HWND hwnd, LPARAM lParam)
{
CString str = _T("");
CWnd *pChildWnd = CWnd::FromHandle(hwnd);
pChildWnd->GetWindowTextW(str);
if(_tcscmp(str,_T("Save")) == 0)
{
*reinterpret_cast<hwnd*>(lParam) = hwnd;
return FALSE;
}
return TRUE;
}</hwnd*>
What could be the problem? Is there a way where I can
get the handle to the "Save As" dialog of another application?
Thanks
Satya
Today is a gift, that's why it is called the present.
|
|
|
|
|
I am using a slider control i need the change the background colour of the background colour. I tried to change in the OnCtlColor. Please anyone suggest anything.
|
|
|
|
|
|
When begin dragging, them dragging image will offset twards left and up a little to the original one. I'd like the two images (original and dragging) in the same rect at the very begining. Here is the code:
void CDragDropListCtrl::OnBegindrag(NMHDR* pNMHDR, LRESULT* pResult)
{
NM_LISTVIEW *pNMListView = (NM_LISTVIEW*)pNMHDR;
SetCapture();
CImageList *pIL=GetImageList(LVSIL_NORMAL);
CRect rt;
GetItemRect(pNMListView->iItem,&rt,LVIR_ICON);
CPoint pt;
GetCursorPos(&pt);
ScreenToClient(&pt);
pt.x-=rt.left;
pt.y-=rt.top;
pIL->BeginDrag(pNMListView->iItem,pt);
ClientToScreen(&rt);
pIL->DragEnter(NULL,rt.TopLeft());
m_Dragging=TRUE;
*pResult = 0;
}
modified on Thursday, December 06, 2007 5:33:04 AM
|
|
|
|
|
Is there anyway to access a remote hard disk and process it as if it was a local hard disk? I mean, I want to read sectors of data from the remote hard disk which is connected to another machine in the same LAN. Can anyone tell me about how I can get a handle to the remote disk?
Regards,
Vijay.
|
|
|
|
|
Using the CWMPPlayer4 wrapper how should I get for event notifications?
Like, when a file is finished playing or when come back from full screen viwer etc.
(CWMPPlayer4 is composed without IWMPEvents Interface)
Please answer.
Thanks. 
|
|
|
|
|
Were you able to figure this out? I have the same problem
|
|
|
|
|
Would anyone of you recommend a suitable site wherein I would be able to submit a game and receive feedback from players / game testers? By the way, I programmed the game using DirectX (indirectly because I used the CDX Library for this one). It's a revision of the Sokoban game in a 2.5 dimensional setting.
Thanks.

|
|
|
|
|
|
Really? Would you instruct me because there are a lot of hyperlinks here? Thanks.
|
|
|
|
|
see the Chapters section on the left bar ?
then choose the category that fits you best, and then submit[^] your article to the editors. I advise you to submit by mail because the sumbission wizard is currently deactivated, due to the site's migration...
|
|
|
|
|
Right, because I was having a problem with another site "cppgames.com" and their "submit game" option wasn't working properly. Anyway, the project I'm working on is at the beta stage so I just need feedback and suggestions from players. Well, thanks again. I'll try to do that.
Only fools rush in. Foo!
|
|
|
|
|
be aware that codeproject article is more a place for complete articles (more than articles still in draft), so be aware of it and don't forget to notify it to the readers...
|
|
|
|
|
You can also use the forum colaboration / testing[^] the description is "to search beta testers". And once you have reports, then post the game in an article If you are just searching for freedback for corrections, then use the forum i told you.
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
modified on Thursday, December 06, 2007 6:26:18 AM
|
|
|
|
|
you could also try sourceforge.org for this type of stuff
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You/codeProject$$>
|
|
|
|
|
From what I understood, he just want to submit a game, and not write an article about it. He just wants some feedback for his game.
|
|
|
|
|
Yup. You're all right. There is this site www.cppgames.com where one can submit a game (whether full version / beta test). Once submitted, it will be saved within the sites database and members may download the game and do as they please. You may either submit the source code or the executable file. In my case, I just need to submit the executable file since my program is a beta version. So, right now I'm just looking for another SUITABLE for the said purpose. Thanks for all your feedback. I'll try out the websites that you recommended and see what's going on there.
|
|
|
|
|