Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

GetModuleUsage

Posted on 1997-06-13
9
Medium Priority
?
346 Views
Last Modified: 2008-03-04
I have written a program in VB3 and I need to port it to 32 bits. The only problem I have is that the GetModuleUsage 16 bits api function I did use to "modal" run an external program has gone in the 32 bits api. I need to know how to accomplish this task using the 32 bits api and VB4.
0
Comment
Question by:ega061397
[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
  • 4
9 Comments
 
LVL 4

Accepted Solution

by:
Chizl earned 400 total points
ID: 1427229
To run other EXE files you can a couple of things.  You can use COM or OLE automation or use Shell or ShellExecute.   Com or OLE automation is the best way if you know how its registered and if the program is COM compliant.   If it is then use the function ObjectCreate("Excel.app") for example.  If you use Shell then its as easy as saying   CALL Shell("C:\EXCEL\EXCEL.EXE", 2)
ShellExecute you need to use an API call to use, but works in the same way that shell does.. :)

L8r,
Chizl
http://www.sourcesite.simplenet.com/
The Source Site
The ONLY all platform all language source code site on the net!
0
 

Author Comment

by:ega061397
ID: 1427230
I think I was not very clear to redact my question. I need not only to run a second program, but to wait for it to finnish. And to do it using the VB4 32 bit compiler. I already have done this with the 16 bin Windows API but the GetModuleUsage function is gone in the 32 bit Windows API.
0
 

Author Comment

by:ega061397
ID: 1427231
I think I was not very clear to redact my question. I need not only to run a second program, but to wait for it to finnish. And to do it using the VB4 32 bit compiler. I already have done this with the 16 bin Windows API but the GetModuleUsage function is gone in the 32 bit Windows API.
0
Independent Software Vendors: 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!

 
LVL 4

Expert Comment

by:Chizl
ID: 1427232
Is the second program a DOS program?  Will it be opening a DOS window?
0
 

Author Comment

by:ega061397
ID: 1427233
No, the second program is a Windows program and it wont open any dos box.
0
 
LVL 4

Expert Comment

by:Chizl
ID: 1427234
Is the second program a DOS program?  Does it open a DOS window?

L8r,
Chizl
0
 
LVL 4

Expert Comment

by:Chizl
ID: 1427235
Also does the second program close out completely when finished if so you can do the following..

Declare Function FindWindow Lib "user32.dll" _
                  (ByVal lpclassname As Any, _
                  ByVal lpwindowname As Any) _
                  As Integer

Function CallProgram()
   cText = "Window Caption of second program"

   call Shell("The_second_program.exe",0)

   Wait 5 ' give the program enough time to initialize

   Do While FindWindow(0&, cText) <> Null
        DoEvents
   Loop
end function

Function Wait(nSec As Integer)
    Start = Timer
    Do While Timer < Start + nSec
        DoEvents
    Loop
End Function

0
 
LVL 4

Expert Comment

by:Chizl
ID: 1427236
Please change the :

call Shell("The_second_program.exe",0)

To :

call Shell("The_second_program.exe",2)

The "0" would make the program not show up on screen.:)
0
 

Author Comment

by:ega061397
ID: 1427237
excelent Chizl
thanks a lot !!!!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

Introduction In a recent article (http://www.experts-exchange.com/A_7811-A-Better-Concatenate-Function.html) for the Excel community, I showed an improved version of the Excel Concatenate() function.  While writing that article I realized that no o…
Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…
Suggested Courses

715 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