Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 122
  • Last Modified:

C to VB conversion...

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
svfafel
Asked:
svfafel
1 Solution
 
watyCommented:
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
 
MirkwoodCommented:
Bought This Question.
0

Featured Post

Ask an Anonymous Question!

Don't feel intimidated by what you don't know. Ask your question anonymously. It's easy! Learn more and upgrade.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now