|
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/[^]
|
|
|
|
|
Hi!
How can I create a Menu on a Dialog Box based program?
I'm trying to write it using Win32 API calls not MFC.
I can't seem to be able to display the menu on the Dialog.
Please Help!
|
|
|
|
|
Hi Folks !!
I have looked around the Site and the Internet for quite a while,but I did only find out how I can use a call from java to a c/c++ dll.
But I want to use Java in a C++ Program (written with wxWindows) to connect to a mobile Phone using Bluetooth. I could not find anything about embedding. Am I dumb or just blind ?
Can somebody please point me to the right direction ?? Thanks a lot.
rya.
Scorcher24
|
|
|
|
|
How can I convert a variable length string (CString) to character array (char*) when the application is a unicode (_UNICODE preproccessor is defined)?
|
|
|
|
|
How about:
CString str;
TCHAR *p = str.GetBuffer(x); Unless you really need it to be a char . That requires something else.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
It will convert to wchar_t* not char*
|
|
|
|
|
Your friend is WideCharToMultiByte ... Nuff said.
|
|
|
|
|
When I first encountered CStrings, I found it annoying that they cannot be cast directly to (char*) strings, e.g.
CString str = "...";
char* c = (char *) str; // WON'T COMPILE!
But if you first cast it to a const char*, it works. When I have to do this a lot, I define the following macro:
#define STOC(X) ((char *) (const char *)(X))
STOC stands for "String TO Char". This macro will convert a CString to a char* string, however if you're using unicode, it will only work if the original CString just has ASCII characters.
|
|
|
|
|
The double cast is very dangerous as it can lead to buffer overruns if you are not absolutely careful. That is why CString has the GetBuffer() and ReleaseBuffer() member functions.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|