Click here to Skip to main content
16,010,334 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to Map a C++ Struct from a DLL into C# Pin
20-Feb-02 22:15
suss20-Feb-02 22:15 
AnswerRe: How to Map a C++ Struct from a DLL into C# Pin
Filip21-Feb-02 3:32
Filip21-Feb-02 3:32 
AnswerRe: How to Map a C++ Struct from a DLL into C# Pin
James T. Johnson21-Feb-02 19:56
James T. Johnson21-Feb-02 19:56 
GeneralRe: How to Map a C++ Struct from a DLL into C# Pin
Felix Nielsen21-Feb-02 23:01
Felix Nielsen21-Feb-02 23:01 
GeneralRe: How to Map a C++ Struct from a DLL into C# Pin
Felix Nielsen22-Feb-02 11:26
Felix Nielsen22-Feb-02 11:26 
GeneralRe: How to Map a C++ Struct from a DLL into C# Pin
James T. Johnson22-Feb-02 14:08
James T. Johnson22-Feb-02 14:08 
Generalcall winapi in c# Pin
Filip20-Feb-02 2:44
Filip20-Feb-02 2:44 
GeneralRe: call winapi in c# Pin
20-Feb-02 6:11
suss20-Feb-02 6:11 
when is use this code in VB6.0 it works
but when i try to import the functions via C# (dllimport) it doesn't work


//VB6.0 code

Option Explicit

Private Type DOCINFO
pDocName As String
pOutputFile As String
pDatatype As String
End Type

Private Declare Function ClosePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function EndDocPrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function EndPagePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function OpenPrinter Lib "winspool.drv" Alias _
"OpenPrinterA" (ByVal pPrinterName As String, phPrinter As Long, _
ByVal pDefault As Long) As Long
Private Declare Function StartDocPrinter Lib "winspool.drv" Alias _
"StartDocPrinterA" (ByVal hPrinter As Long, ByVal Level As Long, _
pDocInfo As DOCINFO) As Long
Private Declare Function StartPagePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long) As Long
Private Declare Function WritePrinter Lib "winspool.drv" (ByVal _
hPrinter As Long, pBuf As Any, ByVal cdBuf As Long, _
pcWritten As Long) As Long

Private Sub Command1_Click()
Dim lhPrinter As Long
Dim lReturn As Long
Dim lpcWritten As Long
Dim lDoc As Long
Dim sWrittenData As String
Dim MyDocInfo As DOCINFO
lReturn = OpenPrinter(Printer.DeviceName, hPrinter, 0)
If lReturn = 0 Then
MsgBox "The Printer Name you typed wasn't recognized."
Exit Sub
End If
MyDocInfo.pDocName = "AAAAAA"
MyDocInfo.pOutputFile = vbNullString
MyDocInfo.pDatatype = vbNullString
lDoc = StartDocPrinter(lhPrinter, 1, MyDocInfo)
Call StartPagePrinter(lhPrinter)
sWrittenData = "How's that for Magic !!!!" & vbFormFeed
lReturn = WritePrinter(lhPrinter, ByVal sWrittenData, _
Len(sWrittenData), lpcWritten)
lReturn = EndPagePrinter(lhPrinter)
lReturn = EndDocPrinter(lhPrinter)
lReturn = ClosePrinter(lhPrinter)
End Sub
Confused | :confused: Confused | :confused: Confused | :confused: Confused | :confused:
GeneralC# profiling tool Pin
SimonS20-Feb-02 1:08
SimonS20-Feb-02 1:08 
GeneralRe: C# profiling tool Pin
SimonS20-Feb-02 3:04
SimonS20-Feb-02 3:04 
GeneralFile Icon and Type Pin
BLaZiNiX19-Feb-02 16:39
BLaZiNiX19-Feb-02 16:39 
GeneralRe: File Icon and Type Pin
Chris Maunder21-Feb-02 7:52
cofounderChris Maunder21-Feb-02 7:52 
GeneralRe: File Icon and Type Pin
BLaZiNiX21-Feb-02 10:53
BLaZiNiX21-Feb-02 10:53 
GeneralAccessing Data stored in a class Pin
Gavin_Mannion18-Feb-02 0:16
Gavin_Mannion18-Feb-02 0:16 
GeneralRe: Accessing Data stored in a class Pin
James T. Johnson18-Feb-02 1:14
James T. Johnson18-Feb-02 1:14 
GeneralRe: Accessing Data stored in a class Pin
Gavin_Mannion18-Feb-02 3:20
Gavin_Mannion18-Feb-02 3:20 
GeneralRe: Accessing Data stored in a class Pin
James T. Johnson18-Feb-02 17:46
James T. Johnson18-Feb-02 17:46 
GeneralRe: Accessing Data stored in a class Pin
Gavin_Mannion18-Feb-02 22:00
Gavin_Mannion18-Feb-02 22:00 
GeneralRe: Accessing Data stored in a class Pin
James T. Johnson18-Feb-02 22:40
James T. Johnson18-Feb-02 22:40 
GeneralRe: Accessing Data stored in a class Pin
Gavin_Mannion18-Feb-02 22:57
Gavin_Mannion18-Feb-02 22:57 
GeneralRe: Accessing Data stored in a class Pin
James T. Johnson18-Feb-02 23:09
James T. Johnson18-Feb-02 23:09 
GeneralRe: Accessing Data stored in a class Pin
Gavin_Mannion18-Feb-02 23:13
Gavin_Mannion18-Feb-02 23:13 
GeneralRe: Accessing Data stored in a class Pin
James T. Johnson18-Feb-02 23:21
James T. Johnson18-Feb-02 23:21 
GeneralSecurity in webservices Pin
17-Feb-02 22:12
suss17-Feb-02 22:12 
Generalclick/doubleclick event paradox Pin
Senkwe Chanda17-Feb-02 21:38
Senkwe Chanda17-Feb-02 21:38 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.