Solved

Win32 code to VB 3 Win16 Code

Posted on 1997-08-14
6
259 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

When you try to extract and to view the contents of a Microsoft Update Standalone Package (MSU) for Windows Vista, you cannot extract the files from the MSU. Here we are going to explain how to extract those hotfix details without using any third pa…
In this article, I will show you HOW TO: Perform a Physical to Virtual (P2V) Conversion the easy way from a computer backup (image).
With the advent of Windows 10, Microsoft is pushing a Get Windows 10 icon into the notification area (system tray) of qualifying computers. There are many reasons for wanting to remove this icon. This two-part Experts Exchange video Micro Tutorial s…
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

777 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