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
Solved

Win32 code to VB 3 Win16 Code

Posted on 1997-08-14
6
262 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
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
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

Suggested Solutions

If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
Learn how to PXE Boot both BIOS & UEFI machines with DHCP Policies and Custom Vendor Classes
This video Micro Tutorial explains how to clone a hard drive using a commercial software product for Windows systems called Casper from Future Systems Solutions (FSS). Cloning makes an exact, complete copy of one hard disk drive (HDD) onto another d…
Windows 8 came with a dramatically different user interface known as Metro. Notably missing from that interface was a Start button and Start Menu. Microsoft responded to negative user feedback of the Metro interface, bringing back the Start button a…

808 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