|
No. Exceptions do not cross threads. But what does it have to do with critical sections ?
|
|
|
|
|
"Exceptions do not cross threads" Thats the answer i want to hear.
Thanks.
|
|
|
|
|
Hi All,
I am using RegFlushKey() API in my application. We have to pass a registry key to the API. The API flushes the entire hive to which the key belongs. Is there any way I can flush only the contents of the key I pass and not the entire hive?
Thank you,
AJ
|
|
|
|
|
May Be this article will help you and sort out your problem.
Click Here ->[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I had seen this link....but of no help...
|
|
|
|
|
I have already developed a application which is doing the following:
1. This a MFC dialog based application
2. It has three button "Capture","List Windows","Exit"
3. It is listing all the windows and then
4. After selecting a window and if you press capture it will capture selected window data.
5. Now i have the captured image into a buffer.
Question/Probelm:
1. How can i display this buffer only in the secondary monitor?
2. Is it possible to show the output in fullscreen mode on secondary monitor.
3.How can i maintain the aspect ration of the buffer on secondary monitor
if the captured data dimension is smaller than the secondary monitor resolution?
Please help.
|
|
|
|
|
Hi all,
I have this downloader code what I do is there is this temp file that where the downloaded file is being stored until completed when completed I want it to be transfered to a new file, I am trying to do this by movefile() however it returns false.
Here is my code maybe anyone of you can see why:
HINTERNET hConnect = NULL;<br />
HINTERNET hOpen = NULL;<br />
HINTERNET hOpenFile = NULL;<br />
<br />
HINTERNET hHttpRequest = NULL;<br />
bool sendReq = FALSE;<br />
LPTSTR AcceptTypes[2] = {TEXT("application/x-zip-compressed"), NULL}; <br />
<br />
BOOL bRet = FALSE;<br />
BOOL bInComplete = FALSE;<br />
BOOL Exist = FALSE;<br />
INTERNET_PORT nServerPort =21;<br />
FILE * pFile = NULL;<br />
<br />
DWORD dwPacketSize =5;<br />
<br />
DWORD dwSize, dwToRead = dwPacketSize * 1024;<br />
PBYTE pBuffer = new BYTE[dwPacketSize * 1024];<br />
<br />
double dOffsetToSeek =0;<br />
<br />
std::string strTmpFileName = "Temp_CaptureFile4210InstallerBuild_4.zip";<br />
std::string strFileNameAtLocalMachine= "CaptureFile4210InstallerBuild_4.zip\\";<br />
DeleteFile(strFileNameAtLocalMachine.c_str());<br />
CString strStaus;<br />
double dCurrentFileSize;<br />
<br />
DWORD dwBytesWrrittenToFile =0;<br />
<br />
if(IfLocalFileExist(strTmpFileName.c_str(), &dCurrentFileSize)) <br />
{<br />
dOffsetToSeek = dCurrentFileSize;<br />
}<br />
<br />
CString strRangeQuest;<br />
<br />
if(dCurrentFileSize>0){ <br />
strRangeQuest.Format( _T("%sRange: bytes=%d-\r\n"), szHeaders,static_cast<ULONGLONG>(dCurrentFileSize));<br />
}<br />
else <br />
strRangeQuest = szHeaders;<br />
<br />
dwBytesWrrittenToFile = dOffsetToSeek;<br />
<br />
if ( !(pFile = fopen (strTmpFileName.c_str(), "ab" ) ) )<br />
{<br />
CString strMsg;<br />
strMsg.Format("Error:%d", GetLastError());<br />
return false;<br />
}<br />
if(dOffsetToSeek >=0)<br />
{<br />
strStaus.Format("Seeking to local file...");<br />
int n = fseek(pFile, dOffsetToSeek, SEEK_SET);<br />
}<br />
<br />
CInternetSession Session(_T("Test Application"));<br />
CHttpConnection Connection1(Session,_T("http://10.5.1.4/downloads/CaptureFile/CaptureFile4210InstallerBuild_4.zip"));<br />
BYTE Buffer[4096];<br />
<br />
CHttpFile File2(Session,_T("http://10.5.1.4/downloads/CaptureFile/CaptureFile4210InstallerBuild_4.zip"));<br />
CInternetFile::CInfo Info(File2);<br />
File2.SendRequest(strRangeQuest);<br />
<br />
for (DWORD dwRead2;dwRead2=File2.Read(Buffer,sizeof(Buffer)); )<br />
{<br />
fwrite(Buffer, sizeof (char), dwRead2 , pFile); <br />
}<br />
<br />
bool moved = MoveFile(strTmpFileName.c_str(), strFileNameAtLocalMachine.c_str());<br />
DeleteFile(strTmpFileName.c_str());<br />
<br />
return 0
Thanks,
Jayjay
|
|
|
|
|
Um, don't you have to close a file before you can move it?
for (DWORD dwRead2; dwRead2=File2.Read(Buffer,sizeof(Buffer)); )
{
fwrite(Buffer, sizeof (char), dwRead2 , pFile);
}
fclose(pFile);
bool moved = MoveFile(strTmpFileName.c_str(), strFileNameAtLocalMachine.c_str());
|
|
|
|
|
is any way to tell a dialog is modal or modeless from its HWND.
Thanks & Regards
|
|
|
|
|
|
i want to close dialog from app other than the caller, by processing a WM_CLOSE.
i need to determine from EndDialog and DestroyWindow, which one to use for a purticular dialog.
//my idea is to call EndDialog() and followed by DestroyWindow() for every HWND, but im not sure this will work as expected.
Thanks & Regards
|
|
|
|
|
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>
|
|
|
|