|
Its between working and not working.
|
|
|
|
|
|
It's just that you are not seeing the grid as you put a bitmap on top of it. I recommend you to draw this your self.
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
how can i get monitor resolution (currently set) using vc++ code coz i hv to give maximum size of my Parent dialog as default size.
|
|
|
|
|
Use the GetSystemMetrics function with SM_CXSCREEN for the pixel width, and SM_CYSCREEN for the pixel height of the monitor.
Regards,
--Perspx
"A refund for defective software might be nice, except it would bankrupt the entire software industry in the first year." -Andrew Tanenbaum
"Einstein argued that there must be simplified explanations of nature, because God is not capricious or arbitrary. No such faith comforts the software engineer." -Fred Brooks
|
|
|
|
|
|
|
Hi,
I am working VC++ on VC6.0 IDE
I am using lot of CString constants in my program
I am using #define to replace strings instead of USING string table and loading stings;
like:
#define ID_NAME _T("Krishna")
#define ID_PROFILE_PATH _T("\\Folder11\\Krish")
like above i have 10 t0 12 strings.
To work with this which way is the best way
using #defines or using string table?
If any methos is best, why?
Thanks in advance
----------------------------
KRISHNA KUMAR T M
|
|
|
|
|
krishnakumartm wrote: If any methos is best, why?
doesnt it depend on what the program does, and what its future prospects are ... if its just a one-off console mode program, then, maybe you dont need to think beyond #define
But if it is a serious program, and you may want to (for example) localise the strings for different languages later, then you should consider resource/string tables, or, even keeping the strings in an external file (possibly xml) .. maintenance will be way easier then if a little work is doen up-front.
'g'
|
|
|
|
|
Are you concerned about memory usage? Even so, you would need a bunch of string constants in order for that to be an issue.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
i want to show browse button on a dialog box application and i want to select a folder not file.
how can i implement for browse control for selecting folder? thanks in advance.
|
|
|
|
|
You can use of SHBrowseForFolder .
|
|
|
|
|
thanks Hamid for replying me.
Could u plz tell me whether i can get some sample code or sample project for browse control?
|
|
|
|
|
|
hi Hamid,
thanks a lot for replying me.
i want to make implementation simple so what i have done is:
i have taken 1 button, on click event i have implemented as below:
void Logfilepath::OnBrowse()
{
// TODO: Add your control notification handler code here
{
CFileDialog FileDialog(TRUE,"*.*",NULL,OFN_HIDEREADONLY,"Text Files: (*.txt)|*.txt||",this);
if(FileDialog.DoModal() == IDOK)
{
CString PathName = FileDialog.GetPathName();
// CString PathName1 =FileDialog.GetFolderPath();
m_ctrledit.SetWindowText(PathName);
}
}
}
now with this implementation i am able to select files but i want to select only folder.
what other implementation i should do so that i will be able to select folder and not file?
|
|
|
|
|
Why you dont use of SHBrowseForFolder it simple to use.
|
|
|
|
|
thanks Hamid,
yaa i could implement that using SHBrowseForFolder.
|
|
|
|
|
I hope this little sample code will help you if you want to select the folder,
void CFolderSelectionDlg::OnBrowseClick()
{
BROWSEINFO brwsInfo;
ZeroMemory(&brwsInfo,sizeof(BROWSEINFO));
int iImage = 0;
char szFolderPath[MAX_PATH];
char szTitle[255];
memset(szFolderPath,'\0',sizeof(szFolderPath));
memset(szTitle,'\0',sizeof(szTitle));
brwsInfo.hwndOwner = GetSafeHwnd();
brwsInfo.iImage = iImage;
brwsInfo.lpfn = NULL;
brwsInfo.pidlRoot = NULL;
brwsInfo.pszDisplayName = szFolderPath;
brwsInfo.lpszTitle = szTitle;
//InitCommonControls();
ITEMIDLIST *ptrItemList = SHBrowseForFolder(&brwsInfo);
if(ptrItemList != NULL)
m_strFolderPath = szFolderPath;
UpdateData(FALSE);
}
this is the simplest. if you want all advanced functionality, you should inherit yoour custom fileDialog class. please go thourh the MSDN.you have to write your version of
virtual void OnFolderChange();
virtual BOOL OnFileNameOK();
best of luck...
kamalesh
|
|
|
|
|
Anjali Patil wrote: now with this implementation i am able to select files but i want to select only folder.
what other implementation i should do so that i will be able to select folder and not file?
You were suggested to use SHBrowseForFolder() . Why show code that does otherwise?
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Can someone tel me what's the equivalent of the following on .Net 2003
<br />
istrstream sin(szBuffer);<br />
sin.eatwhite();
Thanks a lot
I appreciate your help all the time...
CodingLover
|
|
|
|
|
CodingLover wrote: Can someone tel me what's the equivalent
There is no equivalent ISO C++ function available, you will have to write your own.
Best Wishes,
-David Delaune
|
|
|
|
|
Hi all,
I've get a sample code from one of my friends used in word processing application. Written on C++ 6.
I'll try to run it on VS.Net 2003. At compile time I got an error on this.
ifstream fin(lpszPathName, ios::in | ios::nocreate | ios::binary);
Actually I got the error on ios::nocreate
I've never see this identifier for ios base. Can anyone clarify me on this.
Thanks
I appreciate your help all the time...
CodingLover
|
|
|
|
|
Hi.
CodingLover wrote: I've get a sample code from one of my friends used in word processing application. Written on C++ 6.
I'll assume that you meant Visual C++ 6, since there is no "C++ 6"...
CodingLover wrote: Actually I got the error on ios::nocreate
I've never see this identifier for ios base. Can anyone clarify me on this.
Assuming that by "error" you mean a "compiler error"... This has to do more with history of the pre-standard C++ era. Take a look at this[^].
Regards.
Stupidity is an International Association - Enrique Jardiel Poncela
Die deutsche Sprache sollte sanft und ehrfurchtsvoll zu den toten Sprachen abgelegt werden, denn nur die Toten haben die Zeit, diese Sprache zu lernen. - Mark Twain
|
|
|
|
|
Wondering if anyone has encountered this issue:
I put a modeless dialog into one of my apps, which has two controls -- a CAnimateCtrl, and a static text. It's basically a little splash to keep the user happy, while one of my DLLs is doing some lengthy work. I put some text there to tell them what's happening, and a little animation for eye candy.
Doesn't quite work though!
The animation will show, but not play.
Pretty simple stuff, and works if the little dialog is modal, but won't play when modeless, unless I make the dialog visible on startup -- and then it only plays on startup -- not after I call it up with ShowWindow (which calls the Play function).
Everything seems to be in order, so the only thing I can think of, is perhaps there is a threading issue between my main app, and the work the DLL is doing...?
Any ideas...?
Thanx,
Rick
|
|
|
|
|
Does the animation play when you move the mouse over it? If so, then you may need to start a timer to keep the message loop running. Try something like SetTimer(1, 50, NULL); in OnInitDialog().
|
|
|
|