|
If that software emits messages in English or French, I can translate it into Romanian. Interrested?
|
|
|
|
|
Hi all, I've been reading CP for a while now but this is my first post, so I hope it makes sense!
I'm working on a project that uses a somewhat complex data structure, consisting of about 8 different classes of object all related together. The classes in the structure are getting a bit complex and I would like to break things down a bit but I'm not sure about the best way to do it. Each class has code for accessing the data it contains, displaying itself graphically, saving and loading itself from the database, and checking itself for validity. A lot of these features make strong use of the inheritance hierarchy which is why they are in the classes in the first place.
My main idea at the moment is to create multiple parallel class hierarchies, one representing the base data, one containing display code, one containing DB code, and so on. Each class in the data namespace will have a corresponding class in each of the other namespaces. I'm concerned though that, although this seems to be a better abstraction, it will be hard to do without violating encapsulation - the DB loading/saving classes will need fairly unrestriced access to the data classes. The other problem is the complexity of maintaining all these parallel hierarchies, and of course the best way to use them - do I create a full parallel object graph of database classes if I need to save the data structure, or use static methods in the database namespace to perform the DB operations?
I'm sure there's no straight answer to a question like this, but I'd be interested to know how others achieve the same thing, also if anyone could recommend some good reading on the subject I'd be grateful! Thanks
Jon Merrifield
|
|
|
|
|
i have converted the program into non MFC but it complies and runs but does not send the string.
1) Client:
include "stdafx.h"
#include iostream.h
#include conio.h
#include winsock2.h
#include process.h
#include stdio.h
UINT WINAPI SendStatus(LPVOID pParam)
{
cout<<"\n I am in the thread!!\n";
SOCKET client; //socket is uint
WSADATA wsaData; //WSADATA structure
sockaddr_in serveraddr; //sockaddr_in
int wsaret=WSAStartup(0x101,&wsaData); //Initialize wsaret variable
if(wsaret!=0)
{
cout<<"Fail to initialize:";
return 0;
}
struct hostent *hp;
unsigned int addr;
struct sockaddr_in server;
char servername [30] ="localhost";
SOCKET conn;
conn=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(conn==INVALID_SOCKET)
return 0;
if(inet_addr(servername)==INADDR_NONE)
{
hp=gethostbyname(servername);
}
else
{
addr=inet_addr(servername);
hp=gethostbyaddr((char*)&addr,sizeof(addr),AF_INET);
}
if(hp==NULL)
{
cout<<"Fail to get peer address:";
closesocket(conn);
return 0;
}
server.sin_addr.s_addr=*((unsigned long*)hp->h_addr);
server.sin_family=AF_INET;
server.sin_port=htons(20248);
if(connect(conn,(struct sockaddr*)&server,sizeof(server)))
{
cout<<"Fail to connect:";
closesocket(conn);
return 0;
}
char buff[512];
sprintf(buff,"Client Process Status: \nBismillah he ar rahman ner raheem\n Allah is Great");
cout<<"\nClient Process status is being send:\n";
send(conn,buff,strlen(buff),0);
closesocket(conn);
cout<<"Process's Status sent:"<
|
|
|
|
|
I am building a client server user tracking system that will get the username and computer name from the client kernel and send it to server via winsock.
I have got the different pieces of the puzzle but now i want to combine them all. So help me out
1) i have the perfect running code of the system call GetComputerName( ).
which uses windows.h
#include<windows.h>
#include<stdio.h>
int WINAPI WinMain(HINSTANCE h,HINSTANCE p,LPSTR c,int n)
{
TCHAR szName[256]; // pointer to system information string
TCHAR szBuffer[512]; // buffer for expanded string
unsigned long iTextLength;
TCHAR szSystemInfo[5];
iTextLength = sizeof(szName)/sizeof(TCHAR); // number of characters, not bytes
GetComputerName(szName, &iTextLength);
iTextLength = sprintf(szBuffer, "Computer name: %s", szName);
MessageBox(0, szBuffer, "Computer Name", 0);
GetUserName(szName,&iTextLength);//Get User Name
iTextLength = sprintf(szBuffer, "User name: %s", szName);
MessageBox(0, szBuffer, "User Name", 0);
return 0;
}
2) I also have the perfect running code of client which uses MFC and sends the status of the client-- that is sends the string from the client which is received at the server.
#include "stdafx.h"
#include "client.h"
#include windows.h
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// The one and only application object
UINT sendStatus();
CWinApp theApp;
using namespace std;
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
sendStatus();
return nRetCode;
}
UINT sendStatus()
{
SOCKET client;
WSADATA wsaData; //data structure
sockaddr_in serveraddr; //sockaddr_in
int wsaret=WSAStartup(0x101,&wsaData); //Initialize wsaret variable
if(wsaret!=0)
{
cout<<"Fail to initialize:";
return 0;
}
struct hostent *hp;
unsigned int addr;
struct sockaddr_in server;
CString servername="localhost";
SOCKET conn;
conn=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(conn==INVALID_SOCKET)
return 0;
if(inet_addr(servername)==INADDR_NONE)
{
hp=gethostbyname(servername);
}
else
{
addr=inet_addr(servername);
hp=gethostbyaddr((char*)&addr,sizeof(addr),AF_INET);
}
if(hp==NULL)
{
cout<<"Fail to get peer address:";
closesocket(conn);
return 0;
}
server.sin_addr.s_addr=*((unsigned long*)hp->h_addr);
server.sin_family=AF_INET;
server.sin_port=htons(20248);
if(connect(conn,(struct sockaddr*)&server,sizeof(server)))
{
cout<<"Fail to connect:";
closesocket(conn);
return 0;
}
char buff[512];
sprintf(buff,"Client Process Stat us: \nOH GOD help me out");
send(conn,buff,strlen(buff),0);
closesocket(conn);
cout<<"Process's Status sent:"<<endl;
wsacleanup();
="" return(0);
}
=""
=""
3)="" i="" have="" perfect="" running="" code="" of="" the="" server="" in="" mfc
#include="" "stdafx.h"
#include="" "server.h"
#ifdef="" _debug
#define="" new="" debug_new
#undef="" this_file
static="" char="" this_file[]="__FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
//" one="" and="" only="" application="" object
="" cwinapp="" theapp;
="" using="" namespace="" std;
uint="" serverthread(lpvoid="" pparam);="" declear="" function
cwinapp="" theapp;="" call="" object=""
using="" std;
int="" _tmain(int="" argc,="" tchar*="" argv[],="" envp[])="" thread="" main,mfc
{
="" int="" nretcode="0;"
="" afxbeginthread(serverthread,0);="" to="" function
="" while(_getch()!="27);
" return="" nretcode;
}
uint="" pparam)
{="" socket="" server;="" is="" unsigned="" int
="" wsadata="" wsadata;="" sockaddr_in="" local;="" structure="" variable="" wsaret="WSAStartup(0x101,&wsaData);" initialization
="" if(wsaret!="0)
" {
="" 0;
="" }
="" local.sin_family="AF_INET;" family="" ip="" ipv4="" or="" ipv6="" local.sin_addr.s_addr="INADDR_ANY;" address="" type="" any
="" local.sin_port="htons((u_short)20248);" number="" on="" which="" communicate
="" initialize="" socket
="" if(server="=INVALID_SOCKET)
" cout<<"error="" socket:"<<endl;
="" if(bind(server,(sockaddr*)&local,sizeof(local))!="0)" binding="" bind:"<<endl;="" if(listen(server,10)!="0)" listening="" listen:"<<endl;
="" }
="" cout="" <<="" "tcp="" started="" up\r\n";="" couts
="" "press="" escape="" terminate="" server\r\n";
="" client;
="" from;
="" fromlen="sizeof(from);
" while(true)
="" buff[512];
="" n;
="" client="accept(server,
" (struct="" sockaddr*)&from,&fromlen);
="" "connection="" from="" "="" inet_ntoa(from.sin_addr)="" <<"\r\n";
="" while(n="recv(client,buff,strlen(buff),0))
" buff[n]="0;
" cout<<buff<<endl;
="" closesocket(client);
="" closesocket(server);
="" 0;
}
4)="" now="" tried="" combine="" first="" two,="" it="" complies="" but="" gives="" linking="" error.="" (="" mfc="" windows.h)
please="" help="" me="" out="" fix="" problem
=""
#include="" "client.h"
#include="" <windows.h="">
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// The one and only application object
UINT sendStatus(); //decleration of functions
CWinApp theApp;
using namespace std;
TCHAR szName[256]; // pointer to system information string
TCHAR szBuffer[512]; // buffer for expanded string
unsigned long iTextLength;
TCHAR szSystemInfo[5];
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[])
{
int nRetCode = 0;
iTextLength = sizeof(szName)/sizeof(TCHAR); // number of characters, not bytes
GetComputerName(szName, &iTextLength); //get Computer Name
sendStatus(); //Call function
return nRetCode;
}
UINT sendStatus()
{
SOCKET client; //socket is uint
WSADATA wsaData; //WSADATA structure
sockaddr_in serveraddr; //sockaddr_in
int wsaret=WSAStartup(0x101,&wsaData); //Initialize wsaret variable
if(wsaret!=0)
{
cout<<"Fail to initialize:";
return 0;
}
struct hostent *hp;
unsigned int addr;
struct sockaddr_in server;
CString servername="localhost";
SOCKET conn;
conn=socket(AF_INET,SOCK_STREAM,IPPROTO_TCP);
if(conn==INVALID_SOCKET)
return 0;
if(inet_addr(servername)==INADDR_NONE)
{
hp=gethostbyname(servername);
}
else
{
addr=inet_addr(servername);
hp=gethostbyaddr((char*)&addr,sizeof(addr),AF_INET);
}
if(hp==NULL)
{
cout<<"Fail to get peer address:";
closesocket(conn);
return 0;
}
server.sin_addr.s_addr=*((unsigned long*)hp->h_addr);
server.sin_family=AF_INET;
server.sin_port=htons(20248);
if(connect(conn,(struct sockaddr*)&server,sizeof(server)))
{
cout<<"Fail to connect:";
closesocket(conn);
return 0;
}
char buff[512];
iTextLength = sprintf(szBuffe r, "Computer name: %s", szName);
send(conn,buff,strlen(buff),0);
closesocket(conn);
cout<<"Process's Status sent:"<
|
|
|
|
|
I am trying to write a simple batch file to get a project from source safe, build it using the vs.net cmd line and then deploy it somewhere.
I am using the following line to get the project from vss:
ss get $/MyProjects/MyProject1 -R -I- -NL
–R -> recursive
-I- ->don’t ask for input
-NL -> use long names (alternatively –NS for short names)
However, this is an asp.net project, all the filenames are being trimmed when getting from vss, this results in files being copied over. I have searched the documentation and on the web and cant find my answer, can anyone help?
Thanks,
Rob
|
|
|
|
|
Hi,
We are looking for remote keylogger industry as target and would like to invite programmers. please contact the signed asap
|
|
|
|
|
|
I am trying to get a DLL for the WinRadio WR-1500e that VB6 will
reconize. I have enough knowledge to get me into trouble. The
dll that came with the product does not have an enterance point.
Form reading the information on the dll they are using an user type
vsriable. But what I do not understand is how to get information
from ech of the subitems of the type. Can someone please help me?
|
|
|
|
|
|
|
|
|
|
Umm, i just start to write an n-tier application. I really need an standard n-tier application to check 'n base on it to develop my project. That application doesn't need to be too big, complicated or even a complete project. i just need an application that show clearly about n-tier (urr, maybe one control class for two design from ...).
I really need it. Can anybody help me ?
Thanks!
|
|
|
|
|
I am writing a beginners guide to sound and waves. I have a lot of good information, but I am not sure how to best structure it. I was wondering if I could get some feedback for a general outline. Also, if anyone sees anything that makes no sense or is just unclear, let me know. I tend to be cryptic at times.
www.vivantlabs.com/Controls/waves.rtf
This is by no means done, and I still have to get DX9 SDK working correctly to write the samples because about a year or so ago when I used it, I forced it to install on VS 2002. I seem to recall it not liking this, and I always have to manually link the assemblies after I use the DX wizard. I now have 2003 and 2002 both on this machine, so I foresee problems.
Anyway, I thought I had better get some feedback before this became a complete mess.
Thanks in advance.
|
|
|
|
|
Mixere is a free, open-source Windows application for mixing audio files. It has a simple, spreadsheet-like interface that's optimized for live performance, and especially for making live sound collage.
Mixere's features include:
* dynamic looping and triggering of audio
* fully automated sliders
* "soft" (gradual) mute/solo operations
* crossfading between documents
* snapshots
* unlimited undo
Mixere runs on Windows NT/2000/XP, and supports WAV, AIFF, MP3, Ogg
Vorbis, Flac, and Mod audio files. Mixere was developed in MFC 6.0, and uses the Audiere high-level audio API, which is also a Source Forge project.
Mixere is already useful, but it's also a work in progress. Collaborators and beta testers are welcomed. Mixere couldn't have been developed without the research of other CodeProject members; thank you!
For more information, and to download Mixere:
http://mixere.sourceforge.net/
Chris Korda
victimofleisure AT yahoo.com
|
|
|
|
|
Hello all,
I've written a little LOGO-style Turtle interpreter class in C# and I'm thinking about posting an article about it on this site. However, as it'll be the first piece of C# code I've let out into the wild, I'd like someone to take a look at the code and the article I'm writing, to check that it's something worth posting.
Cheers,
Emma
|
|
|
|
|
Emma Burrows wrote:
I've written a little LOGO-style Turtle interpreter class in C#
Cool. Back in the C64 days, I wrote Turtle Toyland Junior, a completely graphical version of the LOGO concept.
Send your article my way, I'll be happy to take a look.
Marc
MyXaml
Advanced Unit Testing
YAPO
|
|
|
|
|
Hi guys (and girls), I need help - im writing program sending sms notifications to cell phones in USA - can anyone provide me his or her number - I will send just couple sms, to test my application?
Regards
Jacek Michalek
|
|
|
|
|
I want to see how this performs with many users. It currently tracks every hand played and uses an access database. I am curious how much it can hold before the queries get too slow. Since it is only important to keep the top hands for each user and each day, for the statistics / leaderboard. If I know how much I can keep and setup some system for deleting unneccaary enties it might work. Of course I will ultimately move the a better db, this is just what I had currently installed. (not ready to make the investment in SQL Server yet)
http://www.bobmartin.us/videopoker
I have plans on creating a full site with holdem / stud type games and free tournements.
So go play, and let me know how it works.
Bob Martin
|
|
|
|
|
Hi
We built this assembly generator that creates a wrapper to simplify database interactions with Sql Server 2k and Access 97/2k/XP.
I need some programmers input about it.
http://www.veloxdatasystems.com/downloads/downloads_datalg.php[^]
If you give it a try, leave me a message to tell me what you think about how it works.
|
|
|
|
|
Hi everyone,
We need to perform a simple cross-browser compatibility test of a simple flash application. The test would only consist of visiting one web page and letting me know what you have seen - and possibly visiting the same web page again after a day or two to see the effect of our modifications.
As you can see, it shouldn't take more than 5 minutes of your precious time. So if you have the AOL browser installed on your PC or Mac, whichever version but preferably one of the recent like 8.0 or 9.0, and would like to help, please let me know - just reply to this thread.
Thanks in advance!
Rado
|
|
|
|
|
I am a memeber of a startup. We are currently seeking one additional person to join our development team of 7 people. The person should be knowledgeable with C# Programming, and network security.
Network security is the biggest concern and priority of any technology based, service oriented technologybusiness today.
The party will be able to help define and implement network security:
• Network traffic to and from the Internet
• Network traffic to and from the machines on the LAN
• The behavior of each application and the network traffic generated by
each application on each computer on the network
• The users that can use each application
IF you are interested please contact me at Sterling.wright@comcast.net
|
|
|
|
|
Hi y'all,
I am evaluating issue tracking tools. General requirements are:
1. Intuitive, flexible UI.
2. Windows client and web interface.
3. Test case management.
4. Flexible creation of fields and values for issues.
5. Good reporting capability.
6. Dashboard-like feature to present team members with concise summary of issues assigned to them.
Here's the workflow that I envision:
Test engineer generate test cases and enter them into tool.
Test engineer performs test case and finds defect.
Defect details are entered into the tool's database.
Email is sent to development lead to notify of new defect in database.
Development lead evaluate defect and assign defect to developer.
Email is sent to developer to notify of new defect assignment.
Developer makes a correction attempt and change defect state to fixed.
Test engineer who found defect is notified of fix by email.
Test engineer verify fix and either reopen issue if not fixed or close issue if fixed.
In lieu of, or in addition to email notifications, a nice dashboard-like feature where all team members can look to see state changes in issue database relevant to them would be nice. For example, instead of receiving email notification, a new defect report shows up in the development lead's dashboard, a new defect assignment shows up in the developer's dashboard, and fixed defects ready for verification shows up on the tester's dashboard. Team member would check the dashboard a few times a day, or perhaps get Outlook-like balloon notification of new issue events from a system tray icon if using the Windows client.
If someone have used a bug tracking tool that meets these requirements and support the above workflow, please let me know.
Thanks,
Quoc
|
|
|
|
|
|