|
Rajesh R Subramanian wrote: You must give the troll some coffee, may be.
Pizza & wine.
(though I prefer drinking beer while eating pizza).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
http://www.codeproject.com/KB/dialog/dialogspl.aspx[^]
Hi m taking help with this article,it is a dlg base application.
But my application is SDI type.
So please tell me this is not working for SDI type application.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Hi all..
I am reading one file and want to store same in temporary file..
but i am getting error..
Cannot move temp file.
Code i used is..
#include "stdafx.h"
#include "windows.h"
#define BUFSIZE 4096
int main()
{
HANDLE hFile;
HANDLE hTempFile;
DWORD dwBytesRead, dwBytesWritten, dwBufSize=BUFSIZE;
char szTempName[MAX_PATH];
char buffer[BUFSIZE];
char lpPathBuffer[BUFSIZE];
hFile = CreateFile("original.txt",
GENERIC_READ,
0,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hFile == INVALID_HANDLE_VALUE)
{
printf("Could not open file.");
return 0;
}
GetTempPath(dwBufSize,
lpPathBuffer);
GetTempFileName(lpPathBuffer,
"NEW",
0,
szTempName);
hTempFile = CreateFile((LPTSTR) szTempName,
GENERIC_READ | GENERIC_WRITE,
0,
NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL);
if (hTempFile == INVALID_HANDLE_VALUE)
{
printf("Could not create temporary file.");
return 0;
}
do
{
if (ReadFile(hFile, buffer, 4096,
&dwBytesRead, NULL))
{
CharUpperBuff(buffer, dwBytesRead);
WriteFile(hTempFile, buffer, dwBytesRead,
&dwBytesWritten, NULL);
}
}
while (dwBytesRead == BUFSIZE);
CloseHandle(hFile);
CloseHandle(hTempFile);
if (!MoveFileEx(szTempName,
"allcaps.txt",
MOVEFILE_REPLACE_EXISTING))
{
printf("Could not move temp file.");
return 0;
}
return 0;
}
thank you
manju
modified on Thursday, July 3, 2008 8:09 AM
|
|
|
|
|
Please use the pre tag, as the posting guidelines ask.
My eyes are hurting just looking at that lump of non-indented code.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Your allcaps.txt is readonly?
Well, add @err,hr to watch window, so that you'll get more detailed error description.
Regards,
Jijo.
_____________________________________________________
http://weseetips.com[ ^] Visual C++ tips and tricks. Updated daily.
|
|
|
|
|
I want a edit box to get transparent upto a level on mouse leave or when lost of focus from edit box.
The edit box will get fully visible on Setfocus or mousehover.
-@SuDhIrKuMaR@-
|
|
|
|
|
You'd have to experiment, but I think you can handle the WM_CTLCOLOREDIT message and set a brush for the background of the edit box.
You can detect whether the edit box has focus or not, and set different backgrounds.
If one brush looks a lot like your dialog background, then transparency! Or perhaps you can set a NULL brush?
I hope that gives you something to work with.
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hi,
Please have a look at this[^].
Use CDC::SetBkMode .
Regards,
Paresh.
|
|
|
|
|
Hi all,
I would like to know the length of
CList m_list
m_list.GetAt(pos).GetLength().
Which type does it return?(long ? ULONGLONG? or else?
Many thanks in advance
Specialhaha
|
|
|
|
|
m_list.GetCount() returns the number of elements of a your list. Return value type is an INT_PTR , i.e. an int on 32-bit systems (an _int64 on 64-bit ones).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
CList::GetAt returns a reference to the stored object - so GetLength will only work if that object has a stored object. As it is a method belonging to your TYPE object, you can look that up to see the result.
As you didn't enclose your chunk of code in pre tags like the how-to-post post says, we can't read your CList declaration.
Those guidelines are not decorative.
eg:
CList < CString, CString & > m_List;
...
m_List.GetAt(pos).GetLength ();
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
CList < CString, CString & > m_List;
...
m_List.GetAt(pos).GetLength ();
and the type is ULONGLONG,right?
ULONGLONG m_long = m_List.GetAt(pos).GetLength ();
Thnks
|
|
|
|
|
specialhaha wrote: and the type is ULONGLONG,right?
I don't know. But as I said before, GetLength is a member function of the CString object, so *one* of us is going to have to look in the documentation for CString.
(Or just type it in, and let the compiler tell us. I'm lazy enough to do that!)
Iain.
Plz sir... CPallini CPallini abuz drugz, plz plz help urgent.
|
|
|
|
|
Hai,
Any body knows any freeware OR Tool is available to detect memory leak in Vc++ code.
Please refer the links...
Rply me,
Jhony...
Born to win...!
|
|
|
|
|
Search Codeproject for Visual Leak Detector...
|
|
|
|
|
|
|
|
Hi, Im programming in visualC++ with MFC in vs2008.
When using some applications like instant messenger, whenver someone signs in there is a popup in the bottom right corner of the screen saying 'xyz has signed in'. I want to make a popup like that. It should rise up from the status bar and then drop back down into it the way it happens in messenger. In addition the rest of the program should not stop running when that popup is rising up and lowering down.
Except I have no idea how to do this.. Can anyone offer some tips, name some APIs or link me to some articles on this? Im not exactly sure what this topic is called so I cant even do a decent search on it.
Thanks for any help.
|
|
|
|
|
garyofcourse wrote: Hi, Im programming in visualC++ with MFC in vs2008.
garyofcourse wrote: When using some applications like instant messenger, whenver someone signs in there is a popup in the bottom right corner of the screen saying 'xyz has signed in'. I want to make a popup like that. It should rise up from the status bar and then drop back down into it the way it happens in messenger. In addition the rest of the program should not stop running when that popup is rising up and lowering down.
You can use CMFCDesktopAlertWnd[^] if you are using MFC feature pack.
Else you need to create a top most popup window most probably a captionless dialog will do and then use AnimateWindow to make the window slide/fade in.
Also you've got to make the window appear alongside the window's taskbar so take note of the taskbar position too.
Nibu babu 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
|
|
|
|
|
|
when i look into 7z's code,
find this:
namespace NSignature
{
UInt32 kLocalFileHeader = 0x04034B50 + 1;
UInt32 kDataDescriptor = 0x08074B50 + 1;
UInt32 kCentralFileHeader = 0x02014B50 + 1;
UInt32 kEndOfCentralDir = 0x06054B50 + 1;
UInt32 kZip64EndOfCentralDir = 0x06064B50 + 1;
UInt32 kZip64EndOfCentralDirLocator = 0x07064B50 + 1;
class CMarkersInitializer
{
public:
CMarkersInitializer()
{
kLocalFileHeader--;
kDataDescriptor--;
kCentralFileHeader--;
kEndOfCentralDir--;
kZip64EndOfCentralDir--;
kZip64EndOfCentralDirLocator--;
}
};
static CMarkersInitializer g_MarkerInitializer;
}
i really wonder why they did this?
do any body have read this code?
Thanks
|
|
|
|
|
0x04034B50;
0x08074B50;
0x02014B50;
0x06054B50;
0x06064B50;
0x07064B50;
those code are const, why add 1 and then sub 1?
|
|
|
|
|
I guess for getting the number in the first instance. A second gets it lowered by 1.
Greetings from Germany
|
|
|
|
|
Hi all,
Can anyone tell me how can i set the text of any button at runtime.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|