|
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
|
|
|
|
|
I know how to do this with a RichEdit control (use the SetEventMask member function).... But I don't know to do the same with an HtmlEdit control !!!!
Could anyone help me?
Thks in advance!
Appstmd
http://www.appstmd.com
|
|
|
|
|
In an MFC application,
I use dialog window in which user give infotmations i store as variable member in the class of the dialog window.
How can I use this variable in an other window ( in the classView for exemple)
It seems that the #include "dialogs.h" is not sufficient
|
|
|
|
|
If it's a private member (I always use private variable members), you have to write a public function that returns the value:
For example if the variable is an int (says int Value) (place it in your header file):
public:<br />
int GetValue() { return Value; }<br />
<br />
private:<br />
int Value;
You can then get your Value in the calling class by calling this function!
Hope this helps
|
|
|
|
|
In the code below packet_handler function is not the member of the
class I want to display the data generating from this function to be displayed on the list box. But handle to the list box is not there as is not the member of the class.
Is there any way I can get handle of listbox into the function p_h
below.
It is important the funtion declaration of "paket_handler" is defined in the library file so the return type or parameter cannot change.
//defined in winpcap library
void sniff::OnButton1() {
pcap_loop(adhandle, 0, packet_handler, NULL);//call to the call back //packet_handler function
}
void packet_handler(u_char *param, const struct pcap_pkthdr *header, const u_char *pkt_data)
{
ih = (ip_header *) (pkt_data + 14); //length of ethernet header
ip_len = (ih->ver_ihl & 0xf) * 4;
......//more code
......
/* print ip addresses and udp ports */
printf("%d.%d.%d.%d -> %d.%d.%d.%d\n",
ih->saddr.byte1,ih->saddr.byte2,ih->saddr.byte3,ih->saddr.byte4,
ih->daddr.byte1,ih->daddr.byte2,ih->daddr.byte3,ih->daddr.byte4);
}
Reply me soon
|
|
|
|
|
I've got some threads I've created ... mm nice
In the thread function should I ExitThread or should I just return?
If I ExitThread, what should I specify for the value if everything is fine?
hThread = CreateThread(
NULL, // no security attributes
0, // 0 = use default stack size
CopyFileFunction, // thread function
this, // argument to thread function
0, // use default creation flags
&dwThreadId); // returns the thread identifier
//
//.............
//
DWORD WINAPI CopyFileFunction(LPVOID lpParam)
{
ExitThread(1);
return 0;
)
|
|
|
|
|
you don't have to call ExitThread() explicitly, but if you use C-runtime functions inside the thread function, you should use _beginthreadex() instead of CreateThread() (otherwise some stack data for certain methods won't be initialized and you might have memory leaks)
|
|
|
|
|
Hi,
I utilize Visual C++ 6.0.
I have develop an application with menus and dialogs in SDI.
I want to transfert it to a MDI application.
There is a way to keep my dialogs and menus and transfer it to the MDI
project ?
Thanks,
Claude
|
|
|
|
|
Hi all,
I'm creating a small application that uses DAO (I know, it's old-fashioned!).
I need to store in a field a text with more than 255 characters. So far I have used:
dbTable.CreateField("Error",dbText,255);
with success, but with the 255 limitation. I tried:
dbTable.CreateField("Error",dbMemo,2048);
but it's still 255-limited.
How can I create a field for a long text?
I'd appreciate any ideas.
Thanks a lot.
-- narada
|
|
|
|
|
Hi,
first of all memo fields do have an initial length of zero.
Then check your UpdateData function, if there is a length restriction.
This can be done by explicitly setting the text length of the control or by DDV_MaxChar(....).
G. Steudtel
|
|
|
|