SetWaitableTimer/SetTimer call back is not getting called

I have created a worker thread using CreateThread() 
function. I created a Timer Event using 
CreateWaitableTimer. I set the timer event using  
SetWaitableTimer and I include a call back function to be 
called when the timer expired. However, I do not hit the 
call back function. Is there any special code I need to add
for this? Here is the snippet from my code.

void CreateSTEventsAndThreads()
{
  DWORD IDThread;
  stThreadEvents[0] = CreateEvent(NULL, FALSE, FALSE, 
NULL);
  timerEvent  = CreateWaitableTimer(NULL, 
FALSE, "WaitableTimer");	
  stThreadHandle = CreateThread(NULL, 0, 
(LPTHREAD_START_ROUTINE)ThreadFn,&stThreadEvents, 0, 
&IDThread);
  if (stThreadHandle == NULL) {}
}

UINT ThreadFn(LPVOID param)
{
  DWORD waitResult;
  while (TRUE) {
  waitResult = WaitForMultipleObjects(1, stThreadEvents, 
FALSE, INFINITE);

  switch (waitResult) {
  case WAIT_OBJECT_0:
     LARGE_INTEGER liDueTime;
     liDueTime.QuadPart=-100000000;
     if (!SetWaitableTimer(timerEvent,&liDueTime, 0, 
TimerProc, NULL, 0)) { }
     return 0;
}

VOID CALLBACK TimerProc(
  LPVOID lpArgToCompletionRoutine,  // data value
  DWORD dwTimerLowValue ,            // timer low value
  DWORD dwTimerHighValue            // timer high value
)
{
	BOOL rc;
	// do stuff
        return;
}

I am not hitting the TimerProc function. Any ideas why?

Tx

0
skamarsu (3)
7/15/2003 11:46:00 PM
vc.mfc 33608 articles. 0 followers. Follow

3 Replies
2794 Views

Similar Articles

[PageSpeed] 31

Read SetWaitableTimer description. You will find the 
answer.

>-----Original Message-----
>I have created a worker thread using CreateThread() 
>function. I created a Timer Event using 
>CreateWaitableTimer. I set the timer event using  
>SetWaitableTimer and I include a call back function to be 
>called when the timer expired. However, I do not hit the 
>call back function. Is there any special code I need to 
add
>for this? Here is the snippet from my code.
>
>void CreateSTEventsAndThreads()
>{
>  DWORD IDThread;
>  stThreadEvents[0] = CreateEvent(NULL, FALSE, FALSE, 
>NULL);
>  timerEvent  = CreateWaitableTimer(NULL, 
>FALSE, "WaitableTimer");	
>  stThreadHandle = CreateThread(NULL, 0, 
>(LPTHREAD_START_ROUTINE)ThreadFn,&stThreadEvents, 0, 
>&IDThread);
>  if (stThreadHandle == NULL) {}
>}
>
>UINT ThreadFn(LPVOID param)
>{
>  DWORD waitResult;
>  while (TRUE) {
>  waitResult = WaitForMultipleObjects(1, stThreadEvents, 
>FALSE, INFINITE);
>
>  switch (waitResult) {
>  case WAIT_OBJECT_0:
>     LARGE_INTEGER liDueTime;
>     liDueTime.QuadPart=-100000000;
>     if (!SetWaitableTimer(timerEvent,&liDueTime, 0, 
>TimerProc, NULL, 0)) { }
>     return 0;
>}
>
>VOID CALLBACK TimerProc(
>  LPVOID lpArgToCompletionRoutine,  // data value
>  DWORD dwTimerLowValue ,            // timer low value
>  DWORD dwTimerHighValue            // timer high value
>)
>{
>	BOOL rc;
>	// do stuff
>        return;
>}
>
>I am not hitting the TimerProc function. Any ideas why?
>
>Tx
>
>.
>
0
alegr (1131)
7/16/2003 1:08:50 AM
This code is pretty grotesque, so it should be cleaned up. See below...
On Tue, 15 Jul 2003 16:46:00 -0700, "Gek" <skamarsu@yahoo.com> wrote:

>I have created a worker thread using CreateThread() 
>function. I created a Timer Event using 
>CreateWaitableTimer. I set the timer event using  
>SetWaitableTimer and I include a call back function to be 
>called when the timer expired. However, I do not hit the 
>call back function. Is there any special code I need to add
>for this? Here is the snippet from my code.
>
>void CreateSTEventsAndThreads()
>{
>  DWORD IDThread;
>  stThreadEvents[0] = CreateEvent(NULL, FALSE, FALSE, 
>NULL);
>  timerEvent  = CreateWaitableTimer(NULL, 
>FALSE, "WaitableTimer");	
****
Use NULL for the last parameter. You don't need a name
*****
>  stThreadHandle = CreateThread(NULL, 0, 
>(LPTHREAD_START_ROUTINE)ThreadFn,&stThreadEvents, 0, 
>&IDThread);
*****
Get rid of that ugly cast. If the compiler won't accept ThreadFn without the cast, your
function is erroneous and needs to be changed. Since stThreadEvents is an array, putting &
in front of it is incorrect. Calling CreateThread is almost certainly a mistake in MFC. 

	stThread = AfxBeginThread(ThreadFn, stThreadEvents);

is what you should have written!
*****
>  if (stThreadHandle == NULL) {}
>}
>
****
Read the documentation of CreateThread. What you have here is garbage. I see no call
linkage declaration. The CreateThread function CLEARLY documents that the prototype should
be
	DWORD WINAPI
and you have
	UINT
which is a serious error. Your misuse of a cast disguises this blunder by demanding the
compiler accept your erroneous definition.

Note that what you have writte WOULD be correct had you used the correct AfxBeginThread
function, which wants 
	UINT
without a linkage type.

Create a class to hold your handles:
	class handles {
		public:
		handles(HANDLE ev, HANDLE tim) { event = ev; timer = tim; }
 		HANDLE event;
		HANDLE timer;
		~handles() { ::CloseHandle(event); ::CloseHandle(timer); }
	};

then do
	HANDLE event = ::CreateEvent(...);
	HANDLE timer = ::CreateWaitableTimer(...);
	handles * h = new handles(stEvents[0], timer);
	AfxBeginThread(ThreadFn, (LPVOID)h);
now you don't need all those ugly global variables
*****
>UINT ThreadFn(LPVOID param)
>{
>  DWORD waitResult;
>  while (TRUE) {
>  waitResult = WaitForMultipleObjects(1, stThreadEvents, 
>FALSE, INFINITE);
****
Huh? You pass in an array of events and only wait on the first object? Why are you passing
in an array at all? Why not the address of a simple variable? You don't even use the
LPVOID! In fact, it looks like you are using global variables, which is really, really
poor style! This should be
	UINT THreadFn(LPVOID param)
	   {
                 handles * h = (handles *)param;
	    while(TRUE)
 	      { /* thread loop */
                    DWORD result = ::WaitForSingleObject(h->event, INFINITE);
                    switch(result)
                          { /* result */
                            case WAIT_OBJECT_0:
                                  SetWaitableTimer(... };
		        continue;
                          } /* result */

Now the thread will return and block! How do you expect a blocked thread to handle a timer
callback? Instead, don't use a callback, do a
	HANDLE ha[2]; 
	ha[0] = h->event;
	ha[1] = h->timer
	DWORD result = WaitForMultipleObjects(2, ha, FALSE, INFINITE);
	switch(result)	
	    {
	     case WAIT_OBJECT_0: // event fired
	      ...
	     case WAIT_OBJECT_0+1: // timer fired
	     ...
                 }
****
>
>  switch (waitResult) {
>  case WAIT_OBJECT_0:
>     LARGE_INTEGER liDueTime;
>     liDueTime.QuadPart=-100000000;
>     if (!SetWaitableTimer(timerEvent,&liDueTime, 0, 
>TimerProc, NULL, 0)) { }
>     return 0;
>}
>
>VOID CALLBACK TimerProc(
>  LPVOID lpArgToCompletionRoutine,  // data value
>  DWORD dwTimerLowValue ,            // timer low value
>  DWORD dwTimerHighValue            // timer high value
>)
>{
>	BOOL rc;
>	// do stuff
>        return;
>}
>
>I am not hitting the TimerProc function. Any ideas why?
>
>Tx

Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15974)
7/16/2003 4:27:24 AM
Thanks for the input. I was able to get it to work with
your suggestions.

>-----Original Message-----
>This code is pretty grotesque, so it should be cleaned 
up. See below...
>On Tue, 15 Jul 2003 16:46:00 -0700, "Gek" 
<skamarsu@yahoo.com> wrote:
>
>>I have created a worker thread using CreateThread() 
>>function. I created a Timer Event using 
>>CreateWaitableTimer. I set the timer event using  
>>SetWaitableTimer and I include a call back function to 
be 
>>called when the timer expired. However, I do not hit the 
>>call back function. Is there any special code I need to 
add
>>for this? Here is the snippet from my code.
>>
>>void CreateSTEventsAndThreads()
>>{
>>  DWORD IDThread;
>>  stThreadEvents[0] = CreateEvent(NULL, FALSE, FALSE, 
>>NULL);
>>  timerEvent  = CreateWaitableTimer(NULL, 
>>FALSE, "WaitableTimer");	
>****
>Use NULL for the last parameter. You don't need a name
>*****
>>  stThreadHandle = CreateThread(NULL, 0, 
>>(LPTHREAD_START_ROUTINE)ThreadFn,&stThreadEvents, 0, 
>>&IDThread);
>*****
>Get rid of that ugly cast. If the compiler won't accept 
ThreadFn without the cast, your
>function is erroneous and needs to be changed. Since 
stThreadEvents is an array, putting &
>in front of it is incorrect. Calling CreateThread is 
almost certainly a mistake in MFC. 
>
>	stThread = AfxBeginThread(ThreadFn, 
stThreadEvents);
>
>is what you should have written!
>*****
>>  if (stThreadHandle == NULL) {}
>>}
>>
>****
>Read the documentation of CreateThread. What you have 
here is garbage. I see no call
>linkage declaration. The CreateThread function CLEARLY 
documents that the prototype should
>be
>	DWORD WINAPI
>and you have
>	UINT
>which is a serious error. Your misuse of a cast disguises 
this blunder by demanding the
>compiler accept your erroneous definition.
>
>Note that what you have writte WOULD be correct had you 
used the correct AfxBeginThread
>function, which wants 
>	UINT
>without a linkage type.
>
>Create a class to hold your handles:
>	class handles {
>		public:
>		handles(HANDLE ev, HANDLE tim) { event = 
ev; timer = tim; }
> 		HANDLE event;
>		HANDLE timer;
>		~handles() { ::CloseHandle
(event); ::CloseHandle(timer); }
>	};
>
>then do
>	HANDLE event = ::CreateEvent(...);
>	HANDLE timer = ::CreateWaitableTimer(...);
>	handles * h = new handles(stEvents[0], timer);
>	AfxBeginThread(ThreadFn, (LPVOID)h);
>now you don't need all those ugly global variables
>*****
>>UINT ThreadFn(LPVOID param)
>>{
>>  DWORD waitResult;
>>  while (TRUE) {
>>  waitResult = WaitForMultipleObjects(1, stThreadEvents, 
>>FALSE, INFINITE);
>****
>Huh? You pass in an array of events and only wait on the 
first object? Why are you passing
>in an array at all? Why not the address of a simple 
variable? You don't even use the
>LPVOID! In fact, it looks like you are using global 
variables, which is really, really
>poor style! This should be
>	UINT THreadFn(LPVOID param)
>	   {
>                 handles * h = (handles *)param;
>	    while(TRUE)
> 	      { /* thread loop */
>                    DWORD result = ::WaitForSingleObject
(h->event, INFINITE);
>                    switch(result)
>                          { /* result */
>                            case WAIT_OBJECT_0:
>                                  SetWaitableTimer(... };
>		        continue;
>                          } /* result */
>
>Now the thread will return and block! How do you expect a 
blocked thread to handle a timer
>callback? Instead, don't use a callback, do a
>	HANDLE ha[2]; 
>	ha[0] = h->event;
>	ha[1] = h->timer
>	DWORD result = WaitForMultipleObjects(2, ha, 
FALSE, INFINITE);
>	switch(result)	
>	    {
>	     case WAIT_OBJECT_0: // event fired
>	      ...
>	     case WAIT_OBJECT_0+1: // timer fired
>	     ...
>                 }
>****
>>
>>  switch (waitResult) {
>>  case WAIT_OBJECT_0:
>>     LARGE_INTEGER liDueTime;
>>     liDueTime.QuadPart=-100000000;
>>     if (!SetWaitableTimer(timerEvent,&liDueTime, 0, 
>>TimerProc, NULL, 0)) { }
>>     return 0;
>>}
>>
>>VOID CALLBACK TimerProc(
>>  LPVOID lpArgToCompletionRoutine,  // data value
>>  DWORD dwTimerLowValue ,            // timer low value
>>  DWORD dwTimerHighValue            // timer high value
>>)
>>{
>>	BOOL rc;
>>	// do stuff
>>        return;
>>}
>>
>>I am not hitting the TimerProc function. Any ideas why?
>>
>>Tx
>
>Joseph M. Newcomer [MVP]
>email: newcomer@flounder.com
>Web: http://www.flounder.com
>MVP Tips: http://www.flounder.com/mvp_tips.htm
>.
>
0
skamarsu (3)
7/17/2003 12:39:32 AM
Reply:

Similar Artilces:

GET UNIQUE ROWS FROM ONE PAGE TO ANOTHER
I track jobs for techs page one example. Excel 2003 JOB TECH ACCT# STAT ADDRESS 1B 603 162395-7 CP 6844 N DE CHELLY LOOP 3B 617 164655-11 CP 10700 N LA RESERVE DR # 2106 5B 603 267454-1 CP 7270 S SAND DUNE VLY D 4B 634 131976-3 CP 5702 N CAM LAGUNA 3B 609 193005-2 CP 4961 N DIAMOND PL 16B 650 267451-1 XO 9950 N CAM DEL PLATA 1B 636 206822-7 CP 7525 W SUMMER SKY DR 10B 607 120813-8 CP 3028 W WYOMING ST 2B 609 100114-2 RS$ 6430 N MONTROSE DR 3B 603 168731-9 CP 4156 N RIO CANCION # 33 3B 626 231452-8 CP 7990 E SNYDER RD 11 107 I want to take all of ie 603 info in...

Button calling aother button's code
I'm just getting started. How does one call another button's code? In Button2's code, I want to call Button1's click event. I guess I need to pass parameters. The Button1_Click() statement is incorrect. So how does one call code contained in another button? Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click MsgBox("I pressed a button") End Sub Private Sub Button2_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button2.Clic...

backing up outlook to a cd
I just spent 1 1/2 hours reading on this site and various other sites on how to backup outlook . I'M STILL CONFUSED. When I go to the pst file on the c drive and try to open it - I get a " file conversion box - outlook pst" should I be getting something else that I can read. On 2/28/2010 1:24 AM, ray mc wrote: > I just spent 1 1/2 hours reading on this site and various other sites on how > to backup outlook . I'M STILL CONFUSED. When I go to the pst file on the c > drive and try to open it - I get a " file conversion box - outlook pst" > shou...

subtracting a range from another range and getting a range result
I have two ranges of XYZ coordinates. One is named R1 and the other R2. Is there any way in Excell 2002 to bascially say R2-R1=R3 so that R3 is a range the same size as R1 and R2, where each cell in R3 is is subtraction of the corrisponding cells in R1 and R2? Sort of like this: r1= 3,4,5 r2=3,4,5 r3=6,8,10 of course I need to do this on a two dimentional range, there are multiple XYZ points. Are the three values of R1 (3,4,5) in separate cells? Are you adding or subtracting? Please spell out the problem in more detail -- Bernard V Liengme www.stfx.ca/people/bliengme remove caps from e...

how do I get a custom message box to open?
I have a form/subform where I need to have the event and date entered on the main form before information can be entered into the subform. How do I get a custom message box to pop up instead of the generic "You must enter a value in the ... field" when the event and date have not been entered? I think that the order I want to do things in is the following. Help with the actual VBA would be very much appreciated. - What event to use? - check to see if AtEventID is null - do I need this step? Because both the date and event fields are required, Access automatica...

How to get Excel hyperlinks to open in non-IE default browser
Hello. I use an IE browser add-on called MyIE2 (www.myie2.com) which extends the functionality of IE. I have MyIE2 set as my default browser. If I click web site links in Outlook Express e-mail messages, they open in MyIE2, as they should. However, when I set up hyperlinks in Excel spreadsheets, they open in IE. Is there a registry setting or something I can do to cause hyperlinks to open in my default browser (MyIE2)? Thank you. Try Tools > Options > General > Web options >-----Original Message----- >Hello. I use an IE browser add-on called MyIE2 (www.myie2.com) whic...

i can't get outlook to import info from the worksheet it created
I created an Excel worksheet from a contact list in outlook by exporting it. When I add contacts to the same Excel worksheet, outlook won't import the new data. What am I doing wrong? DId you expand the named range on the worksheet to cover the new data?=20 --=20 Sue Mosher, Outlook MVP Author of Configuring Microsoft Outlook 2003 http://www.turtleflock.com/olconfig/index.htm and Microsoft Outlook Programming - Jumpstart for=20 Administrators, Power Users, and Developers http://www.outlookcode.com/jumpstart.aspx =20 "oaksie1" <oaksie1@discussions.mic...

Run a report to get a complete stock valuation for any past date
Currently there is no report available to automatically generate an Inventory Cost (Value) Report for a previous date, for all branches in HQ. ---------------- This post is a suggestion for Microsoft, and Microsoft responds to the suggestions with the most votes. To vote for this suggestion, click the "I Agree" button in the message pane. If you do not see the button, follow this link to open the suggestion in the Microsoft Web-based Newsreader and then click "I Agree" in the message pane. http://www.microsoft.com/Businesssolutions/Community/NewsGroups/dgbrowser/en...

in reply outlook, can't find signatures? how to put it back?
Hi I screwed something up here while trying to set up a signature. I went to reply and when i go to auto text there is no signature! Just signature company. Earlier I tried to apply a signature but my name kept coming on? So I remove my name and initials from Autotext (i don't know why) signatures disapeared. I replaced the init. and name but no change. I want to put a signature on some reply email. Help!! And thanks Brad Bylsma. P/S is there a good manual that looks at things from a, how can a newbie screw up stand point? Or better yet how to restore it to before you screwed i...

get $50,000
!!!!$$$$$$ EASY MONEY AND IT REALLY WORKS! TRY IT AND YOU’LL BE HAPPY!!!!! :0) $$$Take five minutes to read this and it WILL change your life. $$$ I finally decided to read one of these articles in an internet newsgroup describing how to make $50,000.00 in only one month from a $5.00 investment. Of course I thought this was ridiculous, or some type of pyramid. I talked it over with my family, an attorney, and my friends and they all agreed it was some sort of scam. I hate scams because usually someone gets burned, and I didn't want it to be me! I blew it off for a few weeks then ...

Get buffer size of ExAllocatePoolWithTag
Hi, Is there a way to get the size of a buffer allocated with ExAllocatePoolWithTag without having to put your own wrapper around it. Just native support? TIA!! Why in the world would you want this? Either your driver allocated the buffer and should know its size, or the buffer was passed to you with a size. Any other case is bad design, for instance you should not be playing with buffers you don't own, and you should not assume anything about the size of a buffer passed to you beyond what the caller provides. -- Don Burn (MVP, Windows DKD) Windows Filesy...

How do I get all files in any directory?
Hello everyone. Now I'm posting a FAT32 partition reading program. Any directory have 512 files. See next codes: ------------------------------------------------------------------------------------------------------------ for (nLoop = 0; nLoop <= dwSectorPerCluster*16; nLoop++) { if (lpDirEntry[nLoop].Name[0] == 0x00) break; if (lpDirEntry[nLoop].Name[0] == 0xE5) continue; if (lpDirEntry[nLoop].Attribute == 0x0F) { dwLongEntryEn = 1; continue; } memset(szFileName, 0x00, sizeof(szFileName)); memset(szTmp, 0x00, sizeof(szTmp)); if (dwLongEntryEn == 1) { m_F...

protect file from getting deleted
I have made a file in Excel 97. I want to protect it in such a way that nobody should be able to delete it. Nobody should also be able to save another file on it. Can anyone help please There is no way that you can with 100% certaintly prevent a file from being deleted or overwritten. This is why the first three rules of computing are backup, backup and backup. When you are done working on a file, copy it from your hard drive to what ever else you may have access to. IE,a second hard drive, server drive, floppy, CDR, zip disk, USB Key drive. If you don't have access to a...

get an area of the workbook to appear in another
I am sorry, my last post had an unrelated subject line for the below, am posting it again, with the hope that it might invoke the curiousit of some more people. -- Folks, Our office has a workbook which schedules my teams tasks. There is workbook for each year, and each workbook has 12 worksheets - for eac month. Each workbook contains months from Jan to Dec. So the workbook Schedule2004.xls contains 12 worksheets Jan04 to Dec04 The first row in each worksheet contain headings - Date, Mike, Dale Peter, Angela etc From the second row is the data, for ex as show below Date Mike Dale Pete...

Workstation service will not start -- gets error 2
Hi All: Without the Workstation service starting the computer is almost useless. No networking, can't install SpywareDoctor (needs to update itself), Can't install Belkin Easy Transfer Cable for Windows 7 (requires Crypto service which depends on workstation). Can't even look at events. Can't burn CD's. Trying to start the workstation service service gives: Could not start the Workstation service on Local Computer. Error 2: The system could not find the file specified I tried sfc /scannow. It took all afternoon but did not help the issue. My only r...

I cant use smiley central I get a Alien Macromedia.com
I use to be able to use Smiley Central now I cant. I click on it and I get a Alien saying If you can see the animation above, then you have successfully installed the Macromedia Flash Player. and now I cant use the Smiley Central. I'm guessing you can't see the animation... which means flash is not correctly installed or enabled. It's not an outlook problem... -- Diane Poremsky [MVP - Outlook] Author, Teach Yourself Outlook 2003 in 24 Hours Coauthor, OneNote 2003 for Windows (Visual QuickStart Guide) Need Help with Common Tasks? http://www.outlook-tips.net/beginner/ Outl...

How to get Hard disk Capacity and or additional info?
Hi all I want to know the Serial No., Model No. and capacity of the hard disk. I wanted to get these through programming using the Win OS routines. but i don't know through which function and header file inclusion i can do this. Most important thing is to get capacity. Plz anyone have knowlege then plz guide me. Thanks. I think this class might help you. You can download source from this link: http://msdn.microsoft.com/msdnmag/issues/04/01/CQA/ Tom "[Yosi]" <Yosi@discussions.microsoft.com> wrote in message news:7C209728-D2EF-4673-92A4-1BBF308C2945@microsoft.com......

Cant get member server to join domain
member server 2003 sp2, was in old 2000 domain. removed from that domain into a workgroup. changed dns to reflect new domain. now trying to add to 2008 domain and I get a message of "The service cannot accept control messages at this time". Of course it doesnt join the domain either. I had another member server that i pulled out of the same domain and added it with no issue. So WTF? A good place to start troubleshooting this is to look into the netsetup.log file. Andrei Ungureanu www.winadmins.net "Bob Dorn" <bobdorn@hotmail.com> wrote in m...

Why can't use outlook express get mail from hotmail?
"lhf" <wzlhf@zjip.com> wrote in message news:%23l7Re6KSFHA.2680@TK2MSFTNGP09.phx.gbl... > Nothing> Firstly, PLEASE write your question in the body of the post and NOT just the subject Secondly, you need a PAID subscription to Hotmail to be able to use Outlook or Outlook Express, and thirdly, this newsgroup is for support of Outlook 97/98/2000/2002/2003 from the Office suite of products. Outlook Express is actually a separate program despite the similar name. For help with your OE questions, try an OE newsgroup such as microsoft.public.windows.inetexplorer.ie6_out...

Will FlushFileBuffers be automatically called on CloseHandle(hFile)?
To begin with code: HANDLE hFile = CreateFile(...); WriteFile(hFile, ...); ReadFile(hFile, ...); CloseHandle(hFile); My queston is: Can CloseHandle(hFile) make sure that all the cached data of hFile will be flushed to the disk? I googled it and found nothing. Hope someone can give me some tips. Thanks in advance. "xmllmx" <xmllmx@gmail.com> wrote in message news:1187115960.104492.215250@q4g2000prc.googlegroups.com... > To begin with code: > > HANDLE hFile = CreateFile(...); > WriteFile(hFile, ...); > ReadFile(hFile, ...); > CloseHandle(hFile); > >...

Images get distorted when printing
It seems that Excel distorts all images when you print them. They get vertically squeezed. This is not noticeable to most people. But is very apparent when you have a tall image that gets compressed. I have tested this on many computers and get the same result. 1. Start a new document. 2. Draw a "circular" Oval AutoShape. (Click and drag with Shift key held down.) 3. Do a print preview and Bingo! The circles are now ellipses! (They print that way too.) Has anyone experienced this too? Any suggestions for overcoming the problem? Yes, all my images and graphics display and pr...

getting all data about search subject
I have a client that had CRM installed on a server and migrated their ACT database over to it(i came into this on the tail end so i didn't set it up)--whenever they do an account lookup they want to get all the info surrounding that client--emails, images , past correspondances, invoices, quotes etc... they want all this in one click so to speak---in reading these posts two things popped out at me "searchpac 360" and"only the user can bring up what they own or produced" since this firm has several employees on the system all saving and sending info to and abou...

Call Event from Subform
I've figured out how to execute a sub on a subform initiated on the form. [Forms]![Contacts]![ContactsAddresses].Form.btnSave_Click I can't for the life of me figure out how to do the opposite. To execute a sub on the form called from the subform. When I do a search it always talks about controls, not subroutines. Can someone please help! On Wed, 10 Feb 2010 17:50:01 -0800, PeterM <PeterM@discussions.microsoft.com> wrote: Me.Parent.myPublicProcedure Note that the procedure must be public. Click events are Private by default, but you can simply...

Word 2007 how to get data from forms to Excel
I have forms that have been filled out by various people and would like to export the data into an Excel worksheet. This seemed straightforward in Word 2003, but I cannot get it to work in Word 2007. The actual form is a Word 2003 document. When I save the file as a txt file (after Word options / Advanced / Preserve fidelity / check "save form data as delimited text file") it creates the delimited file, but it gets overwritten when I close the original filled form. Any ideas? Thanks. I am having a similar problem, but the "save form data as delimited text...

How do I get Powerpoint 2003 fade in 1 by 1 in 2007
I frequently used the 'fade in one by one' feature in Powerpoint 2003, which allowed me to fade in individual bullet points by way of a click of a mouse. Not only is this feature now not standard in 2007, but I can't work out how to create it: anything that I find, tends, instead, to fade the bullet points in on some kind of automatic time schedule, rather than - as I want - on a mouse click. I want only to use text, no sounds, no pictures, and nothing fancy. Currently, I am reduced to copying my material into an old Powerpoint 2003 presentation, but this is silly....