|
|
Because the event of OnSize takes place first than that of DoDataExchange,so the controls' m_hWnds are null.
I have used the PostMessage(WM_SIZE),it works,but the ADODC control can't move,I don't know why.
Thanks
Nothend
|
|
|
|
|
What happens if you insert ScreenToClient/*for converts coordinates */ after m_AdoDC.GetClientRect(oRect);
m_AdoDC.GetClientRect(oRect);
m_AdoDC.ScreenToClient(oRect);
|
|
|
|
|
It's all the same .
Nothing happen.
Nothend
|
|
|
|
|
Do you mind that I send you a email including the demo code to you?
Nothend
|
|
|
|
|
Nothend wrote: Because the event of OnSize takes place first than that of DoDataExchange,so the controls' m_hWnds are null.
Call UpdateData as first statement in OnSize , which eventually calls DoDataExchange .
|
|
|
|
|
I have tried that ,but it would be error.
It will show error dialog saying that "Debug Assertion Failed",and if I retry,the XP sends me a error report.
Nothend
|
|
|
|
|
Hi,
I have sub classed CEdit and I can get notifications for example in the OnKeyDown function for any VK_XXXXX keys. From some odd reason, the VK_TAB is not responding, any reason why ?
Basically, what I am looking for is to do auto complete Linux type. I already have the data to auto complete and I just want to do it with the TAB key. The problem is that no matter what I tried, the TAB always does what it's "programmed" to do in windows, it jumps to the next field.
Any help is appreciated.
shay
|
|
|
|
|
I think you have to override the PreTranslateMessage() method.
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.
|
|
|
|
|
|
Hi all,
I have creating dialog based window in vc++(MFC) and i installed image magic(dynamic dll of binary version).
I need to know about InitializeMagic(char *) function. Is Magic must be initialize?... when i read one image using read(std::string) function.....
#include <Magick++.h><br />
#include <<iostream><br />
using namespace std;<br />
using namespace Magick;<br />
<br />
void CSampleDlg::OnButttonClick()<br />
{<br />
Image img;<br />
img.read("c:\\logo.jpg");<br />
}
Error will be thrown like......
Unhandled exception at 0x000c256.. in Csample3.exe:0xC000075:
Access voilation writing location 0xcde....
Now i am using VS 2005...
Anybody know about this problem let me know...
Thankx in advance...
|
|
|
|
|
|
I already seen that the Image magic Documetation, but i cant get clearly.
I thing your recently sending links are very useful for me.
I will try it...thank you.
|
|
|
|
|
hi,
I'm facing some problem with the termination of the process.
I have a COM DLL, which intern talks to a drive through a serial communication medium.
And the COM Client, has some 5/6 threads runing.
The problem is, *Some Times* when I close the application, the application never closes.
Some threads of the process are still running, which prevents the usage of the serial port by
the next instance of the application.
Yet another problem is, the problem araises very rarely. Please help me!!
Thanks in advance,
Raja Pratap
|
|
|
|
|
What mechanism are you using to signal to the running threads that its time to stop?
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
Thanks for the reply.<br />
Here is the way I'm terminating.<br />
<br />
1. PostThreadMessage(WM_QUIT, NULL, NULL);<br />
2. dwState = ::WaitForSingleObject(m_hThread, 6000);<br />
<br />
3. if(dwState != WAIT_OBJECT_0)<br />
TerminateThread(m_hThread, dwExitCode);
--
Pratap
|
|
|
|
|
Stack traces of what the application is doing when hung would be a big help. Also, what framework (if any) is being used?
Steve
|
|
|
|
|
Hi all,
I want to use OpenFileDialog Class to open a file in my VC++.NET win32 application. But I am getting this error.
error C2262: 'myFile' : cannot be destroyed
For the code
OpenFileDialog myFile;
Can I know what is wrong with my code I have added using namespace System::Windiws::Forms; in my file.
Thanks in advance,
Priyank
|
|
|
|
|
if you ask this in the right .NET forum you might get better answers.
If you think you can than you can, if you think you can't you are right.
|
|
|
|
|
Wrong forum
|
|
|
|
|
Hi all,
I'm facing the problem with the CoInitializeEx.
I have a COM dll, when the dll is built in the debug mode, and from the client if I debug "User break point called" message box pops up.
The important fact is, the message box pops in a very rare conditions.
I have tested several hundred times in the release mode, but never the problem is faced.
Problem comes only if the DLL is in debug mode.
My dll uses other two DLLS(win32) all(INCLUDING THE COM DLL) uses MFC.
Please let me know the root cause of the problem.
Thanks in advance,
Raja Pratap
|
|
|
|
|
1. The reason why the message box doesn't pop up when you're building for release is probably that it is generated from an ASSERT and the ASSERT macro is disabled when building for release.
2. If you mix a debug-built DLL with a release-built application and you allocate memory in one of them and deallocates it in the other, you will get into troubles. Not only because it is suspect design, but because the memory checking gets screwed up when it checks for boundaries and how much is allocated for each block.
3. Make sure you're linking with the debug-built libraries when building for debug.
4. If none of the above applies to your situation, post again and describe your problem some more. It would be of great help to know where your application crashes and what the call stack looks like at that point.
--
Roger
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
"No one remembers a coward!" - Jan Elfström 1998 "...but everyone remembers an idiot!" - my lawyer 2005 when heard of Jan's saying above
|
|
|
|
|
Dear All,
I have multiple threads in my program. When i execute it, once the thread is started the memory size of program is growing high. The thread is now stopped. still memory that is used by thread is in alive ? I want to reduce that memory usage. How ?
Will susbend thread fn help me ? Kindly tell me what should i do to reduce memory that was occupied by existing thread ...
Thanks..
Nice things do nice works
|
|
|
|
|
I have similar thing with my multithreaded application. When I create for example 100 dialog windows (each on separate thread) and then I close all of them exept main dialog, memory usage falls down but is not equal to the usage before opening those 100 windows. Visual studio does not report any memory-leaks. I suppose that system is allocating memory for the application but is not freeing everything just in case the application would request again some memory. Maybe it's also your case??
Pat.
|
|
|
|
|
Did you allocate a lot of memory that you didn't release ? How is the memory increasing ? Little by little ? If yes, that probably means that you have a memory leak somewhere in your code.
|
|
|
|