|
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
|
|
|
|
|
It worked..thnx a lot
|
|
|
|
|
Hi,
I written a Webbrowser code in VC6. When ever i try to access some of the sites,
Tool gives "Internet explorer script error" message. which needs manual interaction.
Is there is any way i can avoid this script error message in VC6 code .... Please point me out ....
Dinesh.A
|
|
|
|
|
Hi,
I automate PowerPoint using VC++.
I want to group some shapes of a slide.
To do this, I have to use the method Range of the object Slides.
Its prototype is:
LPDISPATCH Range(const VARIANT& index);
I don't know how constructing the parameter.
I've tried something like this, with no success:
------------
int index[2];
index[0] = 4;
index[1] = 5;
VARIANT var;
VariantInit(&var);
var.vt = VT_ARRAY;
var.pintVal = index;
shapeRange = shapes.Range( var);
---------
This is the beginning of my code:
-----
_Application app;
Presentations presentations;
_Presentation presentation;
Slides slides;
_Slide slide;
app.CreateDispatch("Powerpoint.Application"))
Presentations presSet(app.GetPresentations());
_Presentation pres(presSet.Add( true));
Slides slideSet(pres.GetSlides());
_Slide slide1(slideSet.Add(1, 2));
-----
Thanks
|
|
|
|
|
I don't know if that's what Range expects, but if you need to create a VARIANT containing an array of ints, what you are doing is not the right way.
Try something like this instead:
void VariantArrayFromIntArray(VARIANT& var, int* pInts, int size)
{
var.vt = VT_ARRAY | VT_I4;
var.parray = SafeArrayCreateVector(VT_I4, 0, size);
for (long ix = 0; ix < size; ix++)
SafeArrayPutElement( var.parray, &ix, pInts+ix );
}
void YourCode()
{
.
.
.
int index[] = {4, 5};
VARIANT var;
VariantArrayFromIntArray(var, index, sizeof(index)/sizeof(index[0]));
shapeRange = shapes.Range( var);
.
.
.
}
Hope that helps,
--
jlr
http://jlamas.blogspot.com/[^]
|
|
|
|