Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
A

amitranjanmishra

@amitranjanmishra
About
Posts
10
Topics
8
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Error Code 3021:
    A amitranjanmishra

    Hi Group, I need an Urgent Help. I have been connecting my application to a remote mysql database(For development it is in lan only). I fail to retrieve data from database I have used this: if rs.eof then rs.movefirst ' have also used rs.movelast else rs.movelast endif but it does not help....... Tell me how to rectify it.... Thanks Amit amit mishra

    Visual Basic help database mysql tutorial

  • How to convert from char * to enum
    A amitranjanmishra

    Dear All, I have a file from which i am reading a value.The file contents are like : ProtocolType = E1_EURO_ISDN and i am trying to take " E1_EURO_ISDN" into a string variable, protocoltype. int x=0; char *line; fgets(line,100,stream); :::::::::::: :::::::::::: :::::::::::: Assumed that the string is taken into buffer. if(strstr(line,"ProtocolType")) { // go to end of line for( i=strlen(line)-1,l=0;line[i]!=' ';i--,l++) { protocoltype[l]=line[i]; } protocoltype[i]='\0'; strcpy(protocoltype,strrev(protocoltype)); BoardParam->TrunkConfig[x].ProtocolType=protocoltype; }//end if But it gives error like "cannot convert from 'char *' to 'enum PSTNProtocolType'" How do I solve the problem as protocoltype have to have a char string. Thanks in advance. amit mishra

    C / C++ / MFC help tutorial question

  • How to get read of client socket information from the user command
    A amitranjanmishra

    Hi, Wishing you all a very happy and prosperous new year. I state my problem , My server socket looks for data from connected clients. When a data is found it is stored in a file for further processing. It's all happening but the first command being recieved from any client is being ignored as the server is just checking for a particular command. Imagine the scenario ...i sent the data via the code: **Winsock1.SendData strTemp** in the server file it comes like **oÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌÌtÿÖperator play anil.pcm 2001** Though the second command onwards comes as is sent. This has become a real headache to me..i dont understand how to get read of it. Awaitng a quick reply Thanks in advance. amit mishra

    Visual Basic sysadmin help tutorial

  • fail to envoke shutdown socket function.
    A amitranjanmishra

    Taking char * buff has a strong reason behind as i m trying to recv a string eg. SYNTAX like Operator play file abc.wav yeah a typing err n i apologize fr recv(server,....)it was n shud be recv(client,....). Constantly opening and closing file is reqd as the client may keep sending data. eg. 1.

    open channel ch_id,play file filename,record fiel fielrec

    , etc... i want to envoke shutdown in the outer loop n yes i ddnt free memory was my mistake..for once the data is written to the fiel the memory shud have been freed n file closed. amit mishra

    C / C++ / MFC sysadmin question

  • fail to envoke shutdown socket function.
    A amitranjanmishra

    i fail to envoke shutdown function. i m trying to write the data recd in the socket buffer to a fiel. though i manage it but it happens only i stop the application and not before. i tried many alternatives but feel i m still short of something. Seeing the given code can i be suggested why???? // THe following is a client thread UINT ClientThread(LPVOID pParam) { char *buff; CString cmd; CString params; int n; int flag=0; BOOL auth=false; buff=(char *)malloc(1); SOCKET client=(SOCKET)pParam; recv(server,buff,sizeof(buff),0); // ftxt=fopen("d:\\amit\\COMMAND.txt","a+t"); while(true) {ftxt=fopen("d:\\amit\\COMMAND.txt","a+t"); while(n=recv(client,buff,sizeof(char),0)) { flag=1; // n=recv(client,buff,sizeof(char),0); fwrite(buff,sizeof(char),1,ftxt); if(n==SOCKET_ERROR ) break; buff[n]=0; cout< amit mishra

    C / C++ / MFC sysadmin question

  • Want to read from an already opened Notepad file
    A amitranjanmishra

    How do i read from an already opened text file using vb6.0.. I tried to write code which is here... Private Sub Form_Load() Dim TxtSheet As Object Set TxtSheet = GetObject("d:\amit\1.txt") ' This is a NOTEPAD APPLICATION AND IS ALREADY OPENED by some other application in write|append mode Dim buffer As String buffer = TxtSheet.Application.Value Text1.Text = buffer Unload Me End Sub amit mishra

    Visual Basic question

  • Write to a fiel and read the same fiel in real time.
    A amitranjanmishra

    HI , I wanna help on a simple application. I have 2 applications in c language. First application 'A' has some data being written in a text file 'T'. Second Application 'B' simultaneously is reading that data from the same file 'T'(if any) and producing the desired output. Can it b done n how. amit mishra

    C / C++ / MFC help

  • Fail to bind the socket
    A amitranjanmishra

    :rose: Thnx fr guiding me :rose: . This being my fst attempt in socket prg. Yeah i cud move ahead all bcoz of u , but caught again midway. In my server program when i use recv() it gives the failed to bind and failed to listen errors. When i m trying to print the acceptance after the accept function it shows the connection. That On other side When i use recv fn in Client application some garbage is printed in . I use it like { char buff[512]; // Connection with server servAddrSrvr.sin_addr.s_addr=inet_addr("192.168.0.20"); servAddrSrvr.sin_family=AF_INET; servAddrSrvr.sin_port=htons(80); connect(conn,(struct sockaddr*)&servAddrSrvr,sizeof(servAddrSrvr)); recv(conn,buff,sizeof(buff),0); printf("%s\n",buff); } Can u say me where i went wrong. amit mishra

    C / C++ / MFC help sysadmin question career

  • Fail to bind the socket
    A amitranjanmishra

    I have created 2 sockets . I fr my server application <192.168.2.20> port 80 I fr my client. IP Address assigned: 192.168.0.51 port 80 Both The applications reside on the same machine. When I execute the server it runs fine But when I run the Client , it shows error code : 10047 Yeah, After surfing the net I got to know that Protocol family not supported ... But the problem iz........ Unless the Connection is not established between the two applications how come it give such error. What Can there be other possibilities? The portion causing error is Enclosed. :rose:With hope to recv earliest suggestions i Thnx in Advance.:rose: int main() { :: :: sock_creation(); :: :: } int sock_creation() { int rc,k; struct sockaddr_in addr; char *servername; struct WSAData wsaData; printf("\n Count 10 n Resume ...\n"); int wsaret=WSAStartup(0x101,&wsaData); if(wsaret<0) { printf("Unable to Initialize Windows Socket Library"); k=getch(); exit(1); } else { printf("\n Initialized Windows Socket Library"); } conn=socket(AF_INET,SOCK_STREAM,0); servAddr.sin_addr.s_addr=inet_addr("192.168.0.51"); servAddr.sin_port=htons(u_short(8080)); if(conn==INVALID_SOCKET) { printf("\n But Unable to Initialize Windows Socket"); k=getch(); exit(1); } else { printf(" \n Initialized Windows Socket As Well....."); } if(bind(conn,(sockaddr*)&servAddr,sizeof(servAddr))!=0) { printf("\n But Failed to bind !!! Error Code %d\n ",WSAGetLastError()); k=getch(); exit(1); } servAddrSrvr.sin_addr.s_addr=inet_addr("192.168.0.20"); servAddrSrvr.sin_family=AF_INET; servAddrSrvr.sin_port=htons(80); // connect(conn,(struct sockaddr*)&servAddrSrvr,sizeof(servAddrSrvr)); return 0; } amit mishra

    C / C++ / MFC help sysadmin question career

  • seekin help fr voip application
    A amitranjanmishra

    :confused:I am working on a voip application where a hardware say board with its own channel configured are to be used. I am making a cli (cmd line interface) which accepts only a proper syntax. If teh syntax z found correct. ..it connect itself to the board and does as reqd. To further illustrate, if the cmd comes like : **" Open Channel , Dial the destination number xxxxx ,Play a file "WelcomeMsg.pcm"**It should open a particular channel ,dial the number and on getting connected,it shud play the file. I ve my cli n the board ready. But i fail to connect the 2. I suppose, I shud take the board as my server and connect the cli(client) thru a socket. This cli application has 2 be on multi wrkstations all connecting to board. :rose:If u understood my question cud u plz oblige with a clarification n assure if i m going right path.:rose: amit mishra

    C / C++ / MFC sysadmin hardware help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups