|
Did you include the file mpr.lib
you can do this as follows
project>settings>links/object/library modules and add mpr.lib in that box
Wishes.
Anshuman Dandekar
Dare to Dream,
Care to Achieve.............
|
|
|
|
|
Yes i did not include the mpr.lib , Thanks again for this help. I will test it out.
kss
|
|
|
|
|
AnShUmAn_VCPP wrote: gethostname( szHostName, strlen( szHostName ) );
This retrieves the name of the local machine only.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
You probably didnt't pass the parameters properly.
This is the height of proper values being needed to be passed in the functions.
You didn't specify what value did you pass in this function ?.
once you pass resource_globalnet as the first parameter you can get all the machine names in the network.Resoucetype_any specifies that the resource could be anything like a printer etc.
WNetOpenEnum( RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, pnr, &hEnum );
WNetEnumResource( hEnum, &count, buf, &bufsize );
Vision is important and so is ATTITUDE.
Wishes.
Anshuman Dandekar
Dare to Dream,
Care to Achieve.............
-- modified at 22:33 Monday 20th February, 2006
|
|
|
|
|
AnShUmAn_VCPP wrote:
You probably didnt't pass the parameters properly.
Sure I did.
AnShUmAn_VCPP wrote: This is the height of proper values being needed to be passed in the functions.
Not sure what this says.
AnShUmAn_VCPP wrote: You didn't specify what value did you pass in this function ?.
Huh?
AnShUmAn_VCPP wrote: once you pass resource_globalnet as the first parameter...
gethostname() only takes two arguments, neither of which is RESOURCE_GLOBALNET .
Re-read this thread to see where you got confused.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
WNetOpenEnum( RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, pnr, &hEnum );
Pass Globalnet option in this function .See my previos post to this question
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
AnShUmAn_VCPP wrote: WNetOpenEnum( RESOURCE_GLOBALNET, RESOURCETYPE_ANY, 0, pnr, &hEnum );
Pass Globalnet option in this function
I very well versed in its usage. Thanks.
AnShUmAn_VCPP wrote: See my previos post to this question
Your initial response to "fearless" is where things went awry. For some unknown reason, you suggested that gethostname() could be used "to get the Names of machines Running on a Network." I corrected you by saying that this function was only for retrieving the name of the local machine. Make sense now?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
I asked him to use WNet... Functions and populate them
I told him to pass the values to gethostbyname and change it to get the IP Address. Just check my first post to this question
Anyways its good to keep confusions away.
I will take it as a advise from you and try and make my posts more accurate
Vision is Always important and so is your ATTITUDE.
Wishes.
Anshuman Dandekar
|
|
|
|
|
Ok Lets Please stop it here guys, I got the program running and its working fine.Thanks a lot to both of you.
kss
|
|
|
|
|
AnShUmAn_VCPP wrote: I told him to pass the values to gethostbyname and change it to get the IP Address. Just check my first post to this question
Perhaps you should check out that post. You suggested gethostname() , which I indicated was to get the name of the local machine only. See the difference?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
|
|
|
|
|
HI,
I have some value in string object like
CString str = "ABC"
I want to create an array with the name that is the value in the string object, in the current exapmle it is "ABC"
so it should be
CObArray ABC;
How can I do this? That define a name of an aray that is the value got from some where.
Thanks
Regards.
|
|
|
|
|
You can't.
The best solution would be to dynamically create the array and add it to a map using the name.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Thanks,
Would you like to give me a code snipt , that how can I create and add to a map
Thanks again
Regards.
|
|
|
|
|
Find out how to use the MFC CMap<> or the STL map<>.
Use the MFC CArray<> or the STL vector<>
Eventually you will do something akin to mymap.Add(string, new CArray<>());
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Like said by Joe, you can't. But there is surely another solution to your problem. Maybe if you explain us what you want to achieve exactly, we could find a solution.
|
|
|
|
|
Hi,
Is there a Tab change (Tab click) event in CPropertySheet. Pls let me know what it is.
Thank you
Mohan
|
|
|
|
|
This method will be called when a property page is activated...
CPropertyPage::OnSetActive()
Owner drawn
Jesus Loves
|
|
|
|
|
Owner drawn wrote: CPropertyPage::OnSetActive()
Thanks, but this didn't help me. My problem is i needed to a get a value(user selects) of one property page to another property page during runtime for validation purpose.
Could you give me a idea pls
-- modified at 0:52 Monday 20th February, 2006
|
|
|
|
|
|
I have an ActiveX control (.OCX) which will be used in normal HTML page. So far so good. But, I am not able to use this from within a .NET application. When that page is loaded, an error pops up telling there was an unsafe item and was blocked from running. The following is the exact error message. "This page provides potentially unsafe information to an ActiveX Control. Your current settings prohibit running controls in this manner. As a result, this page may not display correctly."
I have tried modifying all the security settings to low, manually in IE. Doesn't work still! How do I make it a safe control so that it wont display such a warning or it will not be blocked? Any help or pointers in this direction is highly appreciated.
Regards and thanks,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
-- modified at 0:12 Monday 20th February, 2006
|
|
|
|
|
|
That's so nice of you. Can you explain me how can I do this? Or direct me to an example somewhere? I am very new to COM and ActiveX stuff please bare with me if this is an extremely stupid question.
Thanks and Regards,
Rajesh R. Subramanian
You have an apple and me too. We exchange those and We have an apple each.
You have an idea and me too. We exchange those and We have two ideas each.
|
|
|
|
|
|
Hi All,
I need to implement this,
typedef struct
{
T1 m;
T2 m;
T3 m;
........
}XX;
XX a;
....
note T1,T2,T3... has no basic class, I hope
a function can auto visit the data member one by one like this
for(int pos=0; pos< size(pos);pos++)
//size function get struct data member number
{
.......
stmt.setParam(pos, getData(pos));
//getData function get struct data member by pos
.......
}
I only want to use struct please do no tell me use vector or list
thanks a lot
i hope some one can do it although it is not easy
-- modified at 23:37 Sunday 19th February, 2006
|
|
|
|
|
Unless all the members of the structure are the same type, it's extremely difficult. At runtime, the structure is just a single block of memory; the compiler sorts out which offsets into the memory to use at compile time. If your members are all the same type, you can calculate the address of each member like this (assuming they're int s):
address = struct_addr + (pos * sizeof(int)); where struct_addr is a pointer to the structure and pos is the index of the structure member.
Why don't you want to use a vector or list? You're trying to store an array of data, so why not use an array?
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|