|
the return value is 0. send me peace of code so that I can understand
clearly
RajeshGupta
|
|
|
|
|
Hi
I am in great trouble and still could not find the answer how to
rewind the wmv file.
RajeshGupta
|
|
|
|
|
still I could not able to rewind the file . can any one give me more help
that is explaned above with the help of some piece of source code.
RajeshGupta
|
|
|
|
|
I want to post a user defined message WM_PRINTLOG to the Main window in a Dialog based application from another thread started by the dialog.
That messag will be handled By a handler PrintLog(CString message) which prints the string(message) in to the edit box.
My question when i call PostMessage() how can i send the string (message) to the handler.
and how can i get the message at the ON_MESSAGE macro.
Thank you.
KIRAN PINJARLA
|
|
|
|
|
kiran.pinjarla wrote: ON_MESSAGE
ON_MESSAGE handlers have the following signature
<code>LRESULT SomeMessage( WPARAM wString, LPARAM lNotUsed )</code>
{
if( !wString )
{
return 0;
}
CString* pString = reinterpret_cast<CString*>( wString );
MessageBox( *pString );
}
UINT SomeThreadFunc( LPVOID lpvParam_i )
{
CString csSomeCString = _T( "Nibu" );
::<code>SendMessage</code>( AfxGetMainWnd()->GetSafeHwnd(), WM_PRINTLOG, reinterpret_cast< WPARAM >( &csSomeCString ), 0 );
}
|
|
|
|
|
Thank you Nibu
KIRAN PINJARLA
|
|
|
|
|
UINT SomeThreadFunc( LPVOID lpvParam_i )
{
CString csSomeCString = _T( "Nibu" );
::SendMessage( AfxGetMainWnd()->GetSafeHwnd(), WM_PRINTLOG, reinterpret_cast< WPARAM >(&csSomeCString ), 0 );
}
Regarding to your comments. For user defined messages, people usually do Posting not Sending as PostMessage will return immedietly and thus lessen the thread delays. Use SendMessage if there is a reason for that.
Actually, your comment about newing and deleting is wrong. It is here we should either avoid of newing in a worker thread by posting it to UI thread or use SendMessage instead [opposed to what is said by comments]. The problem is the race condition [I'd say an obvious race condition]; if you PostMessage a newed object into another thread you may never be away whether that object has been deleted or not. A simple scenario is when the user closes the application jsut after the worker thread has done a PostMessage but before the UI thread ges informed about the message posted. Even with SendMessage you have to use some synchronization to avoid such unfavourable situations.
--
=====
Arman
|
|
|
|
|
Arman Z. Sahakyan wrote: people usually do Posting not Sending as PostMessage will...
...not cause a deadlock if the messagepump receiving the message happens to be in a blocked state.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
kiran.pinjarla wrote: My question when i call PostMessage() how can i send the string (message) to the handler.
Allocate it on the heap.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
hi,
We are trying to place FlexGrid in ATL window(CWnd Inheritance).
Create is successful, but we cannot get Interface properly.
We think that either one or both of the arguments for "QueryInterface" are
incorrect.
iCannot find REFIID in the help header file.j
Please let us know the solution for this.
Thanx & Regards
Ravi
|
|
|
|
|
I have a DISP_FUNCTION as below. the TBF parameter that needs to be filled is an enum value. How do I cater to an enum as a parameter in the DISP_FUNCTION.
DISP_FUNCTION(class, "method",method, VT_ERROR, VTS_I4 VTS_DISPATCH <tbf>)
|
|
|
|
|
I want to have a picture of type .bmp or .ico on my DialogBox. so how can i do that. Can anyone help me. Thanks in advance
Anil Jillella
|
|
|
|
|
On your dialog put picture frame left click than properties, select type (icom, bitmap)then select image (combo box offering you bitmaps or icons from res)!
Hope this was helpful!
|
|
|
|
|
thanks,i myself found the solution.
Anil Jillella
|
|
|
|
|
Add a static control on your dialog box using the resource editor, edit its properties, set its type to bitmap and specify the ID of the bitmap you want to use.
|
|
|
|
|
With a static control you also show jpg file.CStatic has a function
SetBitmap<code> that it gets a hbitmap you can use of CImage class for show jpg files on this control. <br />
<br />
<div class="ForumSig"><div style="padding: 0; margin: 0; background-color: rgba(170, 214, 255, 1); text-align: center; font-family: Arial; font-weight: bold; font-style: italic; font-size: 9pt"><br />
<div style="color: rgba(255, 255, 255, 1); width: 300px"><br />
<hr width="250" size="7">WhiteSky<hr width="220" size="7"></div></div></div>
|
|
|
|
|
AnyOne Give Demo Examples on Cfile
|
|
|
|
|
|
prefer ofstream to cfile. In both cases, try google.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Scroll up.
Thou will see a search box.
Enter "CFile" in the text box.
Press enter.
|
|
|
|
|
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.
|
|
|
|
|
|
I am compile my project in VC++ 6.0. There is no error.After compile it shows:
Loaded 'ntdll.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\kernel32.dll', no matching symbolic information found.
Loaded 'D:\VMC PROJECTS SOURCE\VMC RnD Projects\GScannerAppSuite\VMCGScannerAppSuite\GridPenManager.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\user32.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\gdi32.dll', no matching symbolic information found.
Loaded 'D:\VMC PROJECTS SOURCE\VMC RnD Projects\GScannerAppSuite\VMCGScannerAppSuite\ESCamLib.dll', no matching symbolic information found.
Loaded 'C:\WINDOWS\system32\winmm.dll', no matching symbolic information found.
The thread 0xBAC has exited with code 0 (0x0).
The program 'D:\VMC PROJECTS SOURCE\VMC RnD Projects\GScannerAppSuite\VMCGScannerAppSuite\VMCGScannerAppSuite.exe' has exited with code 0 (0x0).
But program do not Run or execute.The interesting thing is that I am creating a new dialog based project as a same name "VMCGScannerAppSuite" the same thing is happened. But other project is running in VC++ 6.0 well.
can anyone tell me plz what happened....
|
|
|
|
|
Well, your application seems to start since it loads some required DLLs.
Try putting a breakpoint in InitInstance() , step through the code and see what happens.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote "High speed never compensates for wrong direction!" - unknown
|
|
|
|
|
Nothing is happened. When I pressed F5 the previous message is shown in the
Output window.
|
|
|
|