|
by: dim |
last post by:
Copied directly from exaple book but not working....
All i get is an empty 0 byte file
Call to GetLastError directly after the call to WriteFile returns 0
(NO_ERROR) but no data sees to be written :-(
??????????
Thx
|
by: Chuck Rittersdorf |
last post by:
Hi There
I am having a problem using the win32 API from VB6.
I am trying to send a command string to a printer(zebra TLP 2742) on
LPT1
using the folowing API functions
CreateFile and WriteFile
I have written C code which works fine, just the VB translation/port
|
by: red |
last post by:
I have this:
using System;
using System.Runtime.InteropServices;
using System.Text;
class FileReader
{
const uint GENERIC_READ = 0x80000000;
const uint OPEN_EXISTING = 3;
|
by: Andrew Clark |
last post by:
Hello,
Thanks for all replies on this subject. I still cannot get CreateFile to
retun a good value though. I went to PInvoke.net and saw the VB.NET
declaration of this function:
<DllImport("kernel32.dll", SetLastError:=True)> Private Shared Function
CreateFile(ByVal lpFileName As String, ByVal dwDesiredAccess As
EFileAccess, ByVal dwShareMode As EFileShare, ByVal lpSecurityAttributes
As IntPtr, ByVal dwCreationDisposition As...
|
by: Nitin Narang |
last post by:
I have a piece of code which is moved to .NET VC7 recently from VC6 and there
has been an apparent change in behavior using CreateFile/Writefile
functionality.
I am creating a file on a shared drive using the win32 Api and using the
handle returned, i call writefile giving number of bytes to write as 1MB.
Shared directory on the machine maps to F: drive ( "shared" is the directory
name maps to " F:")
In VC6 on executing...
|
|
by: Terry Olsen |
last post by:
I'm trying to create a disk image of a floppy disk. Since I can't open
the device using the system.io methods, i'm trying to use the CreateFile
API to get a handle for me. But the call fails (returning a -1).
Here's the code:
Const GENERIC_READ = &H80000000
Const OPEN_EXISTING = 3
Const FILE_SHARE_READ = &H1
Const FILE_SHARE_WRITE = &H2
Const FILE_ATTRIBUTE_NORMAL = &H80
|
by: Vadim |
last post by:
Hi,
I will have to send a file to a user's browser to be opened in a Save, Open
manner, I am using HttpResponse.WriteFile for this, the info to be sent will
have to be first accumulated in a temp file in a temp directory and sent to
a user and then I would want to delete the temp file. Please let me know if
the following sequence will be correct:
HttpResponse.WriteFile(TempFileName)
HttpResponse.End
|
by: Joe B. |
last post by:
I have been wading through using SetupDi... API to get a device path to use
in CreateFile so that I could open a USB HID device.
I can now get a device path, but when I try to open for
GENERIC_READ|GENERIC_WRITE, I get an error that only tells me "Access
Denied". If I use zero in dwDesiredAccess, I get a valid handle that I can
use for device query access and use HidD_GetAttributes to read the Vendor ID
and Product ID so on that level I...
|
by: MIUSS |
last post by:
Hello
I got an unusual problem and I don't know how to solve it out.
I need to get success with the handle variable hFile. It's not problem
'til I use wcscpy(...). I mean, when I take out those two double-
slashes the source is not working and the func CreateFile returns
0xFFFFFF to that variable. It seems to me that it has some context
with using wcscpy? But why?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms.
Adolph will...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
|