|
You're probably trying to use the bitmap handle after it's been destroyed. Having the handle to the bitmap is not the same as having the bitmap itself. Generally I keep a CBitmap object in my class definition.
/* Charles Oppermann */
http://weblogs.asp.net/chuckop
|
|
|
|
|
I tried what was suggested and have received the following message when I try to manipulate the image using the 'autoplane function'. The error is not occurring at all when I open a new image, but only when a new widow is opened in response to manipulation.
Data4 CXX0017: Error: symbol "IID_IShellItem" not found
This is the value that is causing the problem in for setting the value of hr to E_INVALIDARG. Visual Studio's debugger mentions something about the "value for this item being stale when trying to evaluate it"
What does it mean for a value to be stale?
modified on Wednesday, August 17, 2011 7:22 PM
|
|
|
|
|
The path is where the original source code was compiled. In this case, it's from the MFC Debug library, and the code was compiled on some Microsoft server.
Fortunetely, you have a copy of the MFC source code in the Visual Studio directory under .\VC\atlmfc\src
/* Charles Oppermann */
http://weblogs.asp.net/chuckop
|
|
|
|
|
AndrewG1231 wrote:
if (m_Bitmap != 0)
DeleteObject(m_Bitmap);
if (m_Bitmap == NULL)
Is DeleteObject in the above code the same as this[^]? Because this one does not make m_Bitmap NULL. So in this case, you check if m_Bitmap is not NULL, if it is not, you try to destroy the GDI resource (a bitmap i assume), after this m_Bitmap holds an invalid handle, then if (m_Bitmap == NULL) will be false, so it goes on happily with the invalid handle. Could this cause your problem?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
|
I am not really clear about the concept of WS_EX_TRANSPARENT, when it used with a main window, it is not transparent at all, sometimes used with a control window, it does disappear from the parent window. Some people say it's not visually transparent, but we can click through it that the windows beneath will receive the mouse msg.
Do you know what this sytle really means? and in what condition it will work otherwise won't?
|
|
|
|
|
|
An application need to use the sdk to send and receive data with remote computer. But the network case is bad, the application uses the main thread to send and receive data, so the GUI is no-response in several seconds. It is bad for the users. The Main Class is derived from a interface, the sdk calls the callback function of application to transfer data. Is there any design pattern to avoid GUI's long-time no-response?
|
|
|
|
|
Start a thread (with AfxBeginThread for instance) passing the parameters you need and the m_hWnd of your window and make the long call in the static threaded function
Once you get the results in the thread, call PostMessage with the m_hWnd and the results...
Trap the message in your dialog with ON_MESSAGE
That's the short story...
|
|
|
|
|
That's pretty much it... Any significant work should be on its own thread.
|
|
|
|
|
BadJerry wrote: call PostMessage with the m_hWnd and the results...
Trap the message in your dialog with ON_MESSAGE
Can you post some sample code for this?
|
|
|
|
|
I am trying to port my MFC project to iPhone... is there some resources somewhere about some of the core (non GUI) MFC objects ported to XCode?
I have found on codeproject a good CString replacement
CString-clone Using Standard C++[^]
I am looking for COleDateTime... the CArray's MFC source code seems to compile!
Any pointer welcome!
Jerry
|
|
|
|
|
BadJerry wrote: the CArray's MFC source code seems to compile!
I'm not sure that this is a good thing.
But good luck with the port. I've always thought that porting MFC apps was similar to herding fish.
Chris Meech
I am Canadian. [heard in a local bar]
In theory there is no difference between theory and practice. In practice there is. [Yogi Berra]
posting about Crystal Reports here is like discussing gay marriage on a catholic church’s website.[Nishant Sivakumar]
|
|
|
|
|
I think that re-writing code in another language for another platform and expecting the same beaviour on both platforms was like herding fish...
But thanks - luck I need!
|
|
|
|
|
Alternatively if someone had the source code for VariantTimeToSystemTime, I'd be interested!
|
|
|
|
|
Check out the WINE[^] implementation, maybe it helps.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
|
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> If it doesn't matter, it's antimatter.<
|
|
|
|
|
BadJerry wrote: COleDateTime
I believe, what ever COleDateTime do is well documented here [^]and available free on net.
I am not aware if xcode support ATL, if yes, you can still use it!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow Never mind - my own stupidity is the source of every "problem" - Mixture
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Hi,
I have a simple sockets server.
It consists of a CAsyncSocket socket with which I accpet requests. Then I create per each source a thread, attaching to it a socket which keeps the connection to my client.
I use the regular socket callbacks like: OnConnect, OnReceive, etc.
The problem is that out of, lets say, 1000 requests, there are about 1% missing. With wireshark it seems that the requests arrives to my server pc, but on OnReceive I don't see any evidence of that.
OnRecieve() basically has CAsynSocket::Receive() and queus any packet that is received.
Also , CAsyncSocket::Receive() uses a large enough buffer for all possible requests.
Any advise would be blessed.
Thanks.
|
|
|
|
|
This is impossible.
TCP is guaranteed not to behave like that.
I did many of such tests like in : http://www.pushframework.com/?page_id=435[^]
and no data is lost.
Note that in TCP, if a packet is lost, it is resent and if the process repetitively fail, the whole connection fails.
Push Framework - now released !
http://www.pushframework.com
|
|
|
|
|
He never says he's using TCP... he said socket... there's other types of sockets such as UDP that do not guarantee the data, but since the data isn't guaranteed anyway, this shouldn't be a shock.
|
|
|
|
|
Actually it is implied because with UDP you do not use Create and Receive, he also mentions keeping a connection which you do not do with UDP as it is a connectionless protocol.
|
|
|
|
|
You still establish a socket... you just don't go through a connection with the external client or server...
|
|
|
|
|
I know that you still establish the socket I meant to type that he stated he was using connect and accept which implies that he is using TCP not UDP.
|
|
|
|