|
Thanks Mr Toxcct. I was expecting some practical answer not bookish knowledge from google
|
|
|
|
|
then, practically, a .lib file is used when linking a dll statically in your project. it is not needed if you link dynamically, but you'll have to know the dll exported symbols to use them.
about the .exp files, I don't know much, but i never used them, and it seems that they are only generated in debug mode, so they are certainly not worth it to think to much on them
|
|
|
|
|
Hi Tom,
I have read several of your questions now, and like toxcct says, you do not seem to be willing to take the first step yourself. When you get into more advanced programming, you will learn that the first step is always the internet. Whether you choose google or MSDN or the usenet news groups is up to you, but I think you will find that to get respect from people at CP, you must show some willingness to to do some work yourself. Try google or MSDN, and come back when you have informed questions.
|
|
|
|
|
I dont know when I use of google for search about my questions finaly I arrive to Codeproject.
|
|
|
|
|
Well guys , i am transferring live video image coming from a webcam(by a server application having Media Player Encoder(9 series) to a client(application containing Media player4(active x control), but i m getting a delay aroud 5 to 7 seconds.Infact as per my requirement 1 to 2 secs delay can be dangerous. As per the configuration ,i m working with 100 Mbps LAN network.
Plz help me to reduce the dealy, if any one have some way?
if u have information regarding other way of real image transfer. plz ur views are welcome
I shall be thankful to u.
Naveen Khanna
Software Engg.
Gurgaon
|
|
|
|
|
you can not reduce delay . in windows media encoder there is always
a delay of about 5 - 15 seconds . if you are working on the
100 Mbps LAN then you can use the other third party streaming software.
I know in main concept it is 1-2 second delay
RajeshGupta
|
|
|
|
|
Thanks Mr. Gupta for your kind suggestion.
can u tell me about these third party tools(if u have info regarding any one). from where i can get it(free or paid)?
Thanks
Naveen Khanna
Software Engg.
Gurgaon
|
|
|
|
|
Media player defaults to 5000ms of preroll buffering if I remember right. In the "retail"
version of the player you can set this down to 1000ms so maybe there's an equivalent property
in the activeX control - check the Media Player SDK.
You should also set a low buffer size in the encoder profile as well - 500ms maybe?
For less than about 2 seconds overall latency, you'll need to go to lower level APIs/SDKs or use
3rd party software, as mentioned by others.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Well Mr. Mark,yes it's right that media player have 3 sec default buffering time and u can set it min 1 sec which i had set in profile settings already still latency is more than 5 to 7 secs.
can u tell me about these lower lever API's to use or any 3rd party software?
Thanks
Naveen Khanna
Software Engg.
Gurgaon
|
|
|
|
|
Naveen Khanna wrote: can u tell me about these lower lever API's
Check out the Windows Media Format SDK[^].
Combined with DirctShow, you can get pretty low latency if you dig into the settings
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
|
Yes - link your app statically to MFC and CRT.
|
|
|
|
|
Thanks for replying Hans, are you referring to the following:
C Run-time and Standard C++ Libraries
msvcm80.dll
msvcp80.dll
msvcr80.dll
Microsoft Foundation Classes
mfc80.dll
mfc80u.dll
mfcm80.dll
mfcm80u.dll
Many Thanks
Regards,
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
My Blog: ^_^
|
|
|
|
|
In Visual Studio 2005, the options to statically link to MFC is under General - under Use Of MFC, select Use MFC In A Static Library. To statically link the C runtime, under C/C++, set Runtime Library to Multi-Threaded (/MT) for the release build and Multi-Threaded Debug (/MTd) for the debug build.
Statically linking increases the size of your binary and means that if Microsoft release any security fixes, your application will have to recompiled to include the fixes, rather than picking them up directly from the updated DLL. The Visual C++ runtime updates for Visual Studio 2002 and later are distributed as side-by-side assemblies for Windows XP and later, but include publisher policy files to force applications to run on the latest installed version, unless the application opts out by specifying a specific version in its configuration file.
|
|
|
|
|
A very newbie question:
I have two classes for drawing images in windows:
<br />
<br />
class Win<br />
{<br />
public:<br />
void DrawImage(Image *img, int x, int y);<br />
void DrawPixel(int x, int y);<br />
}; <br />
<br />
class Image<br />
{<br />
private:<br />
<br />
XImage *ximage;<br />
Win *win;<br />
<br />
public:<br />
Image(Win *window, int w, int h);<br />
<br />
};<br />
The internals of the Image class depend on the properties of the window on which it is to be drawn, so the Image constructor needs to be passed a Window pointer. The code to draw an image, in the Window class, needs to be passed an Image pointer. A the moment, this doesn't compile (with G++), since the compiler doesn't know about the Image class when it reaches the prototype of the Win::DrawImage method. Swapping around the class definitions obviously doesn't help since it then doesn't know about the Win class when it reaches the constructor of Image.
One solution is to make the image drawing a method of the Image class, but since drawing requires the use of a lot of private data in the Win class, I'd rather keep drawing as part of the Win class.
What is the best way of resolving this problem? I get the feeling that there is some feature of C++ that I don't know about which will tell the compiler about the Image class, and get it to accept an Image *, before it reaches the class definition.
Cheers
|
|
|
|
|
Pur those classes in separate files. Each class with one header file and one cpp file. In the header files, you can use forward declaration:
class Image;<br />
<br />
class Win<br />
{<br />
.....<br />
};
This will tell the compiler that the class Image exists and will be defined elsewhere. This works only because you are working with pointers and you don't use anything specific from the class (you just declare a pointer). This won't work if you use a class instance instead of a pointer.
Then in the cpp file of the Win class, you will need to include the header file of the Image class.
You'll need to do that for both classes.
|
|
|
|
|
Why does it work only when u use pointers?
|
|
|
|
|
it's not a matter of work, it's a matter of compilation.
the compiler won't let you compile a class or a function of even a variable declaration involving a Data Type it doesn't know.
but to let it know, a declaration (and not the full definition) is sufficient.
but if you declare without defining, the compilation will pass, but the linking will fail...
|
|
|
|
|
Because if you do something like that:
class Win<br />
{<br />
...<br />
...<br />
Image img;<br />
};
The compiler will need to know the size of the object in order to generate the Win class. Thus, the only way to know the size of the object is to know what's inside (thus, including the header file).
If you use pointers, the compiler always knows the size of a pointer and it doesn't need to know more.
|
|
|
|
|
as Cédric stated, you just have to declare the class before where it's used, and define it later (in a separate file preferably)...
|
|
|
|
|
Where does the scope of the below statement apply to?
#ifdef __cplusplus
extern "C"{
#endif
|
|
|
|
|
It says that everything between the brackets ( '{' ) will have a C linkage type. The difference between a standard C++ linkage is that in C, you don't have function overloading. The linker generates name to identify the different functions and for C, this generated name is the same as the function name. In C++, it is different: as you can have function overloading, having only the name of the function to identify it is not sufficient. The compiler will add some information (it is called name mangling) depending of the arguments of the function.
When you specify this, you force the compiler to generate the functions names as a C compiler would do. That means also that you won't be able to overload a function.
It is used mainly for DLL's: when you want to be able to load a function using GetProcAddress, the name of the function you will need to pass to GetProcAddress is the 'mangled name'. Thus, it is very difficult to use. If you specify that the function has a C linkage, the name that you will pass to the GetProcAddress function will be the function name only, which makes it far easier to use.
Hope it was clear...
|
|
|
|
|
Cedric Moonen wrote: the name of the function you will need to pass to GetProcAddress is the 'mangled name'
actually, it's the exported name, that means, the mangled name mainly, unless the DLL has a .def file with an EXPORTS block which redefines the exported symbols.
|
|
|
|
|
Yes right, I forgot about the DEF file.
|
|
|
|
|
I know the implication of it but what significance does it have over here
#ifdef __cplusplus
extern "C"{
#endif
It does not apply on any function neither does it have any group of functions. Does it mean the following expansion
__cplusplus int function(int a, int b) is equivalent to
extern "C"{ int function(int a, int b)
Am I missing something here?
|
|
|
|