|
|
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
|
|
|
|
|
Silly question: Have you the Express Edition of VC8?
(Express Edition has NO resource editor).
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
|
|
|
|
|
Did you get any message or warning?
|
|
|
|
|
1. No, it is not the Express. It is the full professional version.
2. I do not receive any error message.
Even more strange: I started a new project in order to test this issue. It is the simple dialog with the default buttons, I have not done anything yet.
The dialog editor has been started automatically, and it works as supposed to - however, the resource tab is still empty in the new project as well.
I added a bitmap resource; I could edit it, but after having closed it, the recource tab is still empty.
Moreover, the class view tab too is empty, both in the converted and in the new project.
|
|
|
|
|
I am trying to subclass a CTEXT control in my dialog, I am using the following code.
LRESULT CALLBACK SetCommStat(HWND hItem, UINT message, WPARAM wParam, LPARAM lParam)
{
PAINTSTRUCT lpPaintStruct;
switch (message)
{
case WM_PAINT:
BeginPaint(hItem, &lpPaintStruct);
GetDC(hItem);
SetBkColor(hItem, crRED);
EndPaint(hItem, &lpPaintStruct);
ReleaseDC(hwndDlg, hItem);
return(0);
}
return(DefWindowProc(hItem, message, wParam, lParam));
}
I also have the following in the WM_INITDIALOG message handler.
hItemHandle = GetDlgItem(hwndDlg,IND_ONLINE);
int test = SetWindowLong(hItemHandle, GWL_WNDPROC, (LONG)SetCommStat);
1. Am I trapping the wrong message, if so what message should I trap?
2. Why has the call to SetWindowText stopped working?
Thanks for your help.
|
|
|
|
|
jonsey29847 wrote: } return(DefWindowProc(hItem, message, wParam, lParam));
Should this be CallWindowProc() ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|