Solved

Win32 code to VB 3 Win16 Code

Posted on 1997-08-14
6
272 Views
Last Modified: 2013-12-29
I have the following code that I would like to convert to VB3

To run under Windows 3.11. The functions listed are WIN32 Procedure calls!!


hDevice = CreateFile( "\\\\.\\LPN.VXD",0,0,NULL,0,FILE_FLAG_DELETE_ON_CLOSE,NULL);

DeviceIoControl(hDevice,                  // device handle
            3,                        // control code
            disableMode,                  // disable control (Note: this is not a buffer pointer.)
            0,                              
            NULL,            
            NULL,            
            NULL,
NULL);

CloseHandle(hDevice)

Thanks for the help!!!

Meir
yeelut@ibm.net
0
Comment
Question by:meir081497
[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
6 Comments
 

Author Comment

by:meir081497
ID: 1803654
Edited text of question
0
 
LVL 1

Expert Comment

by:johnsm
ID: 1803655
You might want to try the Windows API Bible (available at Barnes and Nobel). It has all of the procedure calls for windows 3.11 for VB.
0
 

Expert Comment

by:mwhitt
ID: 1803656
This question should be directed to Programming/Visual Basic
0
Technology Partners: 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!

 

Expert Comment

by:zeedjej
ID: 1803657
test
0
 

Accepted Solution

by:
zeedjej earned 100 total points
ID: 1803658
This is the Win31API function that (what I know) is closest to Createfile with
the FILE_FLAG_DELETE_ON_CLOSE parameter set. Note that this function doesn't
delete the file afterwards. You declare it as follows:
Declare Function GetTempFileName Lib "Kernel" (ByVal cDriveLetter As Integer,
ByVal lpPrefixString As String, ByVal wUnique As Integer, ByVal lpTempFileName
As String) As Integer
'This code gets a tempfile and the name is in tempfilename string buffer
    tempfilename = String$(255, 0)
    dummy = GetTempFileName(0, "", 0, tempfilename)
'This code deletes the tempfile
    dummy = Delfile(tempfilename)

The function DeviceIoControl is unfamiliar to me, and I haven't found any
function that is similar in Win31API. Also it is a little bit  unclear what it
is used to in Your application (what is "device handle 3" and so on). However,
it seems like this function is tied up to the previous function call Createfile,
so brobably you have to find any functionality to support the GetTempFileName
function instead.


     
0
 

Expert Comment

by:zeedjej
ID: 1803659
I also got some documentation about GetTempFileName API function:
GetTempFileName (2.x) but of some reason i can´t post it here, I just get an error message. But if you are interested, please let me know and I will send it to you by e-mail.

0

Featured Post

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!

Question has a verified solution.

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

An introduction to the wonderful sport of Scam Baiting.  Learn how to help fight scammers by beating them at their own game. This great pass time helps the world, while providing an endless source of entertainment. Enjoy!
When asking a question in a forum or creating documentation, screenshots are vital tools that can convey a lot more information and save you and your reader a lot of time
The Task Scheduler is a powerful tool that is built into Windows. It allows you to schedule tasks (actions) on a recurring basis, such as hourly, daily, weekly, monthly, at log on, at startup, on idle, etc. This video Micro Tutorial is a brief intro…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

632 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