|
vgrigor wrote:
Creation and Showing window is finished,
and window ready to work and working ?
I dont think there is a any that kinda message, but there is a workaround for this...
If i assume that you are talking about dialog window.
You need to do the following steps.
1.Define a custom window
#define WM_MYMESSAGE WM_USER + 1
2.Then at the end of the OnInitDialog you post this message
PostMessage(WM_MYMESSAGE,0,0);
3. Add a message handler for the message in the message map.
...
ON_MESSAGE(WM_MYMESSAGE,OnMyMessage)
...
4. Implement the function.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
I had a similar problem when starting up a program (Acrobat Reader) and wanted to wait until it had finished convulsing before trying to diddle it. I stumbled upon WaitForInputIdle() . Here is a working example of using it:
STARTUPINFO startupInfo;
PROCESS_INFORMATION processInfo;
::ZeroMemory(&startupInfo, sizeof(startupInfo));
startupInfo.cb = sizeof(startupInfo);
::ZeroMemory(&processInfo, sizeof(processInfo));
char cmd[MAX_PATH + MAX_PATH + 5];
sprintf(cmd,"\"%s\" \"%s\"", szExe, pdfFile);
BOOL startedOK = CreateProcess(
NULL,
cmd,
NULL,
NULL,
FALSE,
0,
NULL,
NULL,
&startupInfo,
&processInfo);
if(!startedOK)
{
ShowLastError(cmd);
return;
}
<big>WaitForInputIdle(processInfo.hProcess,INFINITE);</big>
Of course, this is assuming the windows you're interested in are in another process...
|
|
|
|
|
Imagine, if such a mad people will decide how to
hang on real people really ?
(Biting infinite)
average dog is better. Only want to bite once.
|
|
|
|
|
i guess PeekMessage can be used for this purpose.
Gurmeet S. Kochar
If you believe in God, it's because of the Devil
|
|
|
|
|
I developed an database application using VC++ and Micorsoft Access driver as the ODBC source. There are 2 threads in the application both accessing the same table. The first thread writes data in the table and the second thread reads and deletes data from the table. Here is a snapshot of the code of the second thread:
while (!attackRecSet->IsEOF())
{
.
.
.
.
.
.
try
{
attackRecSet->Delete();
attackRecSet->MoveNext();
} //try
catch(CDBException *e)
{
MessageBox(NULL, e->m_strError, "Error", MB_OK);
e->Delete();
} //catch
} //while
An error message occurs because of the delete function and the thread stops working. the error message is:
" Could not update; currently locked by user 'admin' on machine ISLAM_COMPUTER'. "
and when I press OK the following message occurs for ever (it reoccurs if I press the OK button):
" Invalid cursor position; no keyset defined. "
If I commented the delete function the thread will work perfectly. I searched the MSDN for an explanation but with no use. Could anyone tell where could I find an explanation for this error.
Islam Hegazy
islam
|
|
|
|
|
You need to use syncronization objects like Mutex or CriticalSection to ensure that only one thread works with the database system.
MSN Messenger.
prakashnadar@msn.com
"If history isn't good, just burn it." - Sidhuism.
|
|
|
|
|
Hi all!
In my aplication I have an edit box (1) where the user can add text that will appear in other edit box (2). In (2) each text is concatenated with prior one, but when I try to concatenate "\n" so the next text appear in a new line, I get a strange character between two texts instead of a new line. The edit box (2) is a read-only one and Want_Return mode is selected. How could I concatenate the texts so each one appears in new lines?
Thank you in advance.
|
|
|
|
|
satcat wrote:
...I get a strange character between two texts instead of a new line.
Are you using the ES_MULTILINE style?
satcat wrote:
How could I concatenate the texts so each one appears in new lines?
Use \r\n instead.
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
You need to use ES_MULTILINE style and should append "\r\n", rather than just the line feed.
onwards and upwards...
|
|
|
|
|
In a function i am doing following things
Function starts
<br />
CBitmap *pWFRBitmap = pDoc->m_Analyzer.GetWFRBitmap();<br />
pWFRBitmap->CreateCompatibleBitmap(&ClientDC, 860, 1100);<br />
ClientDC.SetMapMode(MM_LOENGLISH);<br />
<br />
CDC MemDC;<br />
MemDC.CreateCompatibleDC(&ClientDC);<br />
MemDC.SelectObject(pWFRBitmap);<br />
MemDC.SetMapMode(MM_TEXT);<br />
MemDC.SetMapMode(MM_LOENGLISH);<br />
Function ENds
1.0 What exactly will happen. To the bitmap in CAnalyser and MemDC. Will the content of MemDC will be written to CBitmap which is attached to MemDC.
2.0 What will happen if every thing remains same and i make CDC MemDC global?
3.0 I want to make another function in CAnalyser like SetBitmap and want to assign the content of the CDC MemDC (global) to assigned to that CBitmap member of CAnalyser m_WFRBitmap so that i can draw the bitmap again whenever my screen get redrawn instead of carrying out complete drawing process again and again.
How to do this?
Leave your mark wherever you go
|
|
|
|
|
1.0 Yes! Because MemDC contains your bitmap and therefore is draw on your bitmap. Before calling CreateCompatibleBitmap() make sure that the bitmap does not already exist or you will have problems. DO NOT for get to restore the origanal bitmap to the MemDC after drawing to it.
2.0 & 3.0 The only reason for making MemDC global is so you will not have to call CreateCompatibleDC() more than once. You will still need to clean it up after evey usage though. That is call SelectObject(pOldBitmap) after drawing to bitmap or using MemDC to blit the image to the client area.
Lookup CDC::CreateCompatibleDC() in the MSDN library (there is sample code there)
INTP
|
|
|
|
|
How to detect that background under child window is changed?
Problem is following:
I use owner-drown CStatic ( rectanule) as
surround rectangle, but fill the background under it.
In CDialog:: OnEraseBackground,
I call that CStatic::OnEraseBackground.
At first time all controls appears,
but next, if I move some window around that CStatic:
controls are under backgrounf - do not know that background is filled and
not redraw self - so thay are hide under filling.
How for child windows to know that background is changed ?
I use a collection of controls that placed within filled CStatic rectangle,
so I can command
Invalidate(0);
UpdateWindow(); for each.
But this is not helps.
How to renew controls when background owner-drawn change
(in CStatic::OnEraseBackground ) ?
Helps if I command to renew full CDialog, but it happens at too much cost of renewing all controls , not within desired rectangle,
but result need as in that case.
How to achieve it ?
thanks you.
|
|
|
|
|
I have server with several network card. I need to route messages (in my server software) from one of them to another. And I need to include my server machine ip in the messages. How to obtain interface ip from destination ip ?
Thank you in advance.
|
|
|
|
|
If you use winsock and ping (echo request) the destination the echo reply will have the IP of your i/f in its destination address of the tcp packet.
Ant.
|
|
|
|
|
I think you want GetBestInterface , from the IP Helper API. You can then use GetIpAddrTable to determine the set of IP addresses for that interface.
If you're designing this protocol, though, I recommend that you don't include the IP address in the message. Your protocol won't work across Network Address Translation (for example, from a private to a public network), and it won't work on IPv6 networks. The client should already know which server it's connecting to.
If the server needs to know the IP address of the client, you should pass a sockaddr_in structure to accept (for TCP connections), or use recvfrom for UDP-based protocols. Use sockaddr_in6 for an IPv6 socket.
Stability. What an interesting concept. -- Chris Maunder
|
|
|
|
|
Hi all,
I just want to change the mouse cursor of the entire SDI to special (custom) cursor.
I tried a lot of thing, but it doesnt work. Any ideas?
Thanks,
Paul
|
|
|
|
|
Hi
1)Override OnSetCursor of CView
2)Add ::SetCursor(AfxGetApp()->LoadStandardCursor(IDC_WAIT));
3)Remove the base class call CView::OnSetCursor
4)Add return TRUE;
rgds ...mil10
|
|
|
|
|
Hi,
I'm interested in porting some mac c++ code to PC. I use al lot of heavy vector math. There are, probably, libraries for this. But how do you use them all, so you don't have to create new applications or new code for every processor? (p3, p4, athlon, athlon xp, etc.)
Does anyone know if there are templates, macros or something for this?
I just looked at OptiVec (http://www.optivec.com/), does anyone have some experience with this?
Great to hear something, some pointers/url/etc,
Best Regards,
Aram
|
|
|
|
|
I can't understand how C++ vector math can be different under different processors.
Ant.
|
|
|
|
|
The only difference could be when you use SIMD instructions.
Don't try it, just do it!
|
|
|
|
|
OK, I'll put it like this.
I'm using SIMD instructions, are there some libaries which will convert my high-level code to the proper (processor dependent) low-level machine code, in order to get the fastest vector math possible on every PC processor?
Or do I need to build this in my self, checking which processor and then applying the right optimized vector code for that one?
what about www.optivec.com, could this be where I am looking for?
thanks!
|
|
|
|
|
Hi,
Does someone knows how to make a subst programmaticaly in c++ under WNT4 ?
Thanks
|
|
|
|
|
I've not ever used the DOS subst command, but are you needing WNetAddConnection() , or maybe WNetUseConnection() ?
"The pointy end goes in the other man." - Antonio Banderas (Zorro, 1998)
|
|
|
|
|
I was talking about the subst.exe command.
I had a response : it's the DefineDosDevice(...) function.
Thanks
|
|
|
|
|
how to detect the change in the address bar of IE from VC++ program.
|
|
|
|