|
There are several example programs in the platform SDK that use multiple threads.
Stephen
|
|
|
|
|
Hi
I have an CFrameWnd that i use in an Ext. DLL
The problem is, when is cleans up, i get an error
with the heap. (something with not local heap)
Have any one an solution ?
pFrame->Create(NULL,
_T("Print"),
WS_OVERLAPPEDWINDOW,
CFrameWnd::rectDefault,
AfxGetApp()->m_pMainWnd,
MAKEINTRESOURCE(IDR_PRINTMENU));
// start the modal loop
pFrame->RunModalLoop(MLF_SHOWONIDLE);
pFrame->DestroyWindow();
|
|
|
|
|
I want copy items from the tree view (in application) to a Desktop or explorer,
but i don't know.
I want a sample please.
|
|
|
|
|
I want copy items from the tree view (in application) to a Desktop or explorer,
but i don't know.
I want a sample please.
|
|
|
|
|
I'd appreciate a pointer here, MSDN, VC++6 docs, etc., to where the structure or field definitions are shown for the varios types of strings in the resouce string tables. I'm looking for "this is the title, this is the default extension" type info so I can edit these with the string table resource edititor
|
|
|
|
|
I am using this call to print a bitmap from one picture box to another:
BitBlt(*m_Field.GetDC(), 0, 0, 48, 48, *m_Skin.GetDC(), 0, 0, SRCCOPY);
this works but it doesn't get repainted.. for example when I minimize the dialog or drag another window on top of it.
anyone know how I can make this auto refresh?
|
|
|
|
|
You need to do it in OnPaint, which is called whenever a window needs repainting.
|
|
|
|
|
Thanks but this doesn't work for me. I tried reBlting it in OnPaint() but this didn't make it refresh all of the time.. only when going off the screen and back on.. but not when minimizing and restoring and other situations. I'm sure there has to be a proper way to do this. Any examples or suggestions?
|
|
|
|
|
Greetings. I am interested in thoughts and advice on parallel ports. I have equipment that is controlled thru the LPT1. Under DOS, I used the biosprint function, which is now defunct in C++.
I have tried using CreateFile and WriteFile in MFC, but have found Windows 98 to be very finicky about allowing the user to directly control the port - I can verify that the data has been sent to the port using CreateFile and WriteFile, but my equipment does not respond. Yet, I can go to the DOS prompt on the same machine and use the old functions and the equipment responds immediately. (But to fit in with the rest of the program, I have to do this in Windows 98)
Does anyone have suggestions or experience sending integer data to the LPT1 - or ideas about where I am going wrong?
Thanks in advance.
|
|
|
|
|
Hi,
I want to draw MDI child outside MainFrame..
How can I implement this?
I searched all the MSDN and other sources just to fail..
Any suggestion will be appreciated..
Thanks in advance!!
Regardz
-Ryan
|
|
|
|
|
Hi all,
I have a textbox (Microsoft Forms 2.0 ActiveX control). I want to do something after user press down arrow keys (VK_DOWN). when i used classwizard to add the event on the textbox, here is the function:
void CSubtitlerView::OnKeyDownMytextbox(LPDISPATCH KeyCode, short Shift)
{
// TODO: Add your control notification handler code here
}
I have no idea how to get the key information from KeyCode. Can anyone help me?
|
|
|
|
|
Hello, I have a problem using my .exe on a computer other than mine. Everything works fine on my computer. When the user right clicks to get my popup menu an application error pops up which states "Memory could not be read". I've narrowed the problem down to the line of code where I call TrackPopupMenu. Here is the line:
menu.GetSubMenu(0)->TrackPopupMenu(TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_RETURNCMD, point.x, point.y, this, NULL);
Do I need a dll? Can anyone help? Thank You
|
|
|
|
|
Hi,
I want to write one small scree saver application.
what are the basic interfaces to built screen saver?
Give me sugestion how to proceed this one?
Thanks,
-- Koteswara rao
|
|
|
|
|
|
Helloo..
I have to write an application that stay listening on the input line of a sound card (like Microphone) and when receive something starts to register it in a file on disk.
There are any ActiveX that already do this? If not, how can I access the status of the input line of a sound card?
Thanks to all You........
|
|
|
|
|
Hello Norbert:
There are a couple of ActiveX controls that could do this.
Visual C++ comes with a registered multi-media control - you can get info on it by looking under your registered ActiveX controls and clicking on MS Communications Control.
If you need more flexibility and ActiveX controls that easily fit into dialog boxes, you might try TegoSoft. You can look over their ActiveX controls at www.tegosoft.com
If you are looking for some very simple classes that you can include in your project to set levels automatically, I can point you in some directions. Email me at:
<myles_k@email.com>
Regards,
Myles
|
|
|
|
|
I'd like to send e-mails in HTML format with MAPI if possible. I'd appreciate any pointers on this/example code.
Thanks,
Mark.
|
|
|
|
|
Hi All,
I am working on a telecom project.
I am facing CPU 100% problem.
Can any one tell me different reasons for a system CPU to reach 100%. I am reading a telephon number from a text file after that dialing the same number. After successfully done I am deleting the text file and updating the counter in DataBase (SQL). All these operations are done within a thread. The Application is a multithreaded application. I am not able to trace why the system CPU is reaching 100%.
OS is Windows NT.
Waiting for your suggestion(s).
Thanks in Advance.
Kumar.
|
|
|
|
|
In multithreaded programming, you must be careful not to monopolize the CPU. The OS of course looks after scheduling, but it's up to you to let the OS know that you don't need every available timeslice for your loop.
A simple thing to do is to Sleep() your thread for a reasonable period of time between checks to see if it has work to do.
As a simple test, try putting Sleep(500) somewhere inside your loop and see what kind of effect it has on your CPU usage. You likely should architect a more elegant solution than a simple Sleep() call, one that better matches your program logic, but this should get you started.
You should also check out WaitForSingleObject() and its cohorts, it may make sense for your app.
|
|
|
|
|
If the application is multithreaded, I would guess that one of the threads is spinning in a while loop, possibly waiting for something to happen. With a thread procedure like:
while(1)
{
WaitForSingleObject(..., 0) <- zero timeout
}
You can get 100% CPU utilization in a thread.
Changing the timeout to 1 millisecond will fix this.
Another possibility is that a thread in the database driver is using 100% of CPU time or something is polling and wating for the phone to connect. Hope this helps
Peter
|
|
|
|
|
I try and create a thread that will loop the GetMessage,TranslateMessage,DispatchMessage commands,
but the thread only executes the loop once, and then exits. Someone told me you have to create a "GUI
thread" to do that. How to you make a GUI thread then?
--Dave
|
|
|
|
|
As fas as I know,
GUI thead is a thread that has a message pump..
No more than that..
So check your callback procedure of the thread...
Make sure you do not break the loop of message pump..
It will be broken automatically by WM_QUIT..
After testing this, give me a THREAD to this posting..
Regardz
-Ryan
|
|
|
|
|
Hello there,
I have created a treeview that reads the local drives using GetLogicalDrives() method....
However, I would like to make this treeview capable of reading UNC type of paths.
I have tried a few different things, but none of them seem to be working. I would appreciate your feedback.
thanks
|
|
|
|
|
Hi,
Right now I am using GDI function CreateDC("DISPLAY", NULL, NULL, NULL) to capture the screen (desktop). However, it's too slow. I am
thinking there must be a way in DirectDraw to do this. I tried with IDirectDraw7::GetGDISurface(), but was not successful. To my best understanding, desktop surface exists in video memory somewhere but I don't know how to access it. Do you know if it's possible at all to capture this surface with DirectDraw, particularly with
IDirectDraw7::CreateSurface()?
Thank you very much for your time!
kk9
|
|
|
|
|
Hi,
I got a printing class and each time when a page finish printing the printer alway advances automatically to the next page.
I love to find some command to stop this advance (just for special purpose)
I am using
//my code here
CDC *ptrdc;
......
ptrdc->StartDoc (&doc);
ptrdc->StartPage();
.......
ptrdc->EndPage(); // I thougt this command will stop!!
ptrdc->EndDoc();
.......
Thank you,
Brian
|
|
|
|