|
Hi,
I had found many samples in socket programming. But all it deal with
simple text transfer between sockets. But I have to send CStringArray from server
to client. Anybody can help me?
Thanks in Advance
|
|
|
|
|
In the socket layer everything is considered as a stream of bytes.
Whatever you want to send or receive through sockets has to be converted to a stream of bytes.
Socket do not understand objects, don't differentiate between ASCII, UNICODE, BINARY etc.
«_Superman_»
|
|
|
|
|
|
It looks like you need more help on dealing with CStringArray s than with sockets.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hello,
I am new to this forum so please point me in the right direction if I am posting incorrectly.
I have an application that uses Video For Windows for capturing Webcam images. I have only found two ways to get to the image. One is to save a DIB to a file and the other is to save a DIB to the clipboard. Saving to the clipboard seems to work ok. I was able to test by pasting it in MS Paint.
Below are the essential lines of source. I have removed the error checking for clarity. I have verified that hDIB is nonzero. I have been reading for way too many hours and not getting it.
Tom Hubin
thubin@earthlink.net
capGrabFrame ( hwndVideo ) ; // snapshot one frame
capEditCopy ( hwndVideo ) ; // save DIB to clipboard
OpenClipboard(NULL) ; // open the clipboard
HANDLE hDIB = GetClipboardData(CF_DIB) ; // get handle to DIB
// todo: fetch DIB from clipboard
CloseClipboard() ; // finished with clipboard
// todo: convert DIB to 8 bit grayscale
|
|
|
|
|
I can think of a couple of posting errors (neither shooting offences!) - it's unusual to post your email, as replies to your posting get sent to you.
And secondly, what is your actual question?
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Does this article [^] help?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
The article should help but I have not yet gotten it working. However, I have learned a bit more about capGrabFrame and the capture window. So, let me try a different question.
I want to grab a 640x480 camera image and display it as 320x240 while keeping the 640x480 bitmap for image processing.
I would prefer not to use the clipboard since it is possible for some other application to alter the clipboard before I read it. Am I wrong about that assumption?
I just found capPreviewScale(hwnd,TRUE) which setup the window to automatically scale the image to fill the window.
So my only question just now is how to get to the captured bitmap.
Any suggestions on how to fetch a 640x480 capture window bitmap for image analysis without using the clipboard?
Tom Hubin
modified on Monday, February 16, 2009 7:23 PM
|
|
|
|
|
Checkbox transparency is failing giving black color on the background when my project is in UNICODE, but in NONUNICODE version it giving tranparency.
Some where i read it because of InitiCOmmonCOntrols(), how can i reslove it?
|
|
|
|
|
64 bit version of Activex control MSchart is avaliable or not?.Plz reply if anybody knows.
Thanks & Regards
VIJITH VIJAYAN
|
|
|
|
|
As an alternative (I have no idea if a 64 bits version is available), you can have a look at my sig. I developped a charting control and it could maybe be a replacement for the MSChart.
|
|
|
|
|
Is it existing in your system? (HKEY_LOCAL_MACHINE\SOFTWARE\Classes\MSGraph.Chart)
If it's there you can surely use
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
hi,
i am connecting the server PC. and running some long duration application. but it get disconnect if PC is idle for more than 2 minutes. i have to write some script so that mouse get click after every 1 minute.
waiting for any suggestion, help or any example.
Thanks
"We can't solve problems by using the same kind of thinking we used when we created them"
|
|
|
|
|
Check out the SendInput Windows API.
«_Superman_»
|
|
|
|
|
Could you plz elaborate it more??
"We can't solve problems by using the same kind of thinking we used when we created them"
|
|
|
|
|
Create an application with a timer whose duration is 1 Minute.
In the timer routine, call SendInput with a left button down message.
«_Superman_»
|
|
|
|
|
Mmmm - that really isn't safe, randomly clicking the mouse every minute.
What's the root cause of the disconnection?
|
|
|
|
|
actually it needs some hardware interrupt. if i click any where on remote EM screen or higlight the remote EM window , it remains active session otherwise connection gets lost.
can i do like this, just to highlight that window, by command prompt coding.. etc
"We can't solve problems by using the same kind of thinking we used when we created them"
|
|
|
|
|
- Can you define what you mean by 'connection'
- What does 'EM' mean?
|
|
|
|
|
ok, i am not making you understand...
..once more...
i am connecting server remotely. and running a long duration application on it...now from my local pc, if i don't highlight or run any hardware interrupt on that remote pc, session get disabled. so i want to run such a script, so that..i can highlight that remote PC window after every 1 minute....
"We can't solve problems by using the same kind of thinking we used when we created them"
|
|
|
|
|
I'd try something like getting the window handle with FindWindow and then activating the window every minute.
|
|
|
|
|
I think this[^] article is helpful for you.
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hello,
#include "speex/speex.h"
#include <stdio.h>
#define FRAME_SIZE 160
int main(int argc, char **argv)
{
char *inFile;
FILE *fin;
short in[FRAME_SIZE];
float input[FRAME_SIZE];
char cbits[200];
int nbBytes;
void *state;
SpeexBits bits;
int i, tmp;
state = speex_encoder_init(&speex_nb_mode);
tmp=8;
speex_encoder_ctl(state, SPEEX_SET_QUALITY, &tmp);
inFile = argv[1];
fin = fopen(inFile, "r");
speex_bits_init(&bits);
while (1)
{
fread(in, sizeof(short), FRAME_SIZE, fin);
if (feof(fin))
break;
for (i=0;i<frame_size;i++)>
input[i]=in[i];
speex_bits_reset(&bits);
speex_encode(state, input, &bits);
nbBytes = speex_bits_write(&bits, cbits, 200);
fwrite(&nbBytes, sizeof(int), 1, stdout);
fwrite(cbits, 1, nbBytes, stdout);
}
speex_encoder_destroy(state);
speex_bits_destroy(&bits);
fclose(fin);
return 0;
}</stdio.h>
This libs are include
Libs: libspeex.lib und libspeexdsp.lib
But my Compiler Say:
H:\speex\main.cpp|21|undefined reference to `speex_nb_mode'|
What is the mistake?
|
|
|
|
|
Your variable speex_nb_mode is never defined. You first have to define a variable before being able to use it (for instance you are passing its address to the speex_encoder_init function and the variable doesn't even exist).
|
|
|
|
|
you have to add libspeex.lib libspeexdsp.lib into the project setting ->link->object/library modules blank
a beginner
|
|
|
|