Solved

Win32 code to VB 3 Win16 Code

Posted on 1997-08-14
6
252 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
Comment Utility
Edited text of question
0
 
LVL 1

Expert Comment

by:johnsm
Comment Utility
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
Comment Utility
This question should be directed to Programming/Visual Basic
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Expert Comment

by:zeedjej
Comment Utility
test
0
 

Accepted Solution

by:
zeedjej earned 100 total points
Comment Utility
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
Comment Utility
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

The curse of the end user strikes again      

You’ve updated all your end user’s email signatures. Hooray! But guess what? They’re playing around with the HTML, adding stupid taglines and ruining the imagery. Find out how you can save your signatures from end users today.

Join & Write a Comment

For a variety of reasons, it sometimes makes sense to reboot a Windows-based computer on a regular, perhaps daily basis. This "cures" a lot of ills by resetting processes, flushing caches, refreshing memory, and reestablish network connections. In a…
Storage devices are generally used to save the data or sometime transfer the data from one computer system to another system. However, sometimes user accidentally erased their important data from the Storage devices. Users have to know how data reco…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …

728 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now