|
I am using SHBrowseForFolderA for showing a file dialog. The length of the selected path is geyting trimmed.
I've used these flags
bi.ulFlags = BIF_RETURNONLYFSDIRS | BIF_STATUSTEXT;
Is there any way by which i can increase the size of the label in the dilaog box for the currently selected path.
Thanks,
---Arun.
|
|
|
|
|
arunperi wrote: I am using SHBrowseForFolderA for showing a file dialog.
It is used to browse folders .
Can you show code, what you are trying ? And explain a bit clearer ?
|
|
|
|
|
I think I saw examples on the codeproject change size or insert a controls to this dialog did you search on the codeproject.
|
|
|
|
|
Hello All,
I have a working timer in MFC can anyone tell me how to change it to Win 32.
MFC Timer Code.<br />
<br />
#define ELAPSED_TIMER 101<br />
time_t lStopTime;<br />
time_t lStartTime;<br />
CTimeSpan cteElapsedTime;
<br />
time(&lStartTime);<br />
SetTimer(s->m_hWnd,ELAPSED_TIMER, 1000, NULL);<br />
<br />
KillTimer(s->m_hWnd, ELAPSED_TIMER);
<br />
void CSDlg::OnTimer(UINT nIDEvent) <br />
{<br />
if(nIDEvent == ELAPSED_TIMER)<br />
{<br />
time(&lStopTime);<br />
cteElapsedTime = CTimeSpan(lStopTime-lStartTime); <br />
CString csElapsedTime;<br />
csElapsedTime.Format("%02d:%02d:%02d", <br />
cteElapsedTime.GetHours(),<br />
cteElapsedTime.GetMinutes(),<br />
cteElapsedTime.GetSeconds());<br />
if(IsWindowVisible())<br />
{<br />
m_TIME.SetWindowText(csElapsedTime);<br />
}<br />
} <br />
CDialog::OnTimer(nIDEvent);<br />
}
How to change it to win 32 application ?? what are the changes which I have to make in the below code????
<br />
<br />
int APIENTRY WinMain(HINSTANCE hInstance,<br />
HINSTANCE hPrevInstance,<br />
LPSTR lpCmdLine,<br />
int nCmdShow)<br />
{<br />
INT_PTR mRet = DialogBox(hInstance, <br />
MAKEINTRESOURCE(IDD_MAIN),<br />
GetDesktopWindow(),<br />
MainDlgProc);<br />
return 0;<br />
} <br />
<br />
<br />
BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)<br />
{<br />
<br />
switch(Message)<br />
{<br />
<br />
case WM_INITDIALOG:<br />
{<br />
SetTimer(hwnd,IDT_TIMER, 1000,(TIMERPROC) NULL); <br />
}<br />
break;<br />
<br />
<br />
case WM_CLOSE:<br />
EndDialog(hwnd, 0);<br />
break;<br />
<br />
case WM_COMMAND:<br />
<br />
switch(LOWORD(wParam))<br />
{<br />
case IDC_EXIT:<br />
EndDialog(hwnd, 0);<br />
break; <br />
<br />
case IDC_Start:<br />
<br />
break;<br />
<br />
case IDC_End:<br />
KillTimer(hwnd, IDT_TIMER);<br />
break;<br />
}<br />
default:<br />
return FALSE;<br />
}<br />
return TRUE;<br />
}
Thanking you,
Suresh HC
|
|
|
|
|
Suresh H wrote: BOOL CALLBACK MainDlgProc(HWND hwnd, UINT Message, WPARAM wParam, LPARAM lParam)
{
switch(Message)
{
You need to add one more case here,
case WM_TIMER:
if((UINT)wParam== ELAPSED_TIMER)
{
}
|
|
|
|
|
Hi Prasad,
Thanks for the response.
In the declaration only I am getting error. But it is working in MFC.
Hw to do it in Win32 ???
#define ELAPSED_TIMER 101<br />
time_t lStopTime;<br />
time_t lStartTime;<br />
CTimeSpan cteElapsedTime;
error C2146: syntax error : missing ';' before identifier 'cteElapsedTime'
error C2501: 'CTimeSpan' : missing storage-class or type specifiers
fatal error C1004: unexpected end of file found
|
|
|
|
|
Suresh H wrote: error C2146: syntax error : missing ';' before identifier 'cteElapsedTime'
error C2501: 'CTimeSpan' : missing storage-class or type specifiers
Its MFC stuff.
Use difftime instead. See its MSDN example.
|
|
|
|
|
Hi Prasad,
No much information in MSDN.
i got this link for win32 timers.
http://msdn2.microsoft.com/en-us/library/ms632592.aspx
|
|
|
|
|
I was taking about difftime[^] example from MSDN .
|
|
|
|
|
Prasad example gives the time diffrence only.
int main( void )<br />
{<br />
time_t start, finish;<br />
long loop;<br />
double result, elapsed_time;<br />
<br />
printf( "Multiplying 2 floating point numbers 500 million times...\n" );<br />
<br />
time( &start );<br />
for( loop = 0; loop < 500000000; loop++ )<br />
result = 3.63 * 5.27; <br />
time( &finish );<br />
<br />
elapsed_time = difftime( finish, start );<br />
printf( "\nProgram takes %6.0f seconds.\n", elapsed_time );<br />
}
|
|
|
|
|
You need to use one of time management[^] function. difftime is used as substitue for CTimeSpan .
|
|
|
|
|
Handle WM_TIMER message. Rest r fine.
Come online at:-
jubinc@skype
|
|
|
|
|
|
Thank you white sky. link is very usefull.
|
|
|
|
|
You're welcome
|
|
|
|
|
Hi All,
If I comment out the following, the program compiles:
std::cout << _T("0x") << std::hex << dwBaseAddress << std::endl;
I've included <iostream>, <string>, <iomanip>, and <locale>. Google turned up 0 hits for std::hex and LNK2019 (Google Search[^]). The same is true for LNK2019 and std::locale::facet::_Register, etc. I'm not sure what library I am missing since the other Standard C++ stuff works.
Does anyone know how to compile a release version of a program that uses a hex modifier during output?
Jeff
CodeDump error LNK2019: unresolved external symbol "public: void __thiscall std::locale::facet::_Register(void)" (?_Register@facet@locale@std@@QAEXXZ) referenced in function "?use_facet@?$@V?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@@std@@YAABV?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@1@ABVlocale@1@@Z" (?use_facet@?$@V?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@std@@@std@@YAABV?$num_put@GV?$ostreambuf_iterator@GU?$char_traits@G@std@@@std@@@1@ABVlocale@1@@Z)
CodeDump error LNK2019: unresolved external symbol "public: class std::locale::facet const * __thiscall std::locale::_Getfacet(unsigned int)const " ...
CodeDump error LNK2019: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " ...
CodeDump error LNK2019: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " ...
|
|
|
|
|
Hey, I can compile this tiny code without any problem in console(VC6,VC8).
Try to shorten the problem code, and compile it in separate app.
|
|
|
|
|
Hi Prasad,
Selecting multi-threaded - /MT - solved the problem in release (a stock console application selects single threaded).
Jeff
|
|
|
|
|
Hi,
can any one help me in upgrading my VC++ SP4 to SP6.can it be freely downloaded from NET?
mpk1979
|
|
|
|
|
|
How can i convert the above?
Thanks
|
|
|
|
|
You mean CString to TCHAR* , isn't it ?
|
|
|
|
|
No,i have to convert a Cstring variable to TCHAR variable only.No pointer for TCHAR.
|
|
|
|
|
Have you considered fact , that CString is a 'string' , array of characters ? In other words its array of TCHAR . Do you want signle TCHAR out of CString ? If yes, then reply by Navin suffice.
But seems strange wording.
|
|
|
|
|
CString cs = "some text";
TCHAR c = cs[0];
nave
|
|
|
|