Solved

Win32 code to VB 3 Win16 Code

Posted on 1997-08-14
6
263 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
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

Industry Leaders: 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

Sometimes drives fill up and we don't know why.  If you don't understand the best way to use the tools available, you may end up being stumped as to why your drive says it's not full when you have no space left!  Here's how you can find out...
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…
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…
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…

679 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