Solved

Someone who knows C and VB4

Posted on 1998-08-23
5
177 Views
Last Modified: 2010-04-30
I need some help converting this C code to the VB4 equivalent:
I have this in C and i don't know C.  I need this equivalent in VB4.  Any help would be appreciated...

// Create a global named event that the LanFax printer driver will signal
// once it's done.
HANDLE hEvent = ::CreateEvent(NULL, FALSE, FALSE, "LanFaxPrinter");
if (hEvent != NULL)
{
// wait for 10 secs
DWORD dwRet = ::WaitForSingleObject(hEvent, 10000);
if (dwRet != WAIT_OBJECT_0)
{
// timeout
}
else
{
// printer driver signaled us: the conversion is done
ProcessOutputFile();
}

// close the event
::CloseHandle(hEvent);
}
thanks in advance
0
Comment
Question by:vfafel
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 2

Accepted Solution

by:
polygon earned 200 total points
ID: 1430606
'Create a global named event that the LanFax printer driver will signal once it's done.
hEvent& = CreateEvent(vbNull, False, False, "LanFaxPrinter")
if hEvent& <> 0 then
  'Wait for 10 sec
  dwRet& = WaitForSingleObject(hEvent&, 10000)
  if dwRet <> WAIT_OBJECT_0 then
    'timeout
  else
    Call ProcessOutputFile 'this must be user-defined procedure
  End If
'Close the event
Call CloseHandle(hEvent&)
End If

---

You must get the declarations of CreateEvent, WaitForSingleObject and CloseHandle API function and WAIT_OBJECT_0 constant from VB's API Viewer.
0
 
LVL 14

Expert Comment

by:waty
ID: 1430607
I have made the same conversion on another question without seeying your code polygon.  ;)
0
 

Author Comment

by:vfafel
ID: 1430608
Thanks...i am getting one error when i run this "BYREF argument type mismatch" associated with the CreateEvent() call...any clues?
0
 

Author Comment

by:vfafel
ID: 1430609
Polygon,
Thanks for the C to VB conversion...i am getting one error when i run this--->"BYREF argument type mismatch" associated with the CreateEvent() call...any clues?

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1430610
Bought This Question.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction While answering a recent question about filtering a custom class collection, I realized that this could be accomplished with very little code by using the ScriptControl (SC) library.  This article will introduce you to the SC library a…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question