|
Are the listening threads on the same port, or different ports?
|
|
|
|
|
|
What I/O model does the server utilize? You mentioned a non-blocking I/O, but which one?
In general, a design where each client corresponds to a unique workter thread on the server-side is overkill.
Kuphryn
|
|
|
|
|
|
Correct.
I was referring to the I/O model that the client/server utilizes such as WSAAsyncSelect, WSAEventSelect, Overlapped Model, and Completion Port Model.
Kuphryn
|
|
|
|
|
oh (sorry it took so long to get back to you but i was in NZ for me dad's birthday)
well
i'm not using any of the above (that i'm aware of), just using what i believe is standard berkley style sockets operations
cheers
Bryce
---
Publitor, making Pubmed easy.
http://www.sohocode.com/publitor
|
|
|
|
|
I'm programming an application that can grab a frame from a video. DirectShow can help me to realize this function. 2 days ago I found an article named Extracting Bitmaps From Movies Using DirectShow (Written by Markus Axelsson) and downloaded its source code for reference, and then some problems accured. The source code could be built successfully in the environment of VC 6.0 and DirectX 9.0b, but could not execute properly. The application could not grab a frame from a MPEG file at all. In order to find the reason, I made test. Firstly, I ran the program in another computer, and its DirectX version was the same as my own computer's. The result was failure. Then I ran the program in a computer which DirectX version was 8.1, and I found surprisedly that a frame did have been extracted successfully from the MPEG file. The following test was to run the program in the environment of DirectX 6.4. The result was still failure. So my conclusion is that the program is only compatible with DirectX 8. The following code fragment is extracted from that source code I've downloaded. Through debug, I find the sentence "pMediaControl->Run()" will be wrong in DirectX 9. The return value of the function Run() is not 0 but 1. So my questions are:
Why does the error occur?
How to resolve the error?
>> Appendix 1:
The code fragment--
// Create graph builder
CComPtr<igraphbuilder> pGraphBuilder;
HRESULT hr = ::CoCreateInstance(CLSID_FilterGraph, NULL,
CLSCTX_INPROC_SERVER, IID_IGraphBuilder,
(void**)&pGraphBuilder);
if (FAILED(hr)) return hr;
ASSERT(pGraphBuilder != NULL);
// Create Grabber filter
CComPtr<ibasefilter> pGrabberBaseFilter;
CComPtr<isamplegrabber> pSampleGrabber;
AM_MEDIA_TYPE mt;
hr = ::CoCreateInstance(CLSID_SampleGrabber, NULL,
CLSCTX_INPROC_SERVER, IID_IBaseFilter,
(LPVOID *)&pGrabberBaseFilter);
if (FAILED(hr)) return hr;
pGrabberBaseFilter->QueryInterface(IID_ISampleGrabber,
(void**)&pSampleGrabber);
if (pSampleGrabber == NULL) return E_NOINTERFACE;
hr = pGraphBuilder->AddFilter(pGrabberBaseFilter,L"Grabber");
if (FAILED(hr)) return hr;
// Set media type
ZeroMemory(&mt, sizeof(AM_MEDIA_TYPE));
mt.majortype = MEDIATYPE_Video;
mt.subtype = MEDIASUBTYPE_RGB24;
mt.formattype = FORMAT_VideoInfo;
hr = pSampleGrabber->SetMediaType(&mt);
if (FAILED(hr)) return hr;
hr = pGraphBuilder->RenderFile(wFile,NULL);
if (FAILED(hr)) return hr;
CComPtr<imediacontrol> pMediaControl;
CComPtr<imediaevent> pMediaEventEx;
// QueryInterface for some basic interfaces
pGraphBuilder->QueryInterface(IID_IMediaControl,
(void **)&pMediaControl);
pGraphBuilder->QueryInterface(IID_IMediaEvent,
(void **)&pMediaEventEx);
if (pMediaControl == NULL || pMediaEventEx == NULL)
return E_NOINTERFACE;
// Set up one-shot mode.
hr = pSampleGrabber->SetBufferSamples(TRUE);
if (FAILED(hr)) return hr;
hr = pSampleGrabber->SetOneShot(TRUE);
if (FAILED(hr)) return hr;
CComQIPtr<imediaseeking> pSeek = pMediaControl;
if (pSeek == NULL)
return E_NOINTERFACE;
LONGLONG Duration;
hr = pSeek->GetDuration(&Duration);
if (FAILED(hr)) return hr;
int NumSecs = int(Duration/10000000);
REFERENCE_TIME rtStart = 1 * 10000000;
if (NumSecs < 1)
rtStart = 0;
REFERENCE_TIME rtStop = rtStart;
hr = pSeek->SetPositions(&rtStart, AM_SEEKING_AbsolutePositioning,
&rtStop, AM_SEEKING_AbsolutePositioning);
if (FAILED(hr)) return hr;
CComQIPtr<ivideowindow> pVideoWindow = pGraphBuilder;
hr = pVideoWindow->put_AutoShow(OAFALSE);
if (FAILED(hr)) return hr;
// Run the graph and wait for completion.
hr = pMediaControl->Run();
if (FAILED(hr)) return hr;
>> Appendix 2:
URL of the source article--
http://www.codeproject.com/audio/framegrabber.asp
|
|
|
|
|
Hi there
I got a message "Cannot access the ClassView information file. ClassView information will
not be available", when I open my workspace. can someone tell me why?
By the way, i also can not insert a new class.
Thanks
|
|
|
|
|
Your project's *.CLW file is readonly change that
Hope it helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
ya , thats true and it works!!! and will always work
cheers
balkrishna Talele
|
|
|
|
|
Check the propery of the *.clw file.If readonly ,it may cause the above question or u can delete *.clw file and VC6.0 will create a new *.clw file for u !
|
|
|
|
|
e.g.
int *pA = new int;
*pA = 10; //此时捕获事件?
SetAValue(10);
I don't want to overload the operator '='.
Can I do it?
or
What is the way the transaction of the database?
Best regards!
|
|
|
|
|
e.g.
int *pA = new int;
*pA = 10; //此时捕获事件?
SetAValue(10);
I don't want to overload the operator '='.
Can I do it?
Best regards
!
|
|
|
|
|
I had posted this query on COM forum, but on advise from Cata re-posting it here.
I'm quite new to VC++ programming. I need to develop an application which has independent pluggable modules (DLL ?) with the core application passing some arrays of data to the plug-ins and getting back the processed data from the plug-in. The core application should run without error even if any corresponding module (plug-in/DLL) is missing at run-time. The core application should also be able to detect any new plug-in and load it dynamically. Any changes to the plug-ins should not require the core application to be re-built.
Grateful if anyone could advise the best possible solution to the above mentioned task - use explicitly linked DLLs or use COM ? Any sample codes or articles available for this?
I'll be using VC++ 6.0. Thanks a lot in advance !
|
|
|
|
|
Keep all ur DLL's in specified Directory and enumerate all files in that directory.
Load ur DLL's at runtime via LoadLibrary and check whether it loaded successfully , if it didn't then assume it is not there and goto next DLL.
Don't use LIB files for DLL's ! otherwise if the dll is not present it will not run
you could add a special function in ur dll e.g
AreYouMine();
which can assure that the dll is urs and it is to be loaded
Hope that helps
Live as if your were to die tomorrow. Learn as if you were to live forever.
-Mahatma Gandhi
|
|
|
|
|
Thanks Monty. I'll try that. But do you think COM would be a better solution instead of explicitly linked DLLs?
Cheers and a Happy New year....
|
|
|
|
|
I posted one article on this subject Plug-in architecture for MFC using MESSAGE_MAPS[^]
If you just need function calls etc and not the message map ability, then a lot of the code should still be applicable to what you need. especially the stuff that loads in the available plug-ins etc. It should be a good start to get yourself going if you do not use the actual technique presented.
HTH
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
hi,
i'm writing a program to change the background of a window i don't own. and it almost works.
i subclass the window and intercept the WM_PAINT message, the WM_ERASEBKGND message, and the WM_DESTROY message.
when the WM_PAINT message is received we call the original WndProc with the paint message, we then create a DC and paint our background into it. Then call the WM_PRINT message to the old WndProc and ask it to draw the controls and stuff onto the DC then paint the DC in place (on screen).
we eat the WM_ERASEBKGND messages.
and when we get the WM_DESTROY message we set down.
all other messages are returned to the original process.
this basic layout seems to work but no labels or shapes are drawn (window i'm subclassing was deployed in VB but i assume it will be the same in many apps).
thanks for your help
mdb
|
|
|
|
|
Hi, I am wondering how to create a dialog box in visual c++. I saw a program once that made this very simple, I think the function was _MessageBox and then a cout statement was used to write the text for the box. Does anyone know anything about creating simple dialog boxes? Thanks.
|
|
|
|
|
This is just 1 way of creating the dialog box easily.
-Ganesh
------------------
1)With your project open, from the Insert menu, click Resource.
2)In the Insert Resource dialog box, select Dialog from the list of resource types and click OK. A default dialog box with two buttons labeled OK and Cancel opens up along with a Controls toolbar.
3)Right-click the dialog box, then click Properties on the menu. Click the pushpin on the property page to keep it open.
4)Select a ID for the box from the drop-down menu or name one yourself. select a caption name for the caption box.
5)Save your work.
Now, that you have the basic setup, you can add any # of controls from the controls box.
6) For every control added from the Control box (eg., Button, edit box, static text control) give a unique ID and a nice caption
7) create a new class which has CDialog as its base class.
8) Using Wizardbar> Add Windows Message Handler>, select the ID of the button in "Class or object to handle" menu inside the "New Windows messages to handle" box.
9) Select the appropriate message (eg.,for a button select BN_CLICKED or BN_DOUBLECLICKED) and the click "Add/Edit". say OK.
Now, your dialog box is ready with a frame. To give it life, connect each and every variable to the member variable in the function.
10) View> ClassWizard> ClassName>
select ID and click Add Variable button. In the Member variable name box, specify the variable name you use in your project. From the Variable type list box, click its type and click OK to add the member variable to the class.
You are all set now.
|
|
|
|
|
If you're using MFC, you can do this to display a message box:
AfxMessageBox (_T("Some message")); If you really want to create a dialog box, see this[^] profusely illustrated article for instructions.
/ravi
Let's put "civil" back in "civilization"
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hello,
Is it possible to get the amount of RAM on a machine in the network using an API, registery etc. ?
Thanks,
Orcun Colak
|
|
|
|
|
step 1) you should know ATL/Marshalling
step 2) if so, , build Server/Client application, this will solve your problem
or
Purchase "Beginning Atl Com Programming by George Reilly (Author") read 5th and 6th chapter, which gives you full detailed example of reading DISK space in the network using ATL/API, similarly you can build your applications
regards
Balkrishna Talele
|
|
|
|
|
The docs dont indicate what it means when NULL is passed in for the ddbltfx structure..the one place I saw where the ddbltfx str is passed in is when a colorfill is done
lpdds->Blt(@dest,
lpddsback,
&src,
DDBLT_KEYSRC | DDBLT_WAIT,
NULL);
for a fill:
lpdds->Blt(NULL,
NULL,
NULL,
DDBLT_COLORFILL | DDBLT_WAIT,
&ddbltfx);
|
|
|
|
|
Hi everyone. I am VERY new at programming and I am wondering if someone to show me step by step how to do something that I know is incredibly easy. I want to be able to run a program that I write without having to go into the actual workspace and compile and execute it. I would like to know how to just be able to click on an icon or something and have the program pop up w/o using my developer studio. Could someone help please? By the way, I use Microsoft Visual C++ 4.0 so please keep that in mind when replying. Thanks in advance!
|
|
|
|