16,004,761 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Dhanasundhari (Top 15 by date)
Dhanasundhari
28-Jul-11 5:37am
View
ok. sir . i will do that.
there is an any way to send the vector via socket communication in c++
Dhanasundhari
28-Jul-11 5:36am
View
The error is the memecpy_s() is a undeclared varriable..
i use both the header files (string.h and memory.h)
but it producing the same error. There is an any other method to serialize the data ..
Dhanasundhari
28-Jul-11 3:36am
View
#include "stdafx.h"
#include <memory.h>
#include <windows.h>
#include <winsock2.h>
#include <iostream.h>
#include <lm.h>
#include <vector>
#include <string>
#include <memory.h>
using namespace std;
struct ClientInformation
{
string sCliName;
int iPlatId;
int iMajor;
int iType;
int iMinor;
};
class cClient
{
private:
DWORD dwLevel;
DWORD dwPrefMaxLen;
LPSERVER_INFO_101 pBuf;
DWORD dwEntriesRead;
DWORD dwTotalEntries;
DWORD dwServerType;
LPTSTR pszDomainName;
NET_API_STATUS nStatus;
WSADATA wsaData;
DWORD dwResumeHandle;
char cszBuf[200];
SOCKET ClientSocket;
int iTemp;
string str;
public:
cClient()
{
dwLevel = 101;
dwPrefMaxLen = MAX_PREFERRED_LENGTH;
pBuf = NULL;
dwEntriesRead = 0;
dwTotalEntries = 0;
dwServerType = SV_TYPE_SERVER;
pszDomainName = NULL;
dwResumeHandle = 0;
}
void FindDomainSystem()
{
ClientInformation *StructObj;
vector <clientinformation> *myvec;
WSAStartup(MAKEWORD(2,2), &wsaData);
nStatus = NetServerEnum(NULL,dwLevel,(LPBYTE *) & pBuf,dwPrefMaxLen,
&dwEntriesRead,&dwTotalEntries,dwServerType,
NULL, &dwResumeHandle);
myvec = new vector <clientinformation>();
if(nStatus == NERR_Success)
{
cout<<"The NetServerEnumeration sucessfuly "<<"\n";
cout<<"The total entires is "<<dwEntriesRead<<"\n\n";
for(int i=1; i<= dwEntriesRead;i++)
{
memset(cszBuf,0,sizeof(cszBuf));
sprintf( cszBuf, "%S", pBuf->sv101_name );
cout<<"\nThe server name "<<cszBuf<<"\n";
StructObj->sCliName.erase();
StructObj->sCliName.append(cszBuf);
cout<<"The Platform id of the system is "<<pBuf->sv101_platform_id<<"\n";
StructObj->iPlatId = pBuf->sv101_platform_id;
cout<<"The type of system running is "<<pBuf->sv101_type<<"\n";
StructObj->iType = pBuf->sv101_type;
cout<<"The major version of the system is "<<pBuf->sv101_version_major<<"\n";
StructObj->iMajor = pBuf->sv101_version_major;
cout<<"The minor version of the system is "<<pBuf->sv101_version_minor<<"\n";
StructObj->iMinor = pBuf->sv101_version_minor;
send(ClientSocket,(char*)&StructObj,sizeof(StructObj),0);
myvec->push_back(*StructObj);
pBuf++;
}
}
else
{
cout<<"\nThe Net Enumeration producing Error\n";
}
cout<<"\n\n\n\nThe vector data\n";
display(myvec);
}
void display(vector <clientinformation> *my)
{
BYTE *pData = NULL;
if(my)
{
int i = my->size();
if(i)
{
pData = new BYTE(i*sizeof(ClientInformation));
ClientInformation *psData = (ClientInformation*)pData;
for(int i1=0;i1<i;i++)
{
="" memcpy_s(psdata[i1],sizeof(clientinformation),&my-="">at(i1),sizeof(ClientInformation)); //prodcing error in that place.. what i want to do now...
}
}
//int icount = my
}
}
};
int main(int argc, char* argv[])
{
cClient o;
o.FindDomainSystem();
return 0;
}
thats is the code i build sir.. but it producing error sir..
what i want to do now..
Dhanasundhari
28-Jul-11 3:31am
View
ok.. Thanks sir..
Dhanasundhari
28-Jul-11 3:06am
View
How to de-serialize that sir. in my client side
Dhanasundhari
27-Jul-11 5:38am
View
not fully sir..
any way i will try .
Dhanasundhari
27-Jul-11 4:25am
View
sir. i using the c language sir..
Dhanasundhari
27-Jul-11 1:47am
View
sir.. thanks for the comments sir..
i found the error and find the solution sir.
Thanks sir.
Dhanasundhari
27-Jul-11 1:46am
View
Thanks sir.. lot..
Dhanasundhari
22-Jul-11 5:28am
View
i got it.. thanks
Dhanasundhari
22-Jul-11 3:14am
View
now i repost my code sir
Dhanasundhari
19-Jul-11 9:03am
View
sir,, it will execute only the parameter constructor ...
i want execute the default constructor too..
what i want to do..
Dhanasundhari
11-Jul-11 2:43am
View
no.. its not working...
producing error sir
Dhanasundhari
8-Jul-11 11:07am
View
ok sir,, i will try as you said
Dhanasundhari
8-Jul-11 10:02am
View
Deleted
Show More