|
Hi,
Can anyone tell me how to make a Splash Screen using VC++ ?
I am used to the Visual Basic style :
frmSplash.show
do our initialization work
frmSplash.hide
With VC++, when I create a splash screen dialog box, then write:
CSplashDialog dialog;
dialog.DoModal();
Sleep(1000); /* or do my init stuff */
dialog.EndDialog();
It seems like the system gets stuck in the dialog.DoModal() function.
How to change the code ? Do I have to do my stuff inside my splash dialog ?
Thanks a lot
|
|
|
|
|
|
If you're using VC6, go to Project/Add to project/Components and controls/Visual C++ components. There's a Splash Screen component which is ready to use.
Tomasz Sowinski -- http://www.shooltz.com
- It's for protection - Protection from what? Zee Germans?
|
|
|
|
|
All,
I was wondering if anyone has had issues with FtpGetFile. This behavior is rather odd; the file is there but cannot be downloaded. I have had my remote user check out the file security/privileges; they appear to be in order. I would like to be able to provide more information. However, since this is happening at a remote site, I do not have more information. Does anyone have any ideas?
Thanks in Advance,
Rich
|
|
|
|
|
Hi,
How can i read the unicode string from a file?
Thanks
Neha
|
|
|
|
|
Hi people,
A small question.
In a dialog-based app, why is it impossible to start up a new dialog after the main dialog closes? (i.e. right after the DoModal returns in the app's InitInstance handler)
Even when you try to pop up a simple MessageBox it doesn't show. You can just hear the typical MessageBox 'Bling', but then the app shuts down.
Can anyone explain why this is the case? And what I should do to achieve my goal: showing a 'saving, please wait' dialog after the users hits finish in my wizard.
Thanks a lot for your help,
ren
|
|
|
|
|
|
|
Hey, I posted this once and I am hoping to get some suggestions this time. If nobody knows, hey, that is life. I am trying to set the font/color, etc, for text in a multiline text editor. The user can highlight as many lines (or chars) as he/she wants, and then change all the text that has been selected to the font/color. The problem is that it is not working. I get the font characteristics, then call EM_SETCHARFORMAT with the SCF_SELECTION. According to MS website, this will change all the selected text. It doesn't. It seems, when there is a carriage return or word wrap of some kind, it cannot handle these characters. So it only changes 1 line. I do not know how to get around this. I have used EM_EXGETSEL and then send EM_EXSETSEL, this doesn't help either. Does anybody have any ideas? I have no clue how to get around the word break chars.
|
|
|
|
|
|
I think it will be much easier should you use a rich edit control.
Best regards,
Alexandru Savescu
|
|
|
|
|
|
Hello,
I have a problem with an edit control. It doesn't get updated until I show a MessageBox.
I have a variable attached to the edit control called m_szText. From outside view class I call a function
void MyView::AddText(CString szNewText)
{
m_szText += szNewText;
if ( UpdateData(FALSE) )
std::cout << "updated" << std::endl;
else
std::cout << "not updated" << std::endl;
}
As those couts go to a debug console, I get to know, if updating has succeeded or failed.
But the result is - no text in the edit control and debug window claims that updating succeeded.
I checked with a small application, that normally this should work.
Where should I continue searching for a mistake??
-Janetta
|
|
|
|
|
Are you calling your AddText function in a lenghtly operation, that is initiated from within the same dialog or another modal dialog of the same thread?
The edit box has no chance to display it's changed content until windows message processing occurs.
--
Daniel Lohmann
http://www.losoft.de
|
|
|
|
|
Daniel Lohmann wrote:
Are you calling your AddText function in a lenghtly operation, that is initiated from within the same dialog or another modal dialog of the same thread?
I use SDI and CFormView. First I have an OnButton function in the view that calls a function in the Doc. Doc calls another function in another file (written in C) and that calls another function in another file that calls AddText. I hope I answered the question you asked. And I know it doesn't sound like a very good structure...
I guess I could use your CEditLog in here, but this is so small thing that adding a couple of classes because of this seems too much.
Daniel Lohmann wrote:
The edit box has no chance to display it's changed content until windows message processing occurs.
So should I add windows message handlers OnUpdateEdit and OnChangeEdit for my edit control and call those from AddText? And if so, what should I do in those functions?
-Janetta
|
|
|
|
|
Janetta wrote:
use SDI and CFormView. First I have an OnButton function in the view that calls a function in the Doc. Doc calls another function in another file (written in C) and that calls another function in another file that calls AddText. I hope I answered the question you asked. And I know it doesn't sound like a very good structure...
Yep, this sounds that there is no messange processing during perfoming a lengthy operation. Unless the thead returns from the OnButton function, no message processing occurs.
You have, in prinicple, two possibilities:
- Perform the lenghty operation in it's own thread. In this case I recommend using CEditLog, because it is proven to be thread safe.
- Add some code to the end of your AddText() function that ensures all outstanding messages are processed. It's quite a long time ago I did this last, but AFAIR the following code should do it (taken with slight modifications from MSDN, do a search for "Idle Loop Processing":
MSG msg;
while ( ::PeekMessage( &msg, NULL, 0, 0, PM_NOREMOVE ) )
{
if ( !AfxGetThread()->PumpMessage( ) )
{
::PostQuitMessage( );
break;
}
}
LONG lIdle = 0;
while ( AfxGetApp()->OnIdle(lIdle++ ) )
;
Note: I was not able to check this code and I am not an expert on this deep MFC stuff, but I assume it would work. Maybe somebody else with more in-depth MFC knowledge could comment on this.
--
Daniel Lohmann
http://www.losoft.de
(Hey, this page is worth looking! You can find some free and handy NT tools there )
|
|
|
|
|
Thanks!
I tried number two and it worked.
-Janetta
|
|
|
|
|
Hi all,
i'm looking for code samples or components to create flowchart's.
It should looking like in MS Visio.
I need a WorkSheet and then i want place Shapes and Connections between
these shapes. I want to move these Shapes also.
It's for a Programm Generator Program.
Has anybody links / classes or demo applications for me ?
( I'm a newbie in GDI Programming )
Thanxs !
Marco
|
|
|
|
|
Hi everybody,
I have added a button in Internet Explorer. When I toggle this button, I want to write and load values to and from the IE->Internet Options->Connections->LAN Settings->Advanced dialog.
Q1: Does anyone know how to directly (not going through the registry) change the values in the above mentioned dialog?
Q2: If this is not possible (direct access), then I know how to change the registry settings which IE reads every time it is started. However, being a button in IE, I need the registry settings to reflect immediately to IE without closing (now that would be stupid). This may be inefficient but if it's the only solution then how can I do it? I've been told that it could be done by broadcasting WM_SETTINGCHANGE to all top-level windows. But I don't know the syntax of the wParam or lParam argument it expects. I've tried the reg key that was changed and even tried with nothing at all (SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, 0, 0)), but still the changes are not visible at runtime in IE.
I have a strict deadline in two days and I really need to fix this!!!
Any help would be greatly appreciated,
/Tommy
|
|
|
|
|
On Windows 2000 I need to know whether a particular disk is Basic or Dynamic . Is there a API through which I can get this info' or is it available through WMI(if so what is the WMI class I need to go far).
thanks
Kannan
|
|
|
|
|
I think UINT GetDriveType(LPCTSTR lpRootPathName) should do the trick.
It takes a string to the rootpath and returns an unsigned int containing:
0 The drive type cannot be determined.
1 The root directory does not exist.
DRIVE_REMOVABLE The drive can be removed from the drive.
DRIVE_FIXED The disk cannot be removed from the drive.
DRIVE_REMOTE The drive is a remote (network) drive.
DRIVE_CDROM The drive is a CD-ROM drive.
DRIVE_RAMDISK The drive is a RAM disk.
"After all it's just text at the end of the day. - Colin Davies
|
|
|
|
|
thanks for the info', but I think I need a different type
of information. I think I need to fillin more info.
In Win2K and above OS's you have this option of having dynamic volumes. By default, I think its the Basic volume which can then be converted to dynamic.
You do this by rt clicking My Computer->Manage->Disk Management->Rt. Click on Disk 0 -> Convert to Dynamic Disk. I would like to know whether a Disk is Basic or Dynamic.
thanks again for the reply.
regards
Kannan
|
|
|
|
|
Hello
I am doing a project where I have to display multiple HTML pages in a tabbed format like in the Opera Web browser. I intend to use the Property Pages for the tabbing and CHtmlView for the display.
Can you tell me how to start off? If you have any alternative to using this combination, that would be fine too.
Regards
Sridhar J
|
|
|
|
|
When I use CListCtrl::SetBkImage(..), the function returned FALSE
In my application
In CMyWinApp::InitInstance(..) {...
// I Add
AfxOleinit();
}
void CMyListView::OnInitialUpdate()
{
CListView::OnInitialUpdate();
CListCtrl& ListCtrl = GetListCtrl();
HBITMAP bmp = (HBITMAP) ::LoadImage(AfxGetInstanceHandle(), "F:\\jpeg2\\first\\Bk.bmp",
IMAGE_BITMAP, 0, 0, LR_DEFAULTCOLOR | LR_LOADFROMFILE);
ASSERT(bmp != NULL);
ASSERT(ListCtrl.SetBkImage(bmp)); // Wrong here !!!
....
}
It's me, code_cold
|
|
|
|
|
I have a MFC dialog based app, which is a small setup for another program. This setup may save data with a specific file extension, say ".evl" . So if i double click on a .evl file, it opens automatically my app (Because i asked it to do so the first time i double clicked, you know, with the Open with...) and then ... How do i programatically catch that the user actually started the app by double clicking, and how do i retrieve the file name ???
Thanks
RaGE
~RaGE();
|
|
|
|