|
Hi,
If I have a App that launch a dialog. After the dialog is launched, I can set the focus into an edit control contained by the dialog. By adding
m_wndMyEdit.SetFocus() into OnInitDialog() and returning false.
How can I do it for a CDialogBar? CDialogBar dont have any OnInitDialog() method?
thanks;)
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Make sure you return FALSE from your OnInitDialog() . Alternatively, you could use GotoDlgCtrl() . Finally, you could set the tab order of your controls so that the edit control is the first one.
/ravi
Let's put "civil" back in "civilization"
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
k thanks, But how can I do it for a CDialogBar?
Everything's beautiful if you look at it long enough...
|
|
|
|
|
Hye,
I have create my own control which derived from CWnd. In this control their are ScrollBar what I manage in code. I work perfectly except for the mouse Wheel ! I never receive the message WM_MOUSEWHEEL. I also check with spy++ and I didn't receive to.
Who can't I manage the mousewheel for my custom control (MFC) like other windows control. I must had a style to the windows ?
François.
|
|
|
|
|
Nobody made control with scrollbar ?
|
|
|
|
|
I use VC7, non-MFC
with ANSI string, it's easy to use.....but with UNICODE string ...
I have only a way to declare a string:
WCHAR szEnglish[]={'h','e','l','l','o',0x0};
WCHAR szVietNamese[]={0x1ED6,0x1ED7,0x1ED8,0x1ED9,0x0};
When I write
WCHAR wbuffer[100];
lstrcpyW(wbuffer,"\x1ED6\x1ED7\x1ED8\x1ED9");
so a error messagebox occurs: "...too big for character..."
but if I write
WCHAR wbuffer[100];
wbuffer[0]=0x1ED6;
wbuffer[1]=0x1ED7;
wbuffer[2]=0x1ED8;
wbuffer[3]=0x1ED9;
wbuffer[4]=0x0;
it's okay. why so
Can I store UNICODE string in resource?
Can you show me a another way to declare a UNICODE string?
thanks!
|
|
|
|
|
Try L"\x1ed6"
The L prefix notifies the compiler it is a wide character string.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
Excellent result
thank you so much
|
|
|
|
|
If you precede a string literal with L, it becomes a wide character string.
E.g.
const char* pszAnsiString = "blah";
const wchar_t* pszWideString = L"blah";
Dave
http://www.cloudsofheaven.org
|
|
|
|
|
Dave Bryant wrote:
const char* pszAnsiString = "blah";
const wchar_t* pszWideString = L"blah";
or use the _T("xxx") format and the TCHAR type if you need to also build in non-unicode.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
Hi,
i'am currently working on a DSL Traffic-monitor but faceing the problem that i
can't differentiate networktraffic from internettraffic, has anyone a clue
how to do that without using a packet driver ?
Currently i get the troughput from the various sources windows supplies for
there different windows versions, but its always the total traffic for a
specific adapter, and i can't relate them to network-or internettraffic
Thank you
Mario
|
|
|
|
|
How do I show changes in the image contrast ?
|
|
|
|
|
Is there some code or component to burn a CD programatically?
I have some data and have to save a CD from my system? Is there a way for doing this?
Thanks,
Mariano
Paranoico? yo???
|
|
|
|
|
Yes, in Windows XP you can use the IMAPI API, which is in fact an easy to use set of COM components.
If you need a generic solution, you can use Nero's APIs.
It's not the fall that kills you: it's the sudden stop - Down by Law, Jim Jamursch (1986)
|
|
|
|
|
Hi
i am trying to hide a group of radio buttons, and then display
them again, once a certain action has been performed
im trying to use a control variable assigned to the first radio button
in the group and then display it with ShowWindow(SW_SHOW), but this will only
work for the first radio button in the group, and the rest
stay hidden
i cant add control varibles to the rest of the radio buttons
and i dont know how to activate them,
Please Help
Simon
Simon
|
|
|
|
|
You need to handle them individually to show and hide them.
and add a variable for each control ( and the associated DDX_Control ).
Another way would be to put the radio buttons in a CWnd parent, and show/hide the parent CWnd.
Max.
Maximilien Lincourt
For success one must aquire one's self
|
|
|
|
|
If you have them in a dialog then you can use GetDlgItem(IDC_RADIOBUTTON)->ShowWindow(SW_SHOW/SW_HIDE) rather than having a control variable attached to them. Works for me!
My world tour
What I do now..
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Help! I'm having real problems getting this to work. I've tried the customdial sample which somebody kindly found for me yesterday, but it doesn't seem to work right. Has anyone got a Custom Dialler working properly who could spend a few minutes with me helping me iron out the problems? (mark@otway.com).
________________________
http://www.webreaper.net
|
|
|
|
|
Hello,
INTRODUCTION:
I've installed the SAPI SDK 5.1 and even the .msm file that comes with it in order to make the programmer able to use the international phonemes. (SpPhones.msm in http://www.microsoft.com/downloads/details.aspx?FamilyId=EFE95801-96DB-4B29-A3F4-E902BC1D4999&displaylang=en[^]).
What I would like to be able to do is to use the international phonemes and not the english ones...
QUESTION:
How do I choose them in order to be able to speak them?
NOTE:
I use the phonemes by using the code below:
<code>hr = cpVoice->Speak(L"<pron sym=\"h eh 1 l ow & w er 1 l d\"/>",0,NULL);</code>
This works great, but only in english (of course because the phonemes used are the
english ones and are not enough to pronounce all the sounds of my language...)
(you can find the complete list of phonemes in the same Microsoft article that is
linked at the top of the question). Thank you in advance.
|
|
|
|
|
Hello everyone, Ok im having alot of trouble with pointers here im trying to get my head around them but it just aint working! Im trying to create a program that will load a txt file into a buffer and then count how many characters are in the text file as well as lines and words the problem is it doesnt count the characters i can get it to count the lines and words but not individual characters. The code looks like this:
#include
#include
#define BUFSIZE 1024
#define NCHARS 256
int getfile(char *fname, char *buffer, int buflen);
void countchars(char *buffer, int *count);
int Nlines(char *buffer);
int Nchars(char *buffer);
int Nwords(char *buffer);
void main(void)
{
char fname[100];
char buffer[BUFSIZE];
int cdata[NCHARS];
int i,N;
char c;
printf("EL1113 assignment 2, 2002/3.");
printf("\nText file analysis program.");
printf("\n\nEnter the file name: ");
scanf("%s",fname);
if (getfile(fname,buffer,BUFSIZE))
{
printf("\n%s contains ",fname);
printf("%d characters and ",Nchars(buffer));
printf("%d words in ",Nwords(buffer));
printf("%d lines.\n",Nlines(buffer));
countchars(buffer,cdata);
printf("\nDistribution of letters in %s is:",fname);
for (c='A';c<='Z';c++)
{
N=cdata[c]+cdata[tolower(c)];
printf("\n'%c' %4d: ",c,N);
for (i=0;i {
putchar(c);
}
}
printf("\n");
}
}
int getfile(char *fname, char *buffer, int buflen)
{
int i;
int ch;
int nchars = 0;
FILE *ipfile;
/*clear buffer*/
for (i=0;i {
buffer[i]='\0';
}
/*read from file into buffer*/
ipfile=fopen(fname,"r"); /*This code basically opens a*/
/*specified text file in read mode and*/
/*assigns it to the pointer ipfile*/
/*giving it the variable name fname*/
if (ipfile==NULL)
{
fprintf(stderr,"\nFile %s not found.",fname);
return 0; /*The fprintf statement acts just like*/
/*the printf statement*/
}
else
{
do
{
ch=fgetc(ipfile); /*collecting a character from the*/
/*ipfile pointer that holds the*/
/*destination for the imported file*/
/*EOF=End Of File*/
if (ch!=EOF)
{
buffer[nchars]=ch;
nchars++;
if (nchars==buflen)
{
fprintf(stderr,"\nFile %s ",fname);
fprintf(stderr,"too large for buffer.");
fprintf(stderr,"\nRead first %d ",buflen);
fprintf(stderr,"characters from %s.",fname);
}
}
}
while ((ch!=EOF)&&(nchars
fclose(ipfile); /*The fclose statement simply closes the file*/
/*that you are working on when it is no longer needed*/
return 1;
}
}
/**********************************************/
/*THIS IS TH PART THAT DOESNT WORK*************/
/**********************************************/
void countchars(char *buffer, int *count)
/*
*Counts the number of characters in the text file */
{
int num;
int arrletters['z'-'a'];
num = 0;
for(int i =0; i<('z'-'a');i++)
{
arrletters[num]=0;
}
if(buffer[num] >='A' && buffer[num]<='Z')
{
arrletters[buffer[num]-'A']++;
}
if(buffer[num] >= 'a' && buffer[num] <='z')
{
arrletters[buffer[num]-'a']++;
}
count++;
}
/*****************************************************/
/*****************************************************/
int Nchars(char *buffer)
{
int i,count; /*initiate variables */
do /*begin do while loop*/
{
i++; /*start incrementation*/
if(buffer[i]) /*access buffer array at position i*/
{
count++; /*Increment count*/
}
}while(buffer[i]!=EOF); /*check to make sure not at end of file*/
return count; /*return count value to main programme*/
}
int Nwords(char *buffer)
{
int i, NWCounter; /*Initiate variables*/
NWCounter=1; /*Set counter*/
do /* begin do while loop*/
{
i++; /*Begin increment*/
if((buffer[i]== ' ')||(buffer[i]=='\n')) /*Check to see if the*/
{ /*character in the buffer is a space or*/
/*the end of a line*/
NWCounter++; /*increment counter if it is*/
}
}while(buffer[i]!=EOF); /*check for end of file*/
return NWCounter; /*return results*/
}
int Nlines(char *buffer)
{
int i, NLCounter; /*set variables*/
NLCounter=1; /*set counter*/
do
{
i++; /*increment variable
if(buffer[i]=='\n') /*check buffer position for end of line*/
{
NLCounter++; /*increment if end of line found*/
}
}while(buffer[i]!=EOF); /*check for end of line*/
return NLCounter; /*return value*/
}
Any suggestions would be great thanks.
|
|
|
|
|
I really don't have the time to go through your code right now. But if it were my project I would simply put the contents of your text file in a CString variable and use the CString::GetLength() fn to get the character count and use the CString::Find(..) fn in a loop counting the spaces to get the word count.
Art
|
|
|
|
|
Hey Lads
I'm using SHFileOperation to remove a directory.. code below. Not sure if I'm using it correctly. Just trying to completely remove a directory and all the contents.
SHFILEOPSTRUCT FileOp = {0};
FileOp.hwnd = m_hWnd;
FileOp.wFunc = FO_DELETE;
FileOp.pFrom = "d:\\test";
SHFileOperation(&FileOp);
It isn't working.. any ideas?
So.. Please save me from my own stupidity...
Regards,
Brian Dela
|
|
|
|
|
What error do you get?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
None.. Just doesn't work... as far as I know it should work.. At one stage I got a "Cannot read form the source file or disk". I haven't got that error since but it still doesn't work.
Regards,
Brian Dela
|
|
|
|
|
Hi!
Does anyone know the way to be notified when the content of a Html Edit Control (CHtmlEditCtrl) has been modified. I want this because I would prevent the user from changing some parts of the content (for example deleting a cell from a table, ...).
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|