|
sheetal_06 wrote: the usage of graphics library
Which one ? There are several... GDI, DirectX, OpenGL, ...
Be more precise. If you don't know, maybe you could describe what you would like to do so we can help you choose the appropriate library.
|
|
|
|
|
if i want to list every file in one of my drives what type of varables do i need? and how many lines will a CListCtrl hold before it goes crazy?
|
|
|
|
|
Hi,
1st: mask should be "*.*"
CFileFind finder;
BOOL bWorking = finder.FindFile(_T("C:\\*.*"));
while (bWorking)
{
bWorking = finder.FindNextFile();
if (finder.MatchesMask(FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM))
_tprintf(_T("%s\n"), (LPCTSTR) finder.GetFileName());
}
2nd - i've no idea - never checked it.
-----------
Mila
|
|
|
|
|
ok look at it this way how can i list every file in my c drive and have it count the files and directorys in a dialog and not crash?
i know how to list the files.
i know how to count the files and directorys.
i know how to get all the sub directorys.
but at around 30000 it crashes.
|
|
|
|
|
Hi,
Try to check what exactly crashes - I made a little test with CListCtrl and it works fine with 2 x 64k items (checked with only 1 column and with VS2005). So maybe problem is with an item's data.
-----------
Mila
|
|
|
|
|
if i start the dialog then attach to process the debugger this is what i get.
unhandled exception in file count.exe(gdi32.dll): 0xC00000FD: stack overflow
|
|
|
|
|
Hi All,
Over the past few weeks I have been trying all sorts of different ZIP examples found in CodeProject but all of them I can seem to get going under Visual Studio 2005.
The application is a CLR Console App.
Anyone suggest one that can be successfully used under VS2005 ?
Cheers...
Pete
|
|
|
|
|
I want to create a window in which both the Non-Client and the Client are owner-drawn.
I know that I have to handle the WM_NCPAINT and WM_NCACTIVATE messages for Non-client drawing and WM_PAINT message for Client drawing.
For a simple test I added the following code in a Dialog based Application
BOOL COwnDrwDlg::OnNcActivate(BOOL bActive) <br />
{<br />
if (bActive)<br />
{<br />
CRect rect;<br />
GetWindowRect(&rect);<br />
<br />
CBrush FB(RGB(0, 80, 0));<br />
CPaintDC dc(this);<br />
CBrush* pOld = dc.SelectObject(&FB);<br />
dc.Rectangle(&rect);<br />
dc.SelectObject(pOld);<br />
}<br />
<br />
return true;<br />
}<br />
<br />
void COwnDrwDlg::OnNcPaint() <br />
{<br />
CRect rect;<br />
GetWindowRect(&rect);<br />
<br />
CString str;<br />
str.Format(_T("OnNcPaint : Width = %d Height = %d"), rect.Width(), rect.Height());<br />
TRACE(str);<br />
<br />
CBrush FB(RGB(0, 80, 0));<br />
CPaintDC dc(this);<br />
CBrush* pOld = dc.SelectObject(&FB);<br />
dc.Rectangle(&rect);<br />
dc.SelectObject(pOld);<br />
}<br />
<br />
void COwnDrwDlg::OnPaint() <br />
{<br />
CRect rect;<br />
GetClientRect(&rect);<br />
<br />
if (IsIconic())<br />
{<br />
CPaintDC dc(this);
<br />
SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);<br />
<br />
int cxIcon = GetSystemMetrics(SM_CXICON);<br />
int cyIcon = GetSystemMetrics(SM_CYICON);<br />
int x = (rect.Width() - cxIcon + 1) / 2;<br />
int y = (rect.Height() - cyIcon + 1) / 2;<br />
<br />
dc.DrawIcon(x, y, m_hIcon);<br />
}<br />
else<br />
{<br />
CBrush FB(RGB(80, 0, 0));<br />
CPaintDC dc(this);<br />
CBrush* pOld = dc.SelectObject(&FB);<br />
dc.Rectangle(&rect);<br />
dc.SelectObject(pOld);<br />
}
I thought this much code would result in a window having a green outer rectangle and a dark red inner rectangle, minus the system buttons.
But it did not happen. All I got was captionless grey window.
Where did I go wrong? Where I can get a good documentation regarding painting the non-client area efficiently?
Cutebug
|
|
|
|
|
You could try CWindowDC instead of CPaintDC in OnNcPaint. I don't think you need handle OnNcActivate, just check the state of the window in OnNcPaint (i.e. does it have the focus, etc).
- S
50 cups of coffee and you know it's on!
|
|
|
|
|
How do i write using SetItemData/GetItemData to link items listed in the droplist(combobox) to certain files(.txt)? Is there any examples i can refer to?
Thanks A Lot
|
|
|
|
|
cyn8 wrote: How do i write using SetItemData/GetItemData to link items listed in the droplist(combobox) to certain files(.txt)?
You question is not clear...
Do you want to see all the txt files in a directory listed in your combo box, then take a look at DlgDirListComboBox .
|
|
|
|
|
In my application i have another edit box and a browse button to find a file and load it. But I want to be able to create a link from the droplist to the edit box to load the respectful files according to the item listed in the combobox droplist.
for example...
in the drop list, it has:
item1
item2
item3
by selecting one of them, eg. "item1".....
Item1 will be directed to location example "c://File1.txt"
the edit box will also show "c://File1.txt" and the file will be automatically load it
May i know how to do this?
Thanks
|
|
|
|
|
cyn8 wrote: from the droplist to the edit box to load the respectful files according to the item listed in the combobox droplist.
There are two event notifications for this purpose...
1. CBN_SELCHANGE
2. CBN_SELENDOK
You can handle either of them to handle change of combobox items. In this event handler write the code for displaying file contents.
|
|
|
|
|
Nibu, Where is Naveen, Nishad etc...
|
|
|
|
|
I tried and failed to contact you by phone... why cant you mail me...?
- NS -
|
|
|
|
|
Its very nice to contact you later. Really I miss you all badly. I still love NeST and all NeSTians very much.
It is very sorry to say that I was forced to follow the path of Shameer Ebrahim. I have two reasons to leave from there with out sayinng any word to any.
Mainly I fear the disgrace and secondly I want to come back there just like after a long leave.
Sorry Sorry Sorry....
Currently I am not using any mobile that's why no one can get me through the phone. I shifted to C# and working for a US Client with a little better salary.
I feel NeST is a heaven and sure I have to come back there. Contact you al later..
Where is Prince of Common Controls ( Mr.Naveen )
Please convey my regards to all there.
Bye
With lots of love
Benoy Bose
|
|
|
|
|
I am really sorry because I am very busy now. I am with one of my colleague
Could you contact me later...?
- NS -
|
|
|
|
|
Benoy Bose wrote: Where is Prince of Common Controls ( Mr.Naveen )
hi benoy... I am here..
Now a days very busy with the projects...Dont have time to spend in code project.. well where r u now?
nave
|
|
|
|
|
I think you were so busy, since there are no log in the code project. Here I am not at all busy and having a lot of free time.
Please convey my regards to
Sankar, Ajesh, Prince and Rinu
|
|
|
|
|
Hi, I want to display the output from my hardware which is a squarewave In this dialog based application, i must be able to zoom in/out of the display. May i know which is more approriate, using picture control or custom control? How should the codes be written and are there any good examples for me to refer? I'm a begineer here
Thanks in advance
|
|
|
|
|
Hi,
I use the CRecordset.GetFieldValue to get the last row data. I want to know that is there have any faster way to get last row data
Thanks
|
|
|
|
|
I'm using Visual Studio Express.
I tried to output some data into a text file, I found that the file is encoded in UTF16. The wired part is that non-ASCII characters are in MultiByte encoding (all of them takes two bytes), but the ASCII ones got in UTF16 (which also takes two bytes), and the whole file has a UTF16 BOM.
The file is opened with fopen , and written with fprintf . My strings in my program all all unicode strings, so I had to write like this:
fprintf(" ");
fprintf("%ls", L"UNICODE STRING");
There is some non-ASCII characters in my unicode strings.
I used wide-char version functions in my program explictly, except for file operations (I didn't use wfprintf or wfopen). The charset for the project is set to "No set", and neither UNICODE nor MBCS is defined.
I have set the locale at the begin of main.
And I want to get a MultiByte file, how can get it?
Thanks in advance.
|
|
|
|
|
I would like to know how to detect the movement of Joystick in any windows?
Please help?
|
|
|
|
|
May i know how to use the scrolling control? How do you add it to the custom control to allow a horizontal scroll and also ensure that the squarewave drawn in that custom control is shift appropriately during scrolling. Is there any example on doing so?
Thanks in advance
|
|
|
|
|
cyn8 wrote: May i know how to use the scrolling control?
Your question is not clear!
|
|
|
|