|
i am using microsoft visual c++ express editon 2005 and i dont think it has a built in component like that. it was the first way i thought of and i thought it would work but obviously it doesnt.
how would i go about writing the code so that it does it the way that you stated. i dont want it to be using memory the entire time the programs running it would slow it down too much. if you could give me an idea on how to do this it would be greatly appreciated, thank you.
- Kyle
|
|
|
|
|
gr8coaster329 wrote:
i am using microsoft visual c++ express editon 2005 and i dont think it has a built in component like that.
Possibly.
gr8coaster329 wrote:
how would i go about writing the code so that it does it the way that you stated.
The code that creates the splash screen should call ShowDialog to show it, then have the code to create the main form directly after. Then, when your splash screen closes itself, the next bit of code will create the main form.
So, why did you decide to use managed C++ ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
i use managed c++ because it is what is used in microsofft visual c++ EE 2005. i used it because it was the first free visual c++ compiler that was like what i wanted so i just use it. it works fine for me. if you know of any good programs like this that are better i would try it but i just do programming as a hobby right now and i cant afford to buy software.
Thank you for your help
- Kyle
|
|
|
|
|
Are you honestly saying that 2005 EE ONLY lets you use managed C++ ? Do you realise the difference between this and C++ ?
You're wrong, you can build C++ applications with EE 2005, you don't need to use managed extensions. I just checked the Microsoft site.
gr8coaster329 wrote:
but i just do programming as a hobby right now and i cant afford to buy software.
If you're learning, you should learn C++ first, then MC++. This way, you're essentially learning two languages at once. MC++ is C++ with additional constructs that let you use the .NET framework ( which means your app requires the .NET framework 2.0 to run ). You should write some console apps first, then some MFC apps before moving to MC++, and if you still want to, you should learn C# instead. I don't see any reason to use MC++ except to write bridging dlls between C++ SDKs and C#.
*edit* actually I don't think the free version offers MFC or ATL. Which means you're stuck with MC++ or Win32 SDK style code for windows apps, I guess.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I agree with all that Christian has said about the design being inappropriate but that's up to you.
The simple answer to the problem you have is that your timer event handler cmd_time_reached is not a member of the frm_splash_screen class so this->Close() will not close the splash screen (this doesn't point to it).
You don't show how the splash screen is created but you could keep a handle to it and do SplashScreen->Close()
The opinions expressed in this communication do not necessarily represent those of the author (especially if you find them impolite, discourteous or inflammatory).
|
|
|
|
|
i use shellexecute api function to run other application from my application. but now i need to close that running application from my application. how can i do that?
Thanks
Rastegar
|
|
|
|
|
send it a WM_CLOSE message ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
See ShellExecuteEx() and TerminateProcess() .
/ravi
My new year's resolution: 2048 x 1536
Home | Music | Articles | Freeware | Trips
ravib(at)ravib(dot)com
|
|
|
|
|
I am looking to develop a simple app in C that will search and extract text from a MS Word document and was hoping someone might be able to share their code or point me to a good source I can model. Thanks.
|
|
|
|
|
I am trying to write an app in VC++ (2002, 7.0) that reads information from a remote SOAP server. I've been trying to find something usable on here and on web searches but I can only find .NET or C# examples or irrelevant C++ examples. I'm looking for a piece of simple SOAP client source code in VC++ to send a request and receive a response. Can anyone point me to a good simple example I can work with?
|
|
|
|
|
You don't want to use the APIs that do this automatically ? I'm sur ethere's an SDK for this sort of thing.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Well, I went to this microsoft.com site for the SOAP Toolkit 3.0 which is the SOAP SDK but the first thing it says below the file information is "The Microsoft SOAP Toolkit is deprecated by the .NET Framework." and also later it says that the active toolkit support has expired so no new work will be contributed to it by Microsoft.
|
|
|
|
|
Which just means they want you to use the .NET framework for SOAP. If you're not using Managed C++, then you can't do that, so..... You're still better off with a toolkit that exists than writing from scratch, surely ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Okay, that's the definition I didn't have. I'll check it out, thanks.
|
|
|
|
|
Hello,
I'm inserting hundreds of items into a CListCtrl. Currently, the CListCtrl is only being updated after all of the items have been inserted. I want the CListCtrl to be updated as each item is added (that way the user has immediate feedback rather than having to wait several seconds for something to happen).
I'm currently working in code that is not mine (and not commented) so it's difficult to tell if this is typical behavior or something the previous programmer introduced.
I've tried invalidating the client area after each item is inserted but this doesn't fix the problem (shouldn't this send a WM_PAINT message and force the client to be redrawn?)
I'd really appreciate any help anyone could give me.
Thanks!
|
|
|
|
|
don't do that, it will slow your application.
and the user will not be able to do anything while the list is populated; assuming you are doing something like :
while ( something )
{
insertItemInList( someItem );
}
have a look a this article ( http://www.codeproject.com/listctrl/virtuallist.asp[^]
) it shows a technique to improve performance for lists with a large number of items.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Thanks for the advice! I'll take a look at that article...
|
|
|
|
|
Ian Bowler wrote:
I'm inserting hundreds of items into a CListCtrl. Currently, the CListCtrl is only being updated after all of the items have been inserted. I want the CListCtrl to be updated as each item is added (that way the user has immediate feedback rather than having to wait several seconds for something to happen).
I'm currently working in code that is not mine (and not commented) so it's difficult to tell if this is typical behavior or something the previous programmer introduced.
I'd suggest looking for calls to SetRedraw(FALSE) and SetRedraw(TRUE) placed at the start and end of the loading process.
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|
|
That was it! There was a call to SetRedraw(FALSE) buried four calls down on the stack.
Thanks a lot!
|
|
|
|
|
Hi,
I am doing a project in win32 vc++. I display some text in edit control. I read the text from file into a string and set it to the edit control...
by
SendDlgItemMessage( hDg,IDC_HELP_TEXT, EM_FMTLINES, TRUE,0 );
SetWindowText(GetDlgItem(hDg,IDC_HELP_TEXT),(LPCSTR) Helptext);
But when I run the project all the text displayed in the edit are highlighted i.e. selected. How do I overcome this.
Thanks in advance.
|
|
|
|
|
Ann66 wrote:
But when I run the project all the text displayed in the edit are highlighted i.e. selected. How do I overcome this.
Send the control a EM_SETSEL message (after the dialog has been fully initialized).
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
I tried that. Still does'nt work..pls help.
|
|
|
|
|
What code did you use?
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
This is my code in initdialog
int count;
FILE *fp_help;
char HelpPath[MAX_PATH];
char Helptext[50000];
char tmptext;
GetModuleFileName(NULL,HelpPath,MAX_PATH);
*(strrchr(HelpPath, '\\') + 1) = '\0';
strcat(HelpPath,"ReadMe.txt");
if((fp_help = fopen(HelpPath,"r"))== NULL)
{
MessageBox(0,"No Help Available","Elo Serial Number Configuration",MB_OK);
}
else
{
count = 0;
strcpy(Helptext,"");
while ((tmptext = fgetc(fp_help)) != EOF)
{
if((tmptext != 0x0D)&& (tmptext != 0x0A))
{
Helptext[count++] = tmptext;
}
else
{
Helptext[count++] = 0x0D;
Helptext[count++] = 0x0A;
}
}
Helptext[count] = '\0';
fclose(fp_help);
SendDlgItemMessage( hDg,IDC_HELP_TEXT, EM_FMTLINES, TRUE,0 );
SetWindowText(GetDlgItem(hDg,IDC_HELP_TEXT),(LPCSTR) Helptext);
SendDlgItemMessage( hDg,IDC_HELP_TEXT, EM_SETSEL,-1,0 );
SetFocus(GetDlgItem(hDg,IDC_HELP_CLOSE));
|
|
|
|
|
Ann66 wrote:
SendDlgItemMessage( hDg,IDC_HELP_TEXT, EM_SETSEL,-1,0 );
You have to do this after the dialog has finished initializing. One of the last things that happens to a dialog during initialization is to set focus to the first non-static control, and if that is an edit control, all of its text is selected. Unselecting text before then is pointless.
case WM_INITDIALOG:
...
SetWindowText(GetDlgItem(hDg,IDC_HELP_TEXT),(LPCSTR) Helptext);
PostMessage(hDg, PM_DESELECT, 0, 0);
break;
case PM_DESELECT:
SendDlgItemMessage( hDg,IDC_HELP_TEXT, EM_SETSEL,-1,0 );
break;
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|