|
Hello all,
i have very specific question regarding winsock
"In a network of PC's, i want to find the ip addresses of all the nodes that are running my custom made windows service"
How to achieve this. Service is made in C++ using win32 api's and i m using winsock for all networking purposes
thanks
kunal s patel
|
|
|
|
|
Hi,
I dont know what is your windows service doing. But I have an idea.
You can take care of this.
The idea is that your windows service program should populate a broadcast message in your network for every time intervals. In that broadcast message you can specify your default message that includes ip address, etc.,
In your winsock program , you could receive that default message. The default message might have an IP address of the host machine.
Using this you can achive your way.
|
|
|
|
|
Thanks for the fast reply. Can any one please suggest me how to broadcast a packet in network. What care should i take in sender side and receiver side. A sample code would be of great help
thanks
kunal s patel
|
|
|
|
|
I want to control no new derivations from base class . How can i achieve it ?
I want to control to create atleast one instance to my class, then how can i achieve it ?
just i faced these questions in an Interview.
please guide me regarding this.
|
|
|
|
|
Krishnatv wrote: I want to control no new derivations from base class . How can i achieve it ?
Make the constructor of the base class private. If you inherits a class from this base class, you'll get a compile error saying that it cannot access the constructor of the base class.
Krishnatv wrote: I want to control to create atleast one instance to my class, then how can i achieve it ?
Are you sure your question is correct ? So, you want to have at least one instance of your class ? You can simply declare a static instance in the cpp file of your class but I doubt this is the answer you are looking for.
|
|
|
|
|
Are you sure your question is correct ? So, you want to have at least one instance of your class ? You can simply declare a static instance in the cpp file of your class but I doubt this is the answer you are looking for.
I dont want to allow at least one object also.( No Objects)
|
|
|
|
|
Krishnatv wrote: I want to control to create atleast one instance to my class, then how can i achieve it ?
You just want one instance of a class or more than one.(You are already allowed to create as many instances of your class as you wish)
If you say that you only want to let the user create a single instance of your class then you should use a static variable in your class. Increment that variable in the constructor if first object is being created. Now when second object would be created check for the value of the static variable to be greater than 1(or something that you work out), if affirmative just return from the contructor. This won't let the user create a second instance of your class.
You can also search for other methods here on CP for the SingletonClass.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I dont want to allow atleast one instance also.
|
|
|
|
|
Krishnatv wrote: I dont want to allow atleast one instance also.
1) So what? You can check for the value of the static variable to be zero and return from the constructor.
2) If your question pertains to objects you can also create an abstract class.You can't create an object of the abstract class. To create a abstract class just add one pure virtual function to your class definition.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Thank u so much Anshuman For ur Good clarification.
Just Now Iam understanding why C++ is this much tricky.
|
|
|
|
|
Does anybody have any experience with the squirrel scripting library? I have already posted my question on their forums but they look a little inactive.
I'm trying to pass a struct by reference to a script but I am unable to find any example of how to do this.
|
|
|
|
|
Dear All,
I need to know about that stack segment, code segments, data segment and heap.
Where can i get a good article ?
If you know kindly let me know ?
|
|
|
|
|
Sakthiu wrote: stack segment, code segments, data segment and heap.
See Here[^]
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Sakthiu wrote: Where can i get a good article ?
Have you tried Googling for one?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
|
I have inserted class through MFC Class Wizard ->Import library ->WartzODLCOM.dll.
Class = _DBAccess
Base Class = ColeDispatchDriver
And i want to call function in wartxodlcom.cpp.
How to do that.i am trying to create instance by _DBAccess dbaccess it is giving error.Why.
|
|
|
|
|
|
this are the error by just addind this line
_DBAccess dataccess;
error C2146: syntax error : missing ';' before identifier 'dataccess'
c:\myproject\wartz_new\wartz_newdlg.h(41) : error C2501: '_DBAccess' : missing storage-class or type specifiers
c:\myproject\wartz_new\wartz_newdlg.h(41) : error C2501: 'dataccess' : missing storage-class or type specifiers
wartz_newDlg.cpp
c:\myproject\wartz_new\wartz_newdlg.h(41) : error C2146: syntax error : missing ';' before identifier 'dataccess'
c:\myproject\wartz_new\wartz_newdlg.h(41) : error C2501: '_DBAccess' : missing storage-class or type specifiers
c:\myproject\wartz_new\wartz_newdlg.h(41) : error C2501: 'dataccess' : missing storage-class or type specifiers
|
|
|
|
|
Can some one suggest some C++ API or code snipper to check if a TIFF file is compressed using G4 compression.
-- modified at 0:44 Tuesday 26th September, 2006
|
|
|
|
|
Check the compression field in the header. The following values are possible:
Uncompressed 1
CCITT 1D 2
Group 3 Fax 3
Group 4 Fax 4
LZW 5
JPEG 6
PackBits 32773
Have a look at the LibTiff library.
I found the spec at http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf[^]
Alcohol. The cause of, and the solution to, all of life's problems - Homer Simpson
|
|
|
|
|
I want to create keys for my Installation of ReMeDi application which is telemedicin kit for giving treatment to patient who is at remote place.
The key should contains some logic which gives version name,mode of operation etc.
For that pls suggest me some C++ application which generate these keys automatically.
Abhijit.
|
|
|
|
|
Hi all!
I've a problem of decoding UTF-8 email. I got emails from my inbox and displayed it. But with emails which were writen by UTF-8, i couldn't decode it although i've used some functions to decode . Who can show me how to solve it.
Thank in advance!
Rgs.
RayCad
|
|
|
|
|
It's a little hard to help you without seeing the code that is giving you trouble, unless of course you want us to write the code for you???
|
|
|
|
|
Hello everyone,
I have a large number of strcture instances, the I can not have all of them in memory. So I have the idea of serialize/deserialize partial of them to/from disk. The operation I need on these structure instances is to enumerate elements one by one, and I want to provide applications which use this interface to enumerate elements be transparent to how and which parts of structure instances is written/read to/from disk -- and the application only will feel read from memory.
I am wondering whether there are any samples/tutorials to make a reference?
thanks in advance,
George
|
|
|
|
|
I don't think enumerating unknown members of a struct is possible. One thing you can do is add the Serialize and Deserialize functions directly to the struct. Both functions should take a byte array/pointer as the paramater for which the serialized data would be written to. From your cade all you need do is call the function and write the data to a file for each of your structs.
|
|
|
|