i am doing a structure program "struct book",but at the time of run cmd is opening and i am getting 'windows don't send' error and program has been terminating.
the code is following:
#include<stdio.h>
#include<conio.h>
display();
struct book
I have struggled to send email from my MFC applications using severl methods:
1) http via my server - works but limited 2) M$ Outlook automation - works but not easily interchangeable between machines 3) Windows Sockets - available information simply too complicated 4) Purchase an ActiveX control - I hate black box solutions and am too cheap
I have looked at P. J. Naughter's class CPJNSMTPConnection v2.99 An MFC class to encapsulate the SMTP protocol [URL]
This approach requires the implementation of OpenSSL which turns out to be nothing short of a nightmare to install (so I never got it to run). I am looking for an example of an application that utilizes SMTP via Windows sockets api.
I need to do an equivalent of kill -11 <pid>(which is in unix) in windows.
I need to crash a process with SEGV so that it would dump core in windows. Is there any tool by which we can do this . Also is there any sample code through which we can achieve this .
In windows we have taskill which only terminates a process , but is unable to send a signal like SEGV to the process upon which it would terminate and dump core .
I'm fairly new to visual C++ programming in a windows form and the code displayed below works fine. However my issue is as soon as the program is running it will display "failure" on label7 as soon as the button is clicked. I understand why it is doing this as "a" is not in the textbox at this time so it reads the else line and displays the message. When I enter "a" in the textbox everything works fine and label7 changes to the right message.
The following code it taken from msdn library but it is failing to compile.
the following code has a header where all the variables used here are stored in header App.h.
The following lines are giving trouble:
Code: DialogBox(pApp->getInstance(), MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, pApp->About); error: 'App::About': function call missing argument list; use '&App::About' to create a pointer to member
Code: wcex.lpfnWndProc= &App::WndProc; error: '=' : cannot convert from 'LRESULT (__stdcall App::* )(HWND,UINT,WPARAM,LPARAM)' to 'WNDPROC'
There is no context in which this conversion is possible
By using visual studio 2010, I have problem calling up on screen keyboard using line below for Windows 7 64 bit.
WinExec("OSK.EXE", SW_SHOW);
However, it is working fine on windows XP 32 bit. How to call up on screen keyboard for 64 bit windows?
Code:
int _tmain(int argc, TCHAR* argv[], TCHAR* envp[]) { int nRetCode = 0; HMODULE hModule = ::GetModuleHandle(NULL); if (hModule != NULL) { // initialize MFC and print and error on failure
My first time programming sth in Network. I have to use C to send a file to another PC, well COM port are useful but I didn't find how to refer to the address of my destination.
i developed 2programm that the first one is in C and the second one is in c#.and now i have to send some string text from c to c#.how can i do that in c ?
how to send datapackets. When we send a data packet from device to another, say I have a "string". How Do I send it? Are data sent as a hex or binary number?If so do i first convert the "string" into hex or binary and then send it over the communication medium(say UART)??
I have two hex numbers to be sent using the UART, do i wrap it in some specific form and send it and retrieve it on the other side?Say if I have a data structure, in that case how do i send it? Sending data packets is very cruicial in an embedded system.
I am writing a client-server program in C++ using C libraries. The server listens for a connection and when one is found, it is supposed to send a binary file(an image in my case) to the client. The server is sending the binary file perfectly after opening it and reading its contents into a buffer that is dynamically allocated in the SERVER file.
The problem begins when the client file is supposed to recv() the file, I do not know how I can allocate a buffer big enough for the file to be received. I know how to use malloc() and new, I prefer malloc() for executable size customization. Assuming the file being sent is 11000 bytes(note that this is an assumption and the client can not know the file size because the file size is dynamically generated by server).
How can the client generate a dynamically allocated buffer big enough to hold 11000 bytes? OR How can the client store the data in a buffer using recv() without knowing the file size.
Below is part of the code that does the send()'ing and recv()'ing.
SERVER
FILE *img = fopen("img.jpg", "rb"); fseek(img, 0, SEEK_END); unsigned long filesize = ftell(img); char *buffer = (char*)malloc(sizeof(char)*filesize); rewind(img); // store read data into buffer
[Code] ....
This outputs all the binary code perfectly but it is a bug because it can't be written to a file. Is there a way to dynamically increase the buffer until all filesize is received? Certainly, buffer needs to be dynamically allocated or program crashes ...
Also one more thing, when I telnet the server from command line, telnet displays all the output perfectly as well
Maybe telnet is storing data into a buffer behind the scenes, if so, how?
I was wondering if there was a way for me to send information, say a username and password, to a webpage via a c++ function. I was unsure how exactly to word it, but I did attempt to google it. Here is an example of what I mean.
App starts -> goes to "Https://www.my-site.com/?user=$username&password=$password" -> username/password is valid -> logs them in on desktop app
I do not know much about php, but I am assuming the ?user=$username is setting a variable, correct? I am familiar with sockets, but it seems using the above method, this could be possible without sockets, would it?
Important part:
That is the method that minecraft uses to login players, the question here is what function could I start to send the desktop app to the webpage.
EDIT:: After looking a little more I find that it is probably not possible without sockets, which is fine; however I don't know how to do it still, I would prefer to not use external libraries, such as Curl.
so im just getting into network programming and im trying to make a chat server and client so i can send and receive messages. I have written both a chat and a client, with no error reporting (i know, i know). But the message that comes through on the server side is "hiiinaovH+". Ive represented this as well as i can but really they are non alphabetic symbols coming through.
client code:
#include <iostream> #include <winsock2.h> int main() {
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Net; using System.Net.Sockets; using System.Threading; namespace test {
[Code] ....
I don't know if this is a bug in Winsock or the .NET Framework but i need to fix this or workaround. Recently I was working on a networking class and this error is breaking everything.
If you add Thread.Sleep(1) after Send() call then "TCP Bug detected" doesnt get executed but its not a reliable fix.
i've a function to add many buttons to TabbedPanel like is visible here
public void AddBeverageDrinkstoTabbedPanel(TabPage tp1, ListBox lst1) { food getbeverage = new food(); string[] bev_product = getbeverage.name1; FlowLayoutPanel flp1 = new FlowLayoutPanel(); flp1.Dock = DockStyle.Fill; foreach (string value in bev_product)
[code].....
What happens? When i click in any button, want add an specific text to listbox and to do this i builded an method called beverageclick(), with these code:
public void beverageclick(object sender, EventArgs e) { Button b = (Button)sender;//button sender string value = (string)b.Tag;// value = b.tag (tag of sended button tag = value (value of AddBeverageDrinkstoTabbedPanel) method)
[Code] ....
What is wrong? how can i add an specific value when an button was clicked.
I have written a socket witch send an image 256x256 and now i want to send many images and i don't know what loop to write to make the socket after have sent the first image to send another and not to write the same program many times for every image ......
this is the part that read the binary image
if( !(fp=fopen("Anemos.bmp","rb"))) { printf("Unable to load bin file: %s... ","Anemos.bmp");
I'm trying to understand winsock with c++. Let's assume I have a 2 working applications, one is the client and one the server:
Client: I can enter a command, for example chat or filetransfer, it will then switch into this specific mode where I can enter commands like uploading a file, send a message etc.
Client Code: .... while (rc != SOCKET_ERROR) { printf(" #"); gets(buf); if (strcmp(buf, "CHAT") == 0){ // start chat mode
[Code] .....
I'm in a recv/send loop and I'm using streams...so basically all the data is being sent/received there. Now, if I want to upload a file, I send a FILETRANSFER String to the server. Then I will probably need another loop that receives file requests from the client. The server will need more details about the file, like the path, name, size...
Now, my question is, what's the best practise for something like that? I'm having problems understand how I can send 3 different values from the server to the client and how he will receive them in the right order store them in variables. And also, after sending something to the server, in some cases, the client will have to wait for the server to answer.
I'm currently in the middle of designing a program for some project. one part of the program is to send reminding SMS messages to the employees.
I have already subscribed to a SMS provider and they gave me an access to a control panel (aspx). But now I'm wondering how will I be able connect to the SMS server and be able to send messages?
I'm learning C++. Is there some way to make program function on input from a port like usb port and can I send bits through the port? For example A usb cable connected to a circuit. I press a button and an AND gate on the circuit gets activated by a bit from the usb port and a fan in the room turns on.
how do i send post with data to a php page on the net using c++? im using this for a file uploading site for my school group. and also, im planning to pass this as my project. but, i cant find a concrete way on how to send post method with data to a php page. ive been fed up with a lot of answers from the net, yet, each time i try to use them, i get errors. ive tried every library you can see till the third o of google. ive also tried a wrapper from this site, but, ive got no succes. im using dev c++.