|
Can u give me a little more detail on how to get it up and running.
I is hard to understand ur code.
Thank you
|
|
|
|
|
If you don't want to go with the 'virtual list' method, you can speed up
your existing list with:-
list->SetRedraw(FALSE);
... do your list population algorithm...
list->SetRedraw(TRUE);
or you could do
list->LockWindowUpdate();
... do your list population algorithm...
list->UnlockWindowUpdate();
list->Invalidate(FALSE); // not strictly necessary, but I have seen some controls
// fail to redraw correctly after this, so this will do it, use FALSE so that it
// just redraws without an erase first
Stephen Kellett
|
|
|
|
|
Hi,
We are doing a project to design a voice chat software for LAN. We are trying to do it in Visual C++. So far we have not been able to get a good start? How do we do it ? Are there any command in MFC to send sound via LAN ? If yes what are they ? Laslty would it be better to do this project in Java or Visual Basic ? Please help, Thanks.
|
|
|
|
|
hi,
Do some research on VoIP. There are some libraries available do to synchronisation and checking on lost packets. For the capturing you can use Direct Sound (there are a lot of examples with the DirectX SDK). I find the one for full-duplex the most appropriate for what you want to do.
As compression you can use windows Codecs. Real eazy, you just have to get aquainted with the way it works. I used the GSM 6.10 Codec to send over modem-internet links (only 1.6KB).
Then send and receive everything the MFC-way using async sockets.
Regards,
WimB
|
|
|
|
|
hi
where can i find the DirectX SDK. i am working on the project of voice chat over LAN. plz help me because i am not getting any help from anywhere .
WildChaser!
U r providing the best services for the students and the the people who seek help
Thanks
|
|
|
|
|
ftp.microsoft.com or http://msdn.microsoft.com/downloads/default.asp
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hi,
We are doing a project to design a chat software for voice chat. We are trying to do it in Visual C++. So far we have not been able to get a start? How do we do it ? Are there any command in MFC to send sound via LAN ? If yes what are they ? Laslty would it be better to do this project in Java or Visual Basic ? Please help, Thanks.
|
|
|
|
|
How can I change the text color in a console-based program? Is there a 'textcolor' function like in DOS?
Thanks!
|
|
|
|
|
There are lots of great things you can do with the console api.
First you get a handle to the console:
hConsole = GetStdHandle(STD_OUTPUT_HANDLE);
This may be 0 - as long as its not INVALID_HANDLE_VALUE you're ok. Note - you'll need to #include <windows.h>
Now you can set colors. This sets white text on a red background:
SetConsoleTextAttribute(hConsole, FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE | BACKGROUND_RED);
I tested with printf, and assume cout is ok. You might like to investigate the fns like WriteConsole etc. Search for "Console functions" in the msdn. There is stuff for positioning too.
BTW I copied my own previous message on this Search this forum for 'console' for more stuff on consoles. What a great site!
|
|
|
|
|
I want to code a program which generates all possible
combinations of characters with a flexible length and
store this characters in a file.
The second part is no problem (Put the characters in a file)
but how must the algorithm look like to generates this characters ???
I mean how can I code the following scenario...
Ok lets say a want to generate words with a length up to 3 characters !!!
So the output should look like this...
a
b
c
.
.
.
z
.
.
.
a a
a b
a c
a d
.
.
.
b a
b b
b c
.
.
.
till z z z
OK ....
My first very simple idea was to make 3 for - loops
int z1,z2,z3;
for (z1=1;z1<256;z1++)
{
for (z2=1;z2<256;z2++)
{
for (z3=1;z3<256;z3++)
{
printf(" %c, %c , %c",z1,z2,z3);
}
}
}
This should work fine... but I've got no chance to make it flexible...
I mean this works only with 3 characters at run-time !!!
But I want to make an input at the beginning where you can tell how many characters
you want... in this case you can't work with for - loops ?!?!?
Did anyone of you know how this problem can be solved ???
Malcomx
|
|
|
|
|
Why not just write a routine that adds a char to the end of a string passed to it, then you'd just need to do something like this:
string s;
for (int i = 0; i< iNumOfChars; i++)
AddChar(s);
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
Ooops - just thought that through. I suspect you may need to do something recursive that adds the strings to an array or prints them as it goes.
Christian
The content of this post is not necessarily the opinion of my yadda yadda yadda.
To understand recursion, we must first understand recursion.
|
|
|
|
|
I would like to use the IPAddress Control as provided by Microsoft in a VB Application. In VB, unlike VC, you can't just add the control to a form, it is just not in the toolbox.
I tried to create a new (subclassed) ActiveX control but I could not get things to work.
Does anyone know how to get this to work? Or can someone explain to me, why it can't be done (if so)?
Greetings,
Patrick
|
|
|
|
|
i need to get info about the controls in a window created by some other application from my application.this works fine for integer variables li but the problem comes when accessing pointer type variables.
for e.g. using SendMessage for getting the RECT values of a track bar control does not work.any clues?
|
|
|
|
|
i need to get info about the controls in a window created by some other application from my application.this works fine for integer variables li but the problem comes when accessing pointer type variables.
for e.g. using SendMessage for getting the RECT values of a track bar control does not work.any clues?
|
|
|
|
|
i need to get info about the controls in a window created by some other application from my application.this works fine for integer variables li but the problem comes when accessing pointer type variables.
for e.g. using SendMessage for getting the RECT values of a track bar control does not work.any clues?
|
|
|
|
|
Ok, so I know it is not that difficult but I can't find the correct arguement to make
a checkbox control go invisible (essentially, just need to make some of the controls on
my dialog disappear when certain conditions are met).
I retrieved the pointer to the cbutton object cbutton* mycontrol = (cbutton*)GetDlgItem(ID_Control)
thought I could use mycontrol->setbuttonstyle( ) .....but don't know which arguements.
thanks....please email straight to lrector@netzero.net
|
|
|
|
|
You're right, it's not difficult.
mycontrol->ShowWindow( SW_HIDE );
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
|
Does anyone know if it's possible to roll my own CA and PKI for NT Workstation Security. For various reasons, I want to be able to work with signed code and SSL connections in a peer-to-peer NT Workgroup (no servers, just four workstations). I can't set up the personal web server (IIS 4.0 personal web server from the NT Option Pack) to handle https and SSL without a Verisign certificate so I would like to create and install my own CA certificate as a root trusted authority in the Trusted Computing Base.
Here's the problem: A University network allows potentially hostile users access to the local network. I want to set up four workstations as a VPN or something similar, but don't have the budget to sacrifice one computer as a server and create a domain. Thus, I would like to secure communications among the workgroup as much as possible. At the minimal level, I would like to get the computers talking to one another using https rather than http, but can't do this without spending a large fraction of my computing budget on Verisign keys.
I haven't seen anything about this anywhere in MSDN or in the magazines. Does anyone know if it's possible? If it is possible, where should I look to learn more?
He was allying himself to science, for what was science but the absence of prejudice backed by the presence of money? --- Henry James, The Golden Bowl
|
|
|
|
|
How do I get the decimal eqivalennt of a 2's complement hex number in VC++ 6.0? In other words, how can I convert FD to a -2 given that FD is a 2's compliment hex number?
Regards,
Mike Zolna
|
|
|
|
|
I'm not sure exactly what you need. A number is a number, no matter how it's stored or what base (decimal/hex) you represent it in. But if you want to go from the number 0xFD to the string "-3" (0xFD is -3, not -2) then just sprintf() it:
char szNum[16];
signed char num = (signed char) 0xFD;
sprintf( szNum, "%d", (int) num ); // cast sign-extends 0xFD to 0xFFFFFFFD
You need to use the "%d" format since that prints the value of a number. The (int) cast puts the correct number of bytes (int-sized, instead of char-sized) on the stack.
--Mike--
http://home.inreach.com/mdunn/
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
--Buffy
|
|
|
|
|
I'm assuming you have FD as text, and need to convert it. I don't think there's a built in way to do this. Some searching reveals a couple of 'hex string to value' conversion routines, one in SNA. Found HEX2INT.PRG in the docs for FoxPro 2.5 for DOS... hmmm...
Oh well, never pass up a chance to fill up a message with a nice pale orange block...
#include <iostream>
using namespace std;
long Hex2Int(char * pszHex) {
static unsigned char byteLookup[22][2] =
{ '0', 0, '1', 1, '2', 2, '3', 3, '4', 4, '5', 5, '6', 6, '7', 7,
'8', 8, '9', 9, 'A', 10,'B', 11,'C', 12,'D', 13,'E', 14,'F', 15,
'a', 10,'b', 11,'c', 12,'d', 13,'e', 14,'f', 15
};
register long total = 0;
int nPosition = 0;
if(*pszHex) {
register int len = strlen(pszHex) - 1;
while (len >= 0) {
bool bFound = false;
int i;
for (i = 0; i < sizeof(byteLookup)/2; ++i) {
if(byteLookup[i][0] == *(pszHex+len)) {
++bFound;
break;
}
}
if(!bFound) throw "Invalid hex number\n";
if(nPosition == 0) {
total = byteLookup[i][1];
}
else {
total += byteLookup[i][1] << (4 * nPosition);
}
--len;
++nPosition;
if (nPosition > 8) throw "Too many hex digits\n";
}
}
else {
throw "Empty string\n";
}
return total;
}
int main(int argc, char* argv[])
{
char s[255];
long result = -1;
while (result) {
cout << endl << "Enter a hex number please, or 0 to exit: ";
cin >> s;
try {
result = Hex2Int(s);
cout << endl << "Hex2Int returned " << dec << result << " [" << hex << result << "]" << endl;
}
catch (char * e) {
cout << e;
}
}
return 0;
}
Note that there's room for optimization here, and there's the issue (see comments) of sign extension. This Hex2Int returns 253 for FD, -3 for FFFFFFFD. But I think you need something like this to do the translation.
|
|
|
|
|
Hey Everybody,
I'm looking for a GZIP file compression library/api or something. I'm writing a vrml file export utility, and since the generated *.wrl files are inherently large, being text files, I'd like to export them in *.wrz format which requires gzip compression.
Anyone have any suggestions on gzipping a file programmatically?
Thanks,
Josh
josh@schroff.com
|
|
|
|
|
Get zlib. This is the canonical library for zipping and unzipping content. You can also look right here on CodeProject at SawZip, Zip and Unzip the MFC Way, and Self-Extracting File Framework.
He was allying himself to science, for what was science but the absence of prejudice backed by the presence of money? --- Henry James, The Golden Bowl
|
|
|
|