|
Are you aware this (from MSDN [^]):
An application calls EndDialog from within the dialog box procedure; the function must not be used for any other purpose.
?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Can We limit the Number of characters entered in to a text field in MFC?
i.e. I've displayed the characters entered into a textfield to the status bar bane. But if I enter more than 80 characters, an exception is thrown.
How do I limit the characters to 80?
|
|
|
|
|
you can set the limit of text field using
CEdit::SetLimitText(UINT nMax)
Mukesh Kumar
Software Engineer
|
|
|
|
|
Hi friends,
Can anybody help me out in getting good documents on blueTooth and EEPROM API list?
I have to do coding for these devices. Kindly Help me out with good documents which helps me in getting the API list and Code samples for the above said other than MSDN.
Thanks in advance..
poojaaa
|
|
|
|
|
Better help on the Hardware / Device Drivers forum[^].
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
I need the code in VC++ that give the information about hard drives connected to my computer whether it is S-ATA or IDE/ATA.
Is there any WMI class or any win32 API by using which I can get these details.
waiting for your suggestions.
Thanks.
|
|
|
|
|
I have to retrieve the SMTP address, IP Address, username and password from the outlook. I found the entries for SMTP server, username and password under HKCU\Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles\9375CFF0413111d3B88A00104B2A6676\.
My queries are
1) Is there any other way of retrieving the SMTP server name, username and password other than from the registry entry.
2) Also, the password details are encoded in some format under the registry key. how to decode it?
3) How to retrieve the IP Address for the SMTP server setup like gmail, yahoo etc.
|
|
|
|
|
Hi,
I am wanted to learn how to create the COM object using Visual C++ (without .NET). I found the good tutorial site http://www.codeguru.com/cpp/com-tech/activex/tutorials/article.php/c5567/ which give the basic understanding on the COM object.
However, now I wanted to know how to create coclass object, etc. Is there any other good COM tutorial website available? Most of the tutorial site that I googled is either too advance or not what I am looking.
Thanks
|
|
|
|
|
The ideal way would be to read a beginners book on COM.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
|
What is possibly the cause of this?
Retrieving the COM class factory for component with CLSID {87109B64-4DA3-4D97-83B6-6FC6DAC78971} failed due to the following error: 80040154.
Here is my IDL declaration:
import "unknwn.idl";
[
object,
uuid(1221db62-f3d8-11d4-825d-00104b3646c0),
helpstring("Test Interface")
]
interface ITestInterface : IUnknown
{
HRESULT TestReturnValue([out,retval] long *pBuffer);
};
[
uuid(3ff1aab8-f3d8-11d4-825d-00104b3646c0),
helpstring("Interfaces for Code Guru algorithm implementations .")
]
library MyTestLibrary
{
importlib("stdole32.tlb");
importlib("stdole2.tlb");
[
uuid(87109B64-4DA3-4d97-83B6-6FC6DAC78971)
]
coclass MyTestObject
{
[default] interface ITestInterface;
}
}
After convert it to Interop dll, I am using it in C#
MyTestLibrary.MyTestObjectClass testObj;
testObj = new MyTestLibrary.MyTestObjectClass();
Thanks
|
|
|
|
|
Click Here ->[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
i did a socket program in c and now i am migrating it to C++ and i have created a socket class with create, connect, bind, accept, listen and send and receive as member function. The connection and bind and acceptance and send seems to be working but when i check to see if its received it doesn't receive i think beacuse it does not display anything and my send and receive member function looks something like this. Am i doing anything wrong
<code>
int SocketClient::ReceiveMsg()
{
int recvResult = recv(mysocket, recvbuf, recvbuflen, 0);
if(recvResult>0)
cout<<recvbuf;
else if(recvResult == 0)
cout<<"connection closed";
else
cout<<"Receive failed";
return recvResult;
}
int SocketClient::SendMsg(char sendbuf[DEFAULT_BUFLEN])
{
int sendResult;
sendResult = send(mysocket, sendbuf, strlen(sendbuf), 0);
if (sendResult == SOCKET_ERROR)
{
cout<<"send failed:"<<WSAGetLastError();
end();
exit(1);
}
cout<<"Message sent:"<<sendbuf;
cout<<"Bytes sent:"<< sendResult<<" bytes";
return sendResult;
}
</code>
|
|
|
|
|
Can you show the code for accept()?
|
|
|
|
|
<br />
void SocketClass::AcceptClient()<br />
{<br />
ClientSocket = accept(mysocket, NULL, NULL);<br />
if (ClientSocket == INVALID_SOCKET) <br />
{<br />
cout<<"accept failed: \n"<<WSAGetLastError();<br />
closesocket(ClientSocket);<br />
end();<br />
exit(1);<br />
}<br />
}<br />
<br />
when i checked the errror it said error code 10055 which meant no buffer space was available what does that mean.
|
|
|
|
|
ADTC# wrote: ClientSocket = accept(mysocket, NULL, NULL);
Upon accepting the connection, the accept() will return another socket( in ur case ClientSocket ). You should use that socket to send and receive data. But in your code you are writing like..
sendResult = send(mysocket, sendbuf, strlen(sendbuf), 0);
This need to be changed to
sendResult = send( ClientSocket, sendbuf, strlen(sendbuf), 0);
The ReceiveMsg() function also need to be chnaged..
int recvResult = recv(ClientSocket, recvbuf, recvbuflen, 0);
|
|
|
|
|
my server side send and receive uses ClientSocket but the Client side should use mysocket that was created in the client side programming and earlier send and receive was for client and this ones for server
<code>
int SocketClass::SendMsg(char sendbuff[DEFAULT_BUFLEN])
{
int sendResult;
sendResult = send( ClientSocket, sendbuff,strlen(sendbuff),0);
if (sendResult == SOCKET_ERROR)
{
cout<<"send failed:"<<WSAGetLastError();
end();
exit(1);
}
cout<<"Message sent:"<<sendbuff;
cout<<"Bytes sent:"<< sendResult<<" bytes";
}
int SocketClass::ReceiveMsg()
{
char recvbuf[DEFAULT_BUFLEN];
int recvResult = recv(ClientSocket, recvbuf, recvbuflen, 0);
if(recvResult>0)
cout<<"%s"<<recvbuf;
else if(recvResult == 0)
cout<<"connection closed";
else
cout<<"Receive failed";
return recvResult;
}
</code>
|
|
|
|
|
ok. So you are trying to send the data from server to client or client to server? And which function returned that error code?
|
|
|
|
|
severs sends first and client receives it and sends and acknowledgement and server should receive that and i get the same error on both server and client but this code works fine in C.
|
|
|
|
|
ADTC# wrote: i get the same error on both server and client
What I mean is it the send () function or recv () function that returns the error?
|
|
|
|
|
send() works perfectly fine its the recv() that gives me this error.
|
|
|
|
|
|
i found the error and it is error code 10055 - No Buffer Space was available. How do i allocate buffer space.
|
|
|
|
|
1. I created a project with VC6. Now I opened it with VC8, which converted the project. However, the resource tab is empty. The resource file is there, the program is running, but I don't see the resources (and can't edit them).
2. How does one start the dialog editor in VC8? The help is crap; it contains everything about the dialog editor but not how to start it.
Thanks
|
|
|
|