[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Someone who knows C and VB4

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

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.

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
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…
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…
Suggested Courses

650 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