|
Well, you did not remove all the code that is not relevant. However your second parameter on the connect call is defined as a struct sockaddr_in* but according to the documentation[^] it should be a struct sockaddr* .
|
|
|
|
|
Give i do this ==> Yes or not
if (connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) {
close(sockfd);
return(0);
}
|
|
|
|
|
Yes you can do that but you need to check that both structures are exactly the same in both content and size.
|
|
|
|
|
thank so Must...but you can help solution me again Please??
Now gmkae build file dpss.c not warning already..but Plugin Me cann't sent password to protocal LDAP From Sun to Active Directory not have event log... I don't know sun directory need config port same function send_message
int send_message(char* message)
{
char* ip = "172.32.5.107";
char* port = "12199";
if (argument[0] != NULL)
ip = argument[0];
if (argument[1] != NULL)
port = argument[1];
int sockfd, portno, n;
struct sockaddr_in serv_addr;
struct hostent *server;
char buffer[256];
portno = atoi(port);
sockfd = socket(AF_INET, SOCK_STREAM, 0);
if (sockfd < 0)
{
error("ERROR opening socket");
exit(0);
}
else
{
server = gethostbyname(ip);
if (server == NULL) {
close(sockfd);
return(0);
}
bzero((char *) &serv_addr, sizeof(serv_addr));
serv_addr.sin_family = AF_INET;
bcopy((char *)server->h_addr,
(char *)&serv_addr.sin_addr.s_addr,
server->h_length);
serv_addr.sin_port = htons(portno);
if (connect(sockfd,(struct sockaddr *)&serv_addr,sizeof(serv_addr)) < 0) {
close(sockfd);
return(0);
}
bzero(buffer,256);
n = write(sockfd,message,strlen(message));
bzero(buffer,256);
}
close(sockfd);
return 0;
}
|
|
|
|
|
Sorry, I don't understand your question.
|
|
|
|
|
For localization purposes, I've been using the gettext library in my MSVC-compiled application (x86) using these instructions from the GNU site (https://www.gnu.org/software/gettext/FAQ.html#windows_woe32). It works fine.
Is there a 64 bit version of gettext for windows? - the one listed on the GNU site is 32bit.
modified 23-May-14 22:47pm.
|
|
|
|
|
A number of suggestions here[^].
|
|
|
|
|
Is it possible (how?)put CDocktablePane into CFormView or dockCMDIChildWndEx like CDocktablePane? (Visual Studio 2010)
I've found following instruction, but I'm not able to use it
http://www.johnbyrd.org/blog/index.php?catid=2&blogid=1
I don't understand for example this text
At this point, you should search through your old CView class to find any references to a COleDropTarget. These references should be changed to refer to the m_OleDropTarget member that you put within the CYourDockablePane class.
I believe that somebody smarter tham me will be able to help me
thank you in advance
|
|
|
|
|
Or you could just ask the person who wrote the blog.
|
|
|
|
|
How?
do you know him?
do you have any cotact to him?
could you share it with me?
modified 23-May-14 15:44pm.
|
|
|
|
|
What? You posted a link to his blog in your original question.
|
|
|
|
|
Yes I did.
Can you imagine that I couldn't found any contact information to him?
yes you're right I'm lazy but without exaggeration
|
|
|
|
|
Did you try the link at the bottom of the page that says "Comments"?
|
|
|
|
|
|
Hi All,
my objective is to create a .MD5 file using Rehash.exe which will be called by CreatedProcess().
if i run from command line its working fine
C:\temp>rehash.exe -none -md5 "C:\temp\aaa.TFI" > "C:\temp\aaa.MD5"
but if i implement in code and use CreateProcess, its not working
below is the code snippet
int main()
{
STARTUPINFO si;
PROCESS_INFORMATION pi;
ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) );
LPSTR lp_rehashEXE = "C:\\temp\\rehash.exe";
LPSTR lp_Parameter = " -none -md5 C:\\temp\\Praveer.TFI > C:\\temp\\Praveer.MD5";
if(!::CreateProcess(lp_rehashEXE, lp_Parameter, NULL, NULL, false, 0, NULL, NULL, &si, &pi))
{
printf( "CreateProcess failed (%d)\n", GetLastError() );
return false;
}
// Wait until child process exits.
::WaitForSingleObject(pi.hProcess, INFINITE );
// Close process handles.
CloseHandle( pi.hProcess );
return 0;
}
Please help!!!
|
|
|
|
|
"is not working" is a poor report. Could you please tell use more? Moreover, in the two different tests (namely command line and CreateProcess call) why don't you give exactly the same arguments to Rehash ?
Veni, vidi, vici.
|
|
|
|
|
Look at the documentation of CreateProcess[^]
Now look carefully at the difference between the first and second parameter types - LPCTSTR and LPTSTR respectively.
The first is a constant string and the second is not a constant.
In your code, you're using a pointer to a read-only memory location, which is like a constant string.
Here is an excerpt from the documentation -
The Unicode version of this function, CreateProcessW, can modify the contents of this string. Therefore, this parameter cannot be a pointer to read-only memory (such as a const variable or a literal string).
«_Superman_»
I love work. It gives me something to do between weekends.
Microsoft MVP (Visual C++) (October 2009 - September 2013) Polymorphism in C
|
|
|
|
|
It works, you just dont have rehash.exe in C.\temp
I compiled your code and it and it worked.
Output:
Line, Character counting Program === <EXER3> === by Newbie
Usage: fileName
EXE Path:
Press any key to continue
|
|
|
|
|
One parent dialog is containing 2 child dialog but one at a time.
I need to resize one and not to resize other.
How can I do?
|
|
|
|
|
What's wrong in calling SetWindowPos[^] just for the right child?
Veni, vidi, vici.
|
|
|
|
|
You need to do it manually.
Get the parent dialog client size (CWnd::GetClientRect) and use either CWnd::MoveWindow or CWnd::SetWindowPos to move/resize the child dialog of your choice.
be careful about the CRect that is returned by GetClientRect, you might have to use ScreenToClient to ClientToScreen to convert the rect before move/resize the child dialogs.
I'd rather be phishing!
|
|
|
|
|
Windows 7, Visual Studio 2012, C++
The Microsoft Web page discussing "Quote: Socket overlapped I/O versus blocking/nonblocking mode found here:
http://support.microsoft.com/kb/181611[^]
states:
Quote: To create a socket with the overlapped I/O attribute, you can either use the socket API or the WSASocket API with the WSA_FLAG_OVERLAPPED flag set.
(I added the bolds in the above quote.) What is the difference between socketAPI and WSASocket API?
Please show a code fragment that creates a socket with socket API and another that creates it with WSASocket API.
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
The functions such as socket [^] are the old style socketAPI group, based on BSD sockets from the early days of UNIX. The WSAxxx functions are the later Microsoft adaptation.
|
|
|
|
|
Is there a difference in speed?
Edit: My email shows another response that says
Quote: The main difference is that socket is a function in the C runtime, and WSASocket is a Windows API.
That response does not show up when I log in here. So can I presume that the WSAxxx versions are faster since they bypass the C runtime, which are, presumably, wrappers that then call the API internally?
Thank you for your time
If you work with telemetry, please check this bulletin board: www.irigbb.com
|
|
|
|
|
bkelly13 wrote: can I presume that the WSAxxx versions are faster since they bypass the C runtime No, you cannot presume anything. It is quite possible (but I don't know) that WSA is built on top of sockets rather than being a complete re-implementation.
|
|
|
|