?
Solved

Someone who knows C and VB4

Posted on 1998-08-23
5
Medium Priority
?
179 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 800 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
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…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Suggested Courses
Course of the Month14 days, 12 hours left to enroll

770 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