|
|
|
Hi i'm trying to write a small screensaver file with a swf file embeded inside.
I'm trying to run a screensaver but before it activates it changes the res of the monitor to 800x600 but im havin no luck can anyone help please
Max101
|
|
|
|
|
|
hello,
i am developing a project that needs to create 2d and 3d graphs using visual c++. please help me . what is the process??
sriv
-- modified at 8:19 Wednesday 28th June, 2006
|
|
|
|
|
|
I want to get the list of all the unsuccessful or broken installation in a computer. Is there any registry key from where i can get the list of all the unsuccessful or broken installation?
Can you please suggest any approach, that may be helpful in this context?
Thanks in advance.
|
|
|
|
|
Sorry. There is no egistry key from where you can get the list of all the unsuccessful or broken installations.
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
Hi,
I have developed a MFC ActiveX control and embeded it in IE. The control is working fine but when another instance of IE is opened using Ctrl+N, I am getting ASSERT exception in debug mode and in Release mode IE crashes.
Note that if the second instance is opened without using Ctrl+N (i.e by using explorer icon) no exception arrises.
what could be wrong. your support is highly appreciated.
Thanks
Muhammad Azam
|
|
|
|
|
Hi,
In my application i need to generate an html page on-the-fly. The page is preseneted in the application's internal (iexplorer 6.0) browser.
Of course, i can generate a text file with all the html tags and all that is required, but i'm sure there's a more elegent way of doing so.
I couldn't find any on the web.
Does anybody have a lead?
Cheers in advance.
Snir Yarom
Singleton Technonlogies Ltd.
|
|
|
|
|
You can set the text directly to the brwser document right? I think most of the Dlls (e.g Team Track) generating HTML pages are doing in same way. Anyway for that purpose, you dont need to write to a file. Only need to keep that buffer generated.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
Sarath is saying right. You do not have to generate a file. there is simple way.
You can get the interface IWebBrowser2 of the IE.
from that get the interface IHtmlDocument2 of the IWebBrowser2.
call the function write of the above interface.
IHtmlDocument2::write( "text" )
But this code will work onlt in COM
|
|
|
|
|
Hi,
An elegent way could be, have your data in xml format, write an xsl file that will transform your data from xml to html and display that html in webbrowser
Your can search for IDOMDocument interface for transformation of xml through xsl into html .
hope this satisfies you
Thanks
|
|
|
|
|
Hi all,
I have strange error during serialization. I do the following:
ar << m_nTime; // (Value typically > 120000)
ar << m_bFlag; // (type BOOL)
and the m_bFlag always returns as 0;
If I do the following:
ar << m_nTime;
int tmp;
tmp = m_bFlag ? 1 : 0;
ar << tmp;
everything works fine.
I'm certainly a little confused and if anyone has some ideas that would be great.
Thanks
Tom
|
|
|
|
|
_Tom_ wrote: ar << m_nTime;
int tmp;
tmp = m_bFlag ? 1 : 0;
ar << tmp;
it seems that you are trying to do this...
int tmp;
tmp = m_nTime ? 1 : 0;
ar << tmp;</blockquote>
Im not sure whether i've answered you.
if you explain, what you are trying to do will be more useful.
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
-- modified at 6:59 Wednesday 28th June, 2006
|
|
|
|
|
I don't think BOOL is one of the data types supported by CArchive. I usually treat my BOOL types as a flag in a BYTE or DWORD when serializing or something to that effect.
|
|
|
|
|
Much scraping for nothing.
BOOL is a type defined in WINDEF.H
typedef int BOOL;
and CArchive has an operator
CArchive& operator <<(int i);
Ovidiu Cucu
Microsoft MVP - Visual C++
|
|
|
|
|
Fair enough. I stand corrected.
I guess because it wasn't in the MSDN list for CArchive, so I just assumed...
Anyway, to save face, Serializing a BOOL (int) will take up 4 bytes in the file which can get excessive if there are many BOOL's in many objects. Storing as many of these as flags in BYTE's or DWORD's will prevent waste.
Good day and thanks for the correction.
|
|
|
|
|
Sincerely, me personal, I wolud like to prefer wasting few bytes than wasting time and adding extra code.
Although, that's not so big subject to argue...
Have a nice day!
Ovidiu
|
|
|
|
|
After reading the API for PeekMessage, this only works with the message queue of the current thread. I have tried using this function in another thread, and passing the HWND of the MainApp´s window and this does not work. (If I have understood the MSDN correctly, this is the correct behavour). Is it possible to peek into the message queue of another thread?. For example
UINT ThreadProc(LPVOID pVoid){
MSG msg;
struct_t* pS = reinterpret_cast<struct_t*>(pVoid);
HANDLE hEvent = CreateEvent(NULL, TRUE, FALSE, _T("NAMED_EVENT");
ASSERT(NULL != hEvent);
if(NULL == hEvent){
return 1;
}
DWORD dwWait = 0;
BOOL bContinue = TRUE;
while(bContinue){
dwWait = WaitForSingleObject(hEvent, 1000);
switch(dwWait){
case WAIT_TIMEOUT:
while(::PeekMessage(&msg, pS->hWnd, NULL, NULL, PM_NOREMOVE)){
bContinue = pS->pThread->PumpMessage();
}
break;
case WAIT_OBJECT_0:
bContinue = FALSE;
break;
}
}
return 0;
}
struct_t is just an example of what I am passing. The HWND of the main application window, and pThread the CWinThread of the main application.
Any suggestions would be appriciated...
Thanks
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
TRY ATTACHING THE HWND TO A CWnd object.
so you can get the message queue.
CWnd wnd;
wnd.Attach(hwnd);
......
wnd.Detach();
SaRath.
"It is your attitude, not your aptitude, that determines your altitude - Zig Ziglar."
My Blog | Understanding State Pattern in C++
|
|
|
|
|
No, I have tried that and it does not work. The PeekMessage (I think) is still looking in the current threads message queue (i.e. the worker thread). This is not the result I need.
I have tried also the following:
BOOL CMainFrame::FudgeForceRedrawOfMainWindow(){
MSG msg;
while (::PeekMessage(&msg, NULL, // pump message until none
NULL, NULL, PM_NOREMOVE)) // are left in the queue
{
AfxGetThread()->PumpMessage();
}
return TRUE;
}
A function to see if there are any messages pending in the App´s message queue
BOOL CMainFrame::IsMessageQueueEmpty(){
// QS_ALLINPUT
// ***********
DWORD dwState = GetQueueStatus(QS_ALLINPUT);
if(HIWORD(dwState) == QS_ALLEVENTS){
return FALSE;
}
// Nothing of interest
// ******************
return TRUE;
}
Calling this function in my worker thread instead of ::PeekMessage(....) i.e. in the ThreadProc
Changed the structure passed to include a CMainFrame pointer pxFrame
...
case WAIT_TIMEOUT:
while(!pxFrame->IsMessageQueueEmpty()){
pxFrame->FudgeForceRedrawOfMainWindow();
}
break;
...
When called from the tread, the FudgeForceRedrawOfMainWindow() function never has any messages in the queue (in the PeekMessage(...) and therefore the PumpMessage() is never called.
HOWEVER if I call the FudgeForceRedrawOfMainWindow()in the same thread as the MainApp ( in lengthy interations) it works fine!
I´m a bit stumped about this....
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
Exactly what are you trying to do and what is the problem? You could always post a message from your worker thread to your main window (which is owned by your main thread) and do your strange IsMessageQueueEmpty() and FudgeForceRedrawOfMainWindow() thing there, but even without knowing the problem, I think your solution is questionable.
Edit: I was thinking about it, and i only managed to think up one classic mistake in which this would be necessary. Immediately after creating a worker thread, you wait for the worker thread to finish in the main thread which of course means that the main thread is unable to handle messages.
-- modified at 8:50 Wednesday 28th June, 2006
|
|
|
|
|
My Problem is that I have to use CDAO* MFC classes for an application nad they are not multithreaded. Using another library / collection is not an option (boo hoo!). Opening tables and querys using the dereived tables takes (sometimes) ages. During this time, the UI does not process the normal messages (WM_DRAW etc). To get around this, I am trying to create a worker thread that will "Force" the Main window (CMainFrame) to update it´self. Some functions within the CMainFrame have an iterationary style, therefore I can call my "FudgeForceRedrawOfMainWindow()" every n steps in the iteration. Unfortuntly, the DB functions are not, for example CDaoDatabase.Execute(...); That is why I am trying to call the "FudgeForceRedrawOfMainWindow()" from a worker thread, i.e. create the worker thread before calling the function (CDaoDatabase.Execute(...)) and then closing the thread once the function returns.
Trying to post a message from the worker thread to the main thread (Registerd windows message WM_USER+n) does not work as they are not processed. Until AFTER the CDao* function returns.
Hope this answers your question, and that is why I cannot do it any other way, and why I have posted my problem here...
Phil
bum... and I thought I´d got rid of all the bugs
|
|
|
|
|
You can't get your main thread to redraw as it has to wait for CDaoDatabase.Execute(...) to return.
You got the idea upside down. The worker thread is the one that should perform your lengthy processing ie. CDaoDatabase.Execute(...) should be in the worker thread and not the other way around. If you only wish to have one query execute at a time you can always disable the main window (and maybe pop up a progress bar window - one of those in which the progress just bounces left and right) before you start the thread. And re-enable the window (and kill the progress bar window) when the worker thread posts a message to the main thread that the execution has completed.
-- modified at 9:03 Wednesday 28th June, 2006
|
|
|
|