|
Dear All,
I need to find frequently that whether remote host is on or off.
How can i do this ?
Thanks.
|
|
|
|
|
Sakthiu wrote: I need to find frequently that whether remote host is on or off.
try to connect to the remote host and look for returned Header!, i.e. if it is Websever it will return some webpage, header etc
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and you
|
|
|
|
|
|
amitmistry_petlad wrote: Re: File sie in win32
WIN32_FIND_DATA wfd;
HANDLE hFile = FindFirstFile("C:\\MyFile.txt",&wfd);
int fileSize=0;
fileSize=(wfd.nFileSizeHigh*(MAXDWORD+1))+wfd.nFileSizeLow;
// fileSize contains the size of the file in bytes.
I haven't tested the code, so it may have some limitations
I hope this helps you...
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
A file size is a 64-bit unsigned integer, so your calculation for fileSize will overflow if nFileSizeHigh > 0.
|
|
|
|
|
Try this
WIN32_FILE_ATTRIBUTE_DATA m_lpFindData;
GetFileAttributesEx("C:\\123.pdf",GetFileExInfoStandard,&m_lpFindData);
DWORD dwSize =(m_lpFindData.nFileSizeHigh*(MAXDWORD+1)) +m_lpFindData.nFileSizeLow;
</code>
|
|
|
|
|
Borrowing from WhiteSky's response, but without overflow ...
WIN32_FILE_ATTRIBUTE_DATA m_lpFindData;
GetFileAttributesEx(_T("C:\\123.pdf"),GetFileExInfoStandard,&m_lpFindData);
DWORD64 qwSize = ((DWORD64)m_lpFindData.nFileSizeHigh << 32) + m_lpFindData.nFileSizeLow;
|
|
|
|
|
Hello, I have downloaded this LLMozLib (it allows easy embedding of the Mozilla Gecko HTML layout engine)
but when I tried to compile one of the test apps I got these linker errors:
llmozlib.lib(llmozlib.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)<br />
llmozlib.lib(llembeddedbrowser.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)<br />
llmozlib.lib(llembeddedbrowserwindow.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xran(void)const " (?_Xran@_String_base@std@@QBEXXZ)<br />
llmozlib.lib(llmozlib.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)<br />
llmozlib.lib(llembeddedbrowser.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)<br />
llmozlib.lib(llembeddedbrowserwindow.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::_String_base::_Xlen(void)const " (?_Xlen@_String_base@std@@QBEXXZ)<br />
llmozlib.lib(llmozlib.obj) : error LNK2001: unresolved external symbol "public: void __thiscall std::ios_base::_Addstd(void)" (?_Addstd@ios_base@std@@QAEXXZ)
The _String_base is defined in the following way:
class _CRTIMP2_PURE _String_base
: public _Container_base
{
public:
_MRTIMP2_NPURE_NCEEPURE static void __CLRCALL_PURE_OR_CDECL _Xlen();
****
Now I found this thread that shows the identical problem and it is suggested that the calling conventions
of the definition and the lib don't match, but the solution (to change __CLRCALL_PURE_OR_CDECL to __cdecl) doesn't work.
I have tried everything to resolve them, but it's no good (god, how I hate linker errors).
I hope one of you guys can shed some light on this.
Thank you.
#edit-> Oh, and I'm using vs8.
|
|
|
|
|
hello,
the aim of my program is to move a 50x50 pixel (pic_a) immage over a 500x500 pixel (pic_b) image by moving the mouse over the big image.
also, i have to copy a part of pic_b to produce pic_a and change to rgb color into a grayscale for pic_a. In the end the grayscaled pic_a
has to move over pic_b while exactly matching in content. i know it is hard to explain but i just hope that anybody can give me an idea how to
make a copy, save this and put it into the front. i am using c++ and opengl and think i need several buffers and switch them while moving???
thanks in advance,
patrick
|
|
|
|
|
Hi,
I am new at directshow, I am coding in Visual C++ .NET but with MFC. I need to take images which are being stored in memory on the fly and put them into a movie file. The images are being streamed into memory and their is no source filter that allows me to take DIB's stored in memory and put into directshow, unless I missed something.
Do I have to write a source filter that takes images from memory and put it into the directshow pipeline? I am a little lost here, if anyone knows how this can be done it would be greatly appreciated. Also some sample code of doing this would be greatly appreciated.
Thanks
|
|
|
|
|
If you want to write your own source filter then the Push Source Filters Sample[^] in the DirectShow
SDK is a good place to start. Very little code needs to be modified.
|
|
|
|
|
Hi,
Thanks for the quick response, so do I create a Win32 Static Library Project and then inherit the CSourceStream class, like CPushSource has.
once again thanks for the response.
|
|
|
|
|
|
Thanks Mark,
In Visual C++ .NET is that a ATL Project? I cant find where to make ax the output.
Thanks for your help
|
|
|
|
|
In the project's Linker settings - output file. Change the extension of the output file to ax.
I don't think this is required - it's just convention (I can't remember off hand )
Remember to change the GUID(s) in the sample code to your own new ones so your filter is unique!
When you have it built you can use the regsvr32 utility to register the com object. Then it will
show up in the list in GRAPHEDIT and your graph builders will be able to find it using your
GUID.
*edit* Note you only have to re-register it if you move it to a different folder.
|
|
|
|
|
so I create a Win32 DLL Project with no MFC support, and then I change the output to ax file?
Did I get that right?
Once again thanks for all the help.
|
|
|
|
|
Yes
|
|
|
|
|
Thanks for all the help.
A win32 DLL Project doesnt come with all the necessary files such as the def file, after fooling around I see that the MFC DLL Project does come with def file, am I correct in using that as the project, or have I gone crazy
and I cant see the def file in the Win32 DLL Porject.
|
|
|
|
|
There should be one with the sample code. If not here's the contents of one of my source filter
project def files:
LIBRARY MyDirectShowSource.ax
EXPORTS
DllMain PRIVATE
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
I just checked the sample code - mine is identical except for the LIBRARY name (which makes sense
because I started with the pushsource sample).
I also noticed the sample code doesn't come with a solution or project file for VS. You can
copy the files from the sample folders to your own project folder, rename any you want renamed,
and buld a project for them without problem though. You've already built an empty DLL project so
you should just have to copy the files and add them to your project (including the def file).
They should be built Unicode as well.
|
|
|
|
|
Thanks,
Will have a go at that and see if I can get it to work.
Thanks for all the input.
|
|
|
|
|
I created an empty project, I added all the PushSource Files, but now I am getting these linking errors.
Strmbasd.lib(wxutil.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: int __thiscall CAMMsgEvent::WaitMsg(unsigned long)" (?WaitMsg@CAMMsgEvent@@QAEHK@Z)
Strmbasd.lib(wxdebug.obj) : error LNK2019: unresolved external symbol __imp__timeGetTime@0 referenced in function "public: __thiscall CDisp::CDisp(__int64,int)" (??0CDisp@@QAE@_JH@Z)
Strmbasd.lib(wxutil.obj) : error LNK2019: unresolved external symbol __imp__timeSetEvent@20 referenced in function "unsigned int __cdecl CompatibleTimeSetEvent(unsigned int,unsigned int,void
(__stdcall*)(unsigned int,unsigned int,unsigned long,unsigned long,unsigned long),unsigned long,unsigned int)" (?CompatibleTimeSetEvent@@YAIIIP6GXIIKKK@ZKI@Z)
Debug/TestSource.ax : fatal error LNK1120: 2 unresolved externals
Does anyone know why this is happeneing
|
|
|
|
|
Have you built the filter base class library as outlined here[^]?
Once you build the lib(s) then add the appropriate (debug or non-debug) lib file to your project.
Mark
|
|
|
|
|
Hi Mark,
I am getting some serious linking errors, I followed the webpage you sent me, and I am getting linking errors.
I have put my project files up at http://www.ece.ubc.ca/~npatel/MemorySource.zip
It is the project file that I have copied Push Source into. It uses Visual C++ 2003 .NET
What am I doing wrong?
|
|
|
|
|
godspeed123 wrote: I am getting some serious linking errors
You are just missing atlsd.lib
Don't forget to change the "Filter name strings" in pushsource.h and generate your own GUIDs
to replace the ones in PushGuids.h
For your version you probably won't need any of the Dib stuff either since you already have a
source of video frames. But I'm getting ahead of yourself When this builds I would recommend
testing it out in graphedit - make sure it works like the sample is supposed to THEN alter
it for your needs
Mark
|
|
|
|
|
I tried adding atlsd.lib, still the same unresolved external symbols
There are the linking errors
Linking...
Creating library Debug/MemorySource.lib and object Debug/MemorySource.exp
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "public: __thiscall CSourceStream::CSourceStream(unsigned short *,long *,class CSource *,unsigned short const *)" (??0CSourceStream@@QAE@PAGPAJPAVCSource@@PBG@Z) referenced in function "public: __thiscall CPushPinDesktop::CPushPinDesktop(long *,class CSource *)" (??0CPushPinDesktop@@QAE@PAJPAVCSource@@@Z)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "public: __thiscall CSourceStream::CSourceStream(unsigned short *,long *,class CSource *,unsigned short const *)" (??0CSourceStream@@QAE@PAGPAJPAVCSource@@PBG@Z)
PushSourceBitmapSet.obj : error LNK2019: unresolved external symbol "public: __thiscall CSourceStream::CSourceStream(unsigned short *,long *,class CSource *,unsigned short const *)" (??0CSourceStream@@QAE@PAGPAJPAVCSource@@PBG@Z) referenced in function "public: __thiscall CPushPinBitmapSet::CPushPinBitmapSet(long *,class CSource *)" (??0CPushPinBitmapSet@@QAE@PAJPAVCSource@@@Z)
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "void __cdecl DbgLogInfo(unsigned long,unsigned long,unsigned short const *,...)" (?DbgLogInfo@@YAXKKPBGZZ) referenced in function "public: virtual __thiscall CPushPinDesktop::~CPushPinDesktop(void)" (??1CPushPinDesktop@@UAE@XZ)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "void __cdecl DbgLogInfo(unsigned long,unsigned long,unsigned short const *,...)" (?DbgLogInfo@@YAXKKPBGZZ)
PushSourceBitmapSet.obj : error LNK2001: unresolved external symbol "void __cdecl DbgLogInfo(unsigned long,unsigned long,unsigned short const *,...)" (?DbgLogInfo@@YAXKKPBGZZ)
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z) referenced in function "public: virtual long __thiscall CPushPinDesktop::DecideBufferSize(struct IMemAllocator *,struct _AllocatorProperties *)" (?DecideBufferSize@CPushPinDesktop@@UAEJPAUIMemAllocator@@PAU_AllocatorProperties@@@Z)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z)
PushSourceBitmapSet.obj : error LNK2001: unresolved external symbol "void __stdcall DbgAssert(unsigned short const *,unsigned short const *,int)" (?DbgAssert@@YGXPBG0H@Z)
PushSourceDesktop.obj : error LNK2019: unresolved external symbol "public: __thiscall CSource::CSource(unsigned short *,struct IUnknown *,struct _GUID)" (??0CSource@@QAE@PAGPAUIUnknown@@U_GUID@@@Z) referenced in function "private: __thiscall CPushSourceDesktop::CPushSourceDesktop(struct IUnknown *,long *)" (??0CPushSourceDesktop@@AAE@PAUIUnknown@@PAJ@Z)
PushSourceBitmap.obj : error LNK2001: unresolved external symbol "public: __thiscall CSource::CSource(unsigned short *,struct IUnknown *,struct _GUID)" (??0CSource@@QAE@PAGPAUIUnknown@@U_GUID@@@Z)
PushSourceBitmapSet.obj : error LNK2001: unresolved external symbol "public: __thiscall CSource::CSource(unsigned short *,struct IUnknown *,struct _GUID)" (??0CSource@@QAE@PAGPAUIUnknown@@U_GUID@@@Z)
Debug/MemorySource.ax : fatal error LNK1120: 4 unresolved externals
|
|
|
|