Solved

C to VB conversion...

Posted on 1998-08-23
2
114 Views
Last Modified: 2010-04-30
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
sorry so few points...it's all i had left...will get you more soon...
0
Comment
Question by:svfafel
2 Comments
 
LVL 14

Accepted Solution

by:
waty earned 20 total points
ID: 1430590
Here are the declaration of APIs

Declare Function CreateEvent Lib "kernel32" Alias "CreateEventA" (lpEventAttributes As SECURITY_ATTRIBUTES, ByVal bManualReset As Long, ByVal bInitialState As Long, ByVal lpName As String) As Long

Declare Function WaitForSingleObject Lib "kernel32" Alias "WaitForSingleObject" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long

Declare Function CloseHandle Lib "kernel32" Alias "CloseHandle" (ByVal hObject As Long) As Long

dim nEvent    as long
dim nRet      as long

nEvent = CreateEvent(NULL, FALSE, FALSE, "LanFaxPrinter")
if nEvent <> 0
   nRet = WaitForSingleObject(nEvent, 10000)
   if nRet <> 0 then  
      call ProcessOutputFile() 'I don't know this

   endif

end if

CloseHandle(nEvent)

0
 
LVL 13

Expert Comment

by:Mirkwood
ID: 1430591
Bought This Question.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
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…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

830 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